--- rpm-5.4.7/lib/rpmfc.c.exec_modules~ 2012-03-10 20:05:50.749063779 +0100 +++ rpm-5.4.7/lib/rpmfc.c 2012-03-10 21:05:28.877795213 +0100 @@ -912,10 +912,9 @@ static int rpmfcSCRIPT(rpmfc fc) xx = rpmfcHelper(fc, 'R', "perl"); } else if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) { - xx = rpmfcHelper(fc, 'P', "python"); -#ifdef NOTYET - if (is_executable) -#endif + if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE && !(fc->fcolor->vals[fc->ix] & RPMFC_SCRIPT)) + xx = rpmfcHelper(fc, 'P', "python"); + if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)) xx = rpmfcHelper(fc, 'R', "python"); } else if (fc->fcolor->vals[fc->ix] & RPMFC_LIBTOOL) { @@ -952,10 +951,9 @@ static int rpmfcSCRIPT(rpmfc fc) xx = rpmfcHelper(fc, 'R', "mono"); } else if (fc->fcolor->vals[fc->ix] & RPMFC_RUBY) { - xx = rpmfcHelper(fc, 'P', "ruby"); -#ifdef NOTYET - if (is_executable) -#endif + if (fc->fcolor->vals[fc->ix] & RPMFC_MODULE) + xx = rpmfcHelper(fc, 'P', "ruby"); + if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE)) xx = rpmfcHelper(fc, 'R', "ruby"); } else if (fc->fcolor->vals[fc->ix] & RPMFC_FONT) { @@ -1192,8 +1190,18 @@ assert(fc->fn != NULL); if ((fn[0] == '3' && fn[1] == '2') || (fn[0] == '6' && fn[1] == '4')) fn += 2; - if (!strncmp(fn, "/python", sizeof("/python")-1)) + if (!strncmp(fn, "/python", sizeof("/python")-1)) { fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; + if (strstr(fn, "site-packages")) + fc->fcolor->vals[fc->ix] |= RPMFC_MODULE; + else if (strstr(fn, ".egg")) { + miRE mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS); + if (!mireRegcomp(mire, ".*/.*\\.egg(|-info|-link)(|/.*)$")) + if (mireRegexec(mire, fc->fn[fc->ix], (size_t) 0) >= 0) + fc->fcolor->vals[fc->ix] |= RPMFC_MODULE; + mire = mireFree(mire); + } + } else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1)) { fc->fcolor->vals[fc->ix] |= RPMFC_RUBY; if ((fn = strstr(fn, "/specifications/")) &&