[Collab-qa-commits] r1428 - ddpo-by-mail

Raphael Geissert atomo64-guest at alioth.debian.org
Sun Apr 19 00:09:42 UTC 2009


Author: atomo64-guest
Date: 2009-04-19 00:09:42 +0000 (Sun, 19 Apr 2009)
New Revision: 1428

Added:
   ddpo-by-mail/Makefile
Removed:
   ddpo-by-mail/update-data.rb
Modified:
   ddpo-by-mail/bugs.rb
   ddpo-by-mail/dehs.rb
   ddpo-by-mail/reminder-mail.rb
   ddpo-by-mail/testingissues.rb
Log:
Turn the updater script into a makefile for easier and better handling
Additionally read and store all the data under data/ instead of the current dir


Added: ddpo-by-mail/Makefile
===================================================================
--- ddpo-by-mail/Makefile	                        (rev 0)
+++ ddpo-by-mail/Makefile	2009-04-19 00:09:42 UTC (rev 1428)
@@ -0,0 +1,41 @@
+#!/usr/bin/make -f
+
+UPDATE_TARGETS:=bts2ldap_fullindex ddpo_packages ddpo_maintainers testing-status.raw dehs.txt ood_excuses.txt pts_subscriptions.txt
+WGET_OPTIONS:=-nv -N
+WGET:=wget $(WGET_OPTIONS)
+DATA_DIR:=data
+
+all:
+
+$(DATA_DIR):
+	mkdir $@
+
+update: $(DATA_DIR)
+	@cd $(DATA_DIR) && make -f ../Makefile $(UPDATE_TARGETS)
+
+bts2ldap_fullindex:
+	[ -L fullindex ] || ln -s $@ fullindex
+	$(WGET) http://qa.debian.org/data/bts2ldap/fullindex
+
+ddpo_packages ddpo_maintainers:
+	$(WGET) http://qa.debian.org/data/ddpo/results/$@
+
+testing-status.raw ood_excuses.txt:
+	$(WGET) http://qa.debian.org/~lucas/$@
+
+dehs.txt:
+	[ -L ddpomail.txt ] || ln -s $@ ddpomail.txt
+	$(WGET) http://dehs.alioth.debian.org/ddpomail.txt
+
+pts_subscriptions.txt:
+	ssh master /org/packages.qa.debian.org/bin/get-summary-subscribers.pl > $@
+
+clean: clean-update
+	# remove broken symlinks:
+	find -L $(DATA_DIR) -type l -exec unlink '{}' ';'
+	rmdir $(DATA_DIR) || ls $(DATA_DIR)
+
+clean-update:
+	cd $(DATA_DIR) && $(RM) -f $(UPDATE_TARGETS)
+
+.PHONY: clean clean-update update $(UPDATE_TARGETS)

Modified: ddpo-by-mail/bugs.rb
===================================================================
--- ddpo-by-mail/bugs.rb	2009-04-18 23:13:16 UTC (rev 1427)
+++ ddpo-by-mail/bugs.rb	2009-04-19 00:09:42 UTC (rev 1428)
@@ -19,7 +19,7 @@
   bugmerged = []
   bugrttags = []
 
-  IO::read('bts2ldap_fullindex').each_line do |l|
+  IO::read('data/bts2ldap_fullindex').each_line do |l|
     l.chomp!
     key, val = l.split(' ', 2)
     if key == 'dn:' and bugid != nil

Modified: ddpo-by-mail/dehs.rb
===================================================================
--- ddpo-by-mail/dehs.rb	2009-04-18 23:13:16 UTC (rev 1427)
+++ ddpo-by-mail/dehs.rb	2009-04-19 00:09:42 UTC (rev 1428)
@@ -5,7 +5,7 @@
 
 def get_dehs
   dehs = {}
-  IO::read('dehs.txt').each_line do |l|
+  IO::read('data/dehs.txt').each_line do |l|
     pkg, unstable, upstream, date = l.chomp.split('|')
     serious = false
     if date != "1970-01-01 00:00:00"

Modified: ddpo-by-mail/reminder-mail.rb
===================================================================
--- ddpo-by-mail/reminder-mail.rb	2009-04-18 23:13:16 UTC (rev 1427)
+++ ddpo-by-mail/reminder-mail.rb	2009-04-19 00:09:42 UTC (rev 1428)
@@ -3,12 +3,8 @@
 require 'ddpo-config'
 require 'bugs'
 require 'testingissues'
-require 'update-data'
 require 'dehs'
 
-# fetch updated files from www
-#update_data
-
 # parse debian-installer packages
 pkg = nil
 dipkgs = []
@@ -27,7 +23,7 @@
 
 # Parse ddpo_packages
 pkgs = Hash::new { [] }
-f = IO::read("ddpo_packages")
+f = IO::read("data/ddpo_packages")
 f.each_line do |l|
   next if l =~ /^\)/
   pkg = l.match(/^([^\(]*)\(/)[1]
@@ -38,7 +34,7 @@
 # Parse ddpo_maintainers
 maintainers_pkg = Hash::new { [] }
 maintainers_name = Hash::new { "" }
-f = IO::read('ddpo_maintainers')
+f = IO::read('data/ddpo_maintainers')
 f.each_line do |l|
   n, email, noid, realname, packages, rest = l.split(/;/)
   maintainers_pkg[email] = packages.split(/ /)
@@ -48,7 +44,7 @@
 
 # read PTS subscribers
 subscribers = Hash::new { [] }
-f = IO::read('pts_subscriptions.txt')
+f = IO::read('data/pts_subscriptions.txt')
 f.each_line do |l|
   l.chomp!
   pkg, subs = l.split(/\t/, 2)
@@ -72,7 +68,7 @@
 
 # Get missing builds
 builds = {}
-IO::read('ood_excuses.txt').each_line do |l|
+IO::read('data/ood_excuses.txt').each_line do |l|
   pkg, ver, archs = l.chomp.split(' ')
   builds[pkg] = archs
 end

Modified: ddpo-by-mail/testingissues.rb
===================================================================
--- ddpo-by-mail/testingissues.rb	2009-04-18 23:13:16 UTC (rev 1427)
+++ ddpo-by-mail/testingissues.rb	2009-04-19 00:09:42 UTC (rev 1428)
@@ -6,7 +6,7 @@
 def testing_issues(dipkgs)
   now = Date::today
 #  file = Dir::glob('../testing-status/data.*').sort[-1]
-  file = 'testing-status.raw'
+  file = 'data/testing-status.raw'
   pts = PkgTestingStatus::read(File::new(file,'r')).reject { |k,v| v.inunstable != now }
   testingissues = {}
   pts.each_pair do |pkg, val|

Deleted: ddpo-by-mail/update-data.rb
===================================================================
--- ddpo-by-mail/update-data.rb	2009-04-18 23:13:16 UTC (rev 1427)
+++ ddpo-by-mail/update-data.rb	2009-04-19 00:09:42 UTC (rev 1428)
@@ -1,16 +0,0 @@
-require 'ddpo-config.rb'
-
-def update_data
-  system("rm -f bts2ldap_fullindex ddpo_packages ddpo_maintainers testing-status.raw dehs.txt ood_excuses.txt pts_subscriptions.txt")
-#  system("wget -q -O bts2ldap_fullindex http://qa.debian.org/data/bts2ldap/fullindex")
-  system("wget -q -O ddpo_packages http://qa.debian.org/data/ddpo/results/ddpo_packages")
-  system("wget -q -O ddpo_maintainers http://qa.debian.org/data/ddpo/results/ddpo_maintainers")
-  system("wget -q -O testing-status.raw http://qa.debian.org/~lucas/testing-status.raw")
-  system("wget -q -O dehs.txt http://dehs.alioth.debian.org/ddpomail.txt")
-  system("wget -q -O ood_excuses.txt http://qa.debian.org/~lucas/ood_excuses.txt")
-  system("ssh master /org/packages.qa.debian.org/bin/get-summary-subscribers.pl > pts_subscriptions.txt")
-end
-
-if $0 == __FILE__
-  update_data
-end




More information about the Collab-qa-commits mailing list