[DRE-commits] [SCM] pkg-ruby-extras.git branch, master, updated. 5a413b35154e79fa073d41241c71c314393712e0

Paul van Tilburg paulvt at debian.org
Sun Jun 24 21:58:51 UTC 2012


The following commit has been merged in the master branch:
commit 5a413b35154e79fa073d41241c71c314393712e0
Author: Paul van Tilburg <paulvt at debian.org>
Date:   Sun Jun 24 23:58:49 2012 +0200

    Add script that (locally) detects which packages need to install gemspecs

diff --git a/needs-gemspec-install b/needs-gemspec-install
new file mode 100755
index 0000000..a2be9c4
--- /dev/null
+++ b/needs-gemspec-install
@@ -0,0 +1,35 @@
+#!/usr/bin/env ruby
+#
+# Checks (locally!) for packages (git repositories) that contain a gemspec
+# in some form, but don't build-depend on gem2deb (>= 0.3.0~) so that it
+# gets installed for usage by rubygems-integration.
+#
+# See also: https://lists.debian.org/debian-ruby/2012/06/msg00097.html
+
+gemspecs = Dir["*/metadata.yml"] + Dir["*/*gemspec"]
+repos = gemspecs.map { |spec| File.dirname spec }.sort
+pkgs = repos.inject({}) { |h, v| h[v] = h[v].to_i + 1; h}.keys
+
+cnt = 0
+pkgs.each do |pkg|
+  puts "I: inspecting #{pkg}" if $DEBUG
+  control = File.readlines(File.join(pkg, "debian/control")).join
+  build_deps = control.match(/^Build-Depends.*:(.*gem2deb.*?)\n\w/m)
+  unless build_deps
+    puts "W: #{pkg} doesn't use gem2deb"
+    next
+  end
+  gem2deb_v = build_deps.to_s.match(/^Build-Depends.*:.*gem2deb\s+\(>= (.*?)\)/m)
+  unless gem2deb_v
+    puts "E: #{pkg} has an unversioned build-depend on gem2deb"
+    cnt += 1
+    next
+  end
+  if gem2deb_v[1] =~ /^0\.3\./
+    puts "I: #{pkg} build-depends on gem2deb (>= 0.3.x)" if $DEBUG
+    next
+  end
+  puts "E: #{pkg} build-depends on gem2deb (>= #{gem2deb_v[1]})"
+  cnt += 1
+end
+puts "I: #{cnt} package#{"s" unless cnt == 1} need to be adjusted and reuploaded"

-- 
pkg-ruby-extras.git



More information about the Pkg-ruby-extras-commits mailing list