match sources to git repos by Vcs-Git header if available
authorChristian Hofstaedtler <ch@grml.org>
Wed, 30 Nov 2011 17:17:42 +0000 (18:17 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Wed, 30 Nov 2011 17:17:42 +0000 (18:17 +0100)
update.rb

index bb8fec2..954b4ef 100755 (executable)
--- a/update.rb
+++ b/update.rb
@@ -159,7 +159,14 @@ used_packages = {
                                     'http://git.grml.org/?p=grml-live.git;a=blob_plain;f=etc/grml/fai/config/package_config/GRML_FULL',
                                    ]),
 }
-sources = parse_debian_sources(fetch_file('http://deb.grml.org/dists/grml-testing/main/source/Sources.gz'))
+sources = {}
+parse_debian_sources(fetch_file('http://deb.grml.org/dists/grml-testing/main/source/Sources.gz')).each do |k,v|
+  if v['Vcs-Git'] and v['Vcs-Git'][0]
+    m = v['Vcs-Git'][0].match 'git.grml.org\/(.*).git$'
+    k = m[1] if m
+  end
+  sources[k] = v
+end
 
 git_repos = Hash[*(Dir.glob('git/*.git').map do |p| [File.basename(p, '.git'), p] end.flatten)]