X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;ds=sidebyside;f=rpm-5.4.7-fix-generation-of-ruby-abi-provides.patch;h=da95f37c17209da11de3e1fc7121bdc87d661b29;hb=f0190526e611252ad14478726ad4de2c407200cc;hp=b75fd388b1ebf50e38fde9f51ef025d6a3191638;hpb=70f8787d9a6faa68bee6b810a53198c50a9ad760;p=packages%2Frpm.git diff --git a/rpm-5.4.7-fix-generation-of-ruby-abi-provides.patch b/rpm-5.4.7-fix-generation-of-ruby-abi-provides.patch index b75fd38..da95f37 100644 --- a/rpm-5.4.7-fix-generation-of-ruby-abi-provides.patch +++ b/rpm-5.4.7-fix-generation-of-ruby-abi-provides.patch @@ -1,7 +1,7 @@ ---- rpm-5.4.7/lib/rpmfc.c.rubyabi_prov~ 2012-03-10 21:50:02.143073469 +0100 -+++ rpm-5.4.7/lib/rpmfc.c 2012-03-10 21:57:13.898394232 +0100 -@@ -1204,9 +1204,13 @@ assert(fc->fn != NULL); - } +--- rpm-5.4.15/lib/rpmfc.c 2014-12-08 16:52:23.628067323 +0200 ++++ rpm-5.4.15.orig/lib/rpmfc.c 2014-12-08 16:23:46.377110108 +0200 +@@ -1155,9 +1155,13 @@ + fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1)) { fc->fcolor->vals[fc->ix] |= RPMFC_RUBY; - if ((fn = strstr(fn, "/specifications/")) && @@ -17,32 +17,19 @@ } /* XXX: lacking better, more generic classifier... */ else if (!strncmp(fn, "/gstreamer", sizeof("/gstreamer")-1) && ---- rpm-5.4.7/scripts/rubygems.rb.rubyabi_prov~ 2012-03-10 21:50:15.637085059 +0100 -+++ rpm-5.4.7/scripts/rubygems.rb 2012-03-10 21:50:23.928092180 +0100 -@@ -36,7 +36,12 @@ ruby_versioned = false - abi_provide = false - - for path in $stdin.readlines -- if path.match(specpatt) -+ # way fugly, but we make the assumption that if the package has -+ # this file, the package is the current ruby version, and should -+ # therefore provide ruby(abi) = version -+ if provides and path.match(RbConfig::CONFIG["archdir"] + "/rbconfig.rb") -+ abi_provide = true -+ elsif path.match(specpatt) - ruby_versioned = true - gems.push(path.chomp) - # this is quite ugly and lame, but the assumption made is that if any files -@@ -46,12 +51,6 @@ for path in $stdin.readlines - elsif not ruby_versioned - if path.match(RbConfig::CONFIG["rubylibdir"]) - ruby_versioned = true -- # even more fugly, but we make the assumption that if the package has -- # this file, the package is the current ruby version, and should -- # therefore provide ruby(abi) = version -- if provides and path.match(RbConfig::CONFIG["rubylibdir"] + "/Env.rb") -- abi_provide = true -- end - elsif path.match(RbConfig::CONFIG["sitelibdir"]) - ruby_versioned = true - elsif path.match(RbConfig::CONFIG["vendorlibdir"]) +@@ -1177,6 +1181,15 @@ + fn += sizeof("/usr/share")-1; + if (!strncmp(fn, "/python", sizeof("/python")-1)) + fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; ++ else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1) || !strncmp(fn, "/gems/specifications", sizeof("/gems/specifications")-1)) { ++ fc->fcolor->vals[fc->ix] |= RPMFC_RUBY; ++ if ((strstr(fn, ".gemspec") || strstr(fn, "rbconfig.rb"))) { ++ miRE mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS); ++ if (!mireRegcomp(mire, ".*/(specifications/.*\\.gemspec|rbconfig\\.rb)$")) ++ if (mireRegexec(mire, fc->fn[fc->ix], (size_t) 0) >= 0) ++ fc->fcolor->vals[fc->ix] |= RPMFC_MODULE; ++ mire = mireFree(mire); ++ } + } + } + }