From: Panu Matilainen Date: Mon, 1 Feb 2010 11:20:26 +0000 (+0200) Subject: rpmfc script coloring tweaks X-Git-Tag: tznext/4.11.0.1.tizen20130304~2346 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fdf26eaba0528c7bc7e1a2d90e6fd31b39662c81;p=tools%2Flibrpm-tizen.git rpmfc script coloring tweaks - loosen up the perl token to catch more things, such as "/usr/bin/perl -w script text" - remove unnecessary /usr/bin/python token, these get caught by "python " already - remove what now should be unnecessary coloring by interpreter name, both perl and python scripts should get colored by the tokens already --- diff --git a/build/rpmfc.c b/build/rpmfc.c index 0e8eba7..f967f9b 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -462,11 +462,9 @@ static const struct rpmfcTokens_s const rpmfcTokens[] = { { "troff or preprocessor input", RPMFC_MANPAGE|RPMFC_INCLUDE }, { "GNU Info", RPMFC_MANPAGE|RPMFC_INCLUDE }, - { "perl script text", RPMFC_PERL|RPMFC_INCLUDE }, + { "perl ", RPMFC_PERL|RPMFC_INCLUDE }, { "Perl5 module source text", RPMFC_PERL|RPMFC_MODULE|RPMFC_INCLUDE }, - { " /usr/bin/python", RPMFC_PYTHON|RPMFC_INCLUDE }, - /* XXX "a /usr/bin/python -t script text executable" */ /* XXX "python 2.3 byte-compiled" */ { "python ", RPMFC_PYTHON|RPMFC_INCLUDE }, @@ -670,7 +668,6 @@ rpmds rpmfcRequires(rpmfc fc) static int rpmfcSCRIPT(rpmfc fc) { const char * fn = fc->fn[fc->ix]; - const char * bn; rpmds ds; char buf[BUFSIZ]; FILE * fp; @@ -727,13 +724,6 @@ static int rpmfcSCRIPT(rpmfc fc) ds = rpmdsFree(ds); } - /* Set color based on interpreter name. */ - bn = basename(s); - if (rstreq(bn, "perl")) - fc->fcolor->vals[fc->ix] |= RPMFC_PERL; - else if (rstreqn(bn, "python", sizeof("python")-1)) - fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; - break; }