[DRE-commits] r3905 - tools

Lucas Nussbaum lucas at alioth.debian.org
Sat Aug 8 16:16:33 UTC 2009


Author: lucas
Date: 2009-08-08 16:16:33 +0000 (Sat, 08 Aug 2009)
New Revision: 3905

Added:
   tools/fix-svn-fields.rb
Log:
add script used to fix svn fields

Added: tools/fix-svn-fields.rb
===================================================================
--- tools/fix-svn-fields.rb	                        (rev 0)
+++ tools/fix-svn-fields.rb	2009-08-08 16:16:33 UTC (rev 3905)
@@ -0,0 +1,27 @@
+#!/usr/bin/ruby -w
+
+pkgs = Dir::entries('.') - ['.', '..', '.svn'].reject { |e| not File::directory?(e)}
+pkgs.sort!
+pkgs.each do |pkg|
+  f = IO::read(pkg + '/debian/control')
+  vcs = f.split(/\n/).grep(/^Vcs/)
+  if vcs.length != 2
+    puts "ERROR: not 2 vcs lines in #{pkg}"
+    puts "####"
+    puts "Vcs-Svn: svn://svn.debian.org/svn/pkg-ruby-extras/trunk/#{pkg}/"
+    puts "Vcs-Browser: http://svn.debian.org/viewsvn/pkg-ruby-extras/trunk/#{pkg}/"
+    puts "cd #{pkg} ; vim debian/control ; dch 'Added Vcs-* fields.' ; cd .."
+    puts "####"
+    puts ""
+    exit(1)
+  end
+  if vcs.grep(/Vcs-Svn/)[0].split(' ')[1] != "svn://svn.debian.org/svn/pkg-ruby-extras/trunk/#{pkg}/"
+    puts "Wrong Vcs-Svn in #{pkg}"
+    system("sed -i 's#Vcs-Svn: .*#Vcs-Svn: svn://svn.debian.org/svn/pkg-ruby-extras/trunk/#{pkg}/#' #{pkg}/debian/control")
+  end
+  if vcs.grep(/Vcs-Browser/)[0].split(' ')[1] != "http://svn.debian.org/viewsvn/pkg-ruby-extras/trunk/#{pkg}/"
+    puts "Wrong Vcs-Browser in #{pkg}"
+    system("sed -i 's#Vcs-Browser: .*#Vcs-Browser: http://svn.debian.org/viewsvn/pkg-ruby-extras/trunk/#{pkg}/#' #{pkg}/debian/control")
+  end
+
+end


Property changes on: tools/fix-svn-fields.rb
___________________________________________________________________
Added: svn:executable
   + *




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