rpm/rpm-5.4.7-fix-generation-of-ruby-abi-provides.patch

49 lines
2.2 KiB
Diff
Raw Permalink Normal View History

2013-03-27 12:51:15 +04:00
--- 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);
}
else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1)) {
fc->fcolor->vals[fc->ix] |= RPMFC_RUBY;
- if ((fn = strstr(fn, "/specifications/")) &&
- (fn = strrchr(fn, '.')) && !strcmp(fn, ".gemspec"))
- fc->fcolor->vals[fc->ix] |= RPMFC_MODULE;
+ 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);
+ }
}
/* 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"])