diff options
author | Vincent Batts <vbatts@slackware.com> | 2011-01-05 21:27:01 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2011-01-05 21:27:01 -0600 |
commit | 846aa12590cea0c09dd7a64144057107f9c55b66 (patch) | |
tree | e7fa9d892fd4b305f4109e59457935e5aa802289 | |
parent | 3af70c6f6f14ca6922a3978cfe1c06d91a6c74fd (diff) |
rubygem-template: implement a cleaner search for gem dependencies
-rw-r--r-- | rubygem-template.SlackBuild | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/rubygem-template.SlackBuild b/rubygem-template.SlackBuild index 7ec4501..7f66cfa 100644 --- a/rubygem-template.SlackBuild +++ b/rubygem-template.SlackBuild @@ -91,19 +91,22 @@ printf("%s/%s/gems/%s\n", # things could always change gem specification $CWD/$SRCNAM-$VERSION.gem | \ ruby -r yaml -e ' -obj = YAML::load($stdin) -obj.ivars["dependencies"].each {|d| - if not(d.ivars["type"] == :runtime) - next - end - - name = d.ivars["name"] - begin - require name - rescue LoadError - $stderr.write("WARNING: #{name} gem not found\n") - sleep 0.5 - end +c = Config::CONFIG +path = sprintf("%s/%s/gems/%s", + c["libdir"], + c["RUBY_INSTALL_NAME"], + c["ruby_version"]) +sys_gemspecs = Dir.glob(path + "/specifications/*").map {|g| gs = Gem::Specification.load(g); gs.name } +obj = Gem::Specification.from_yaml($stdin) +obj.dependencies.each {|dep| + if not(dep.type == :runtime) + next + end + if not(sys_gemspecs.include?(dep.name)) + $stderr.write("WARNING: #{dep.name} gem not found\n") + sleep 0.5 + end + }' gem install \ |