[Collab-qa-commits] r1217 - in udd: . src
lucas at alioth.debian.org
lucas at alioth.debian.org
Sun Sep 7 17:28:10 UTC 2008
Author: lucas
Date: 2008-09-07 17:28:09 +0000 (Sun, 07 Sep 2008)
New Revision: 1217
Added:
udd/check-size.pl
udd/config.yaml
udd/debvercmp.sql
udd/schema/
udd/test.yaml
udd/time-imports.rb
udd/ubuntu-rsync
udd/udd.py
udd/udd/
Removed:
udd/src/check-size.pl
udd/src/config.yaml
udd/src/debvercmp.sql
udd/src/schema/
udd/src/test.yaml
udd/src/time-imports.rb
udd/src/ubuntu-rsync
udd/src/udd.py
udd/src/udd/
Log:
move udd/* up one dir. makes more sense.
Copied: udd/check-size.pl (from rev 1209, udd/src/check-size.pl)
===================================================================
--- udd/check-size.pl (rev 0)
+++ udd/check-size.pl 2008-09-07 17:28:09 UTC (rev 1217)
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+# Last-Modified: <Sat Jul 26 12:46:51 2008>
+
+# This script is part of the Debian Ultimate Database Project
+# It's used to check the size of the postgres database in use
+# synopsis: check-size.pl <configuration file>
+
+use strict;
+use warnings;
+
+use DBI;
+use YAML::Syck;
+
+$YAML::Syck::ImplicitTyping = 1;
+
+defined $ARGV[0] or die "Usage: $0 <config-file>";
+
+my $config = LoadFile($ARGV[0]);
+
+my $dbname = $config->{general}->{dbname};
+my $dbh = DBI->connect("dbi:Pg:dbname=$dbname") or die "Couldn't connect to database: $!";
+
+my $sth = $dbh->prepare("SELECT pg_database.datname,\
+ pg_size_pretty(pg_database_size(pg_database.datname)) AS size\
+ FROM pg_database;");
+$sth->execute() or die $!;
+
+while(my ($dbname, $dbsize) = $sth->fetchrow_array()) {
+ if($dbname eq $config->{general}->{dbname}) {
+ print "$dbsize\n";
+ exit 0;
+ }
+}
+
+print STDERR "Couldn't find database in response\n";
+exit 1;
Copied: udd/config.yaml (from rev 1215, udd/src/config.yaml)
===================================================================
--- udd/config.yaml (rev 0)
+++ udd/config.yaml 2008-09-07 17:28:09 UTC (rev 1217)
@@ -0,0 +1,202 @@
+general:
+ dbname: udd
+ types:
+ sources: module udd.sources_gatherer
+ packages: module udd.packages_gatherer
+ setup: exec python db_manager.py
+ delete: exec python db_manager.py
+ src-pkg: module udd.src_and_pkg_gatherer
+ popcon: module udd.popcon_gatherer
+ testing-migrations: module udd.testing_migrations_gatherer
+ upload-history: module udd.upload_history_gatherer
+ orphaned_packages: module udd.orphaned_packages_gatherer
+ bugs: exec DEBBUGS_CONFIG_FILE=/org/udd.debian.net/mirrors/bugs.debian.org/etc/config perl /org/udd.debian.net/udd/src/udd/bugs_gatherer.pl
+ carnivore: module udd.carnivore_gatherer
+ lintian: module udd.lintian_gatherer
+ debug: 1
+ timestamp-dir: /org/udd.debian.net/timestamps
+ schema-dir: /org/udd.debian.net/udd/src/schema
+ lock-dir: /org/udd.debian.net/locks
+
+ archs:
+ [alpha, amd64, arm, armeb, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc, all, any, lpia, m32r, s390x, sh3,
+ sh3eb, sh4, sh4eb, sh, knetbsd-i386, netbsd-alpha, sparc64,
+ netbsd-i386, hurd-powerpc, kfreebsd-powerpc, netbsd-powerpc, hurd-sparc,
+ kfreebsd-sparc, netbsd-sparc, darwin-i386, freebsd-i386, openbsd-i386, darwin-powerpc]
+
+debian-lenny:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa,
+ i386, ia64, mips,
+ mipsel, powerpc, s390, sparc]
+ directory: /org/ftp.debian.org/dists/lenny/
+ components: [main, contrib, non-free]
+ distribution: debian
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: lenny
+
+debian-sid:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc]
+ directory: /org/ftp.debian.org/dists/sid/
+ components: [main, contrib, non-free]
+ distribution: debian
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: sid
+
+debian-etch:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc]
+ directory: /org/ftp.debian.org/dists/etch/
+ components: [main, contrib, non-free]
+ distribution: debian
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: etch
+
+debian-backports-etch:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc]
+ directory: /org/ftp.backports.org/dists/etch-backports/
+ components: [main, contrib, non-free]
+ distribution: debian-backports
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: etch
+
+debian-volatile-etch:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc]
+ directory: /org/volatile.debian.org/dists/etch/volatile/
+ components: [main, contrib, non-free]
+ distribution: debian-volatile
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: etch
+
+ubuntu-intrepid:
+ type: src-pkg
+ archs: [amd64, i386]
+ directory: /org/udd.debian.net/mirrors/ubuntu/intrepid/
+ components: [main, multiverse, universe, restricted]
+ distribution: ubuntu
+ release: intrepid
+ packages-table: ubuntu_packages
+ sources-table: ubuntu_sources
+ packages-schema: packages
+ sources-schema: sources
+ update-command: /org/udd.debian.net/mirrors/ubuntu-rsync intrepid /org/udd.debian.net/mirrors/ubuntu
+
+ubuntu-hardy:
+ type: src-pkg
+ archs: [amd64, i386]
+ directory: /org/udd.debian.net/mirrors/ubuntu/hardy/
+ components: [main, multiverse, universe, restricted]
+ distribution: ubuntu
+ release: hardy
+ packages-table: ubuntu_packages
+ sources-table: ubuntu_sources
+ packages-schema: packages
+ sources-schema: sources
+ update-command: /org/udd.debian.net/mirrors/ubuntu-rsync hardy /org/udd.debian.net/mirrors/ubuntu
+
+
+debian-popcon:
+ type: popcon
+ path: /org/udd.debian.net/tmp/all-popcon-results.txt.gz
+ update-command: wget -O /org/udd.debian.net/tmp/all-popcon-results.txt.gz http://popcon.debian.org/all-popcon-results.txt.gz
+ table: popcon
+ schema: popcon
+ packages-table: packages
+
+ubuntu-popcon:
+ type: popcon
+ path: /org/udd.debian.net/tmp/ubuntu-popcon-results.txt.gz
+ update-command: wget -O /org/udd.debian.net/tmp/ubuntu-popcon-results.txt.gz http://popcon.ubuntu.com/all-popcon-results.txt.gz
+ table: ubuntu_popcon
+ schema: popcon
+ packages-table: ubuntu_packages
+
+testing-migrations:
+ type: testing-migrations
+ path: /org/udd.debian.net/tmp/migrations
+ update-command: wget -O /org/udd.debian.net/tmp/migrations 'http://qa.debian.org/~lucas/testing-status.raw'
+ schema: testing_migrations
+ table: migrations
+
+upload-history:
+ type: upload-history
+ path: /org/udd.debian.net/tmp/upload-history
+ update-command: if [ ! -e /org/udd.debian.net/tmp/upload-history/ ]; then mkdir /org/udd.debian.net/tmp/upload-history/; fi; rm -rf /org/udd.debian.net/tmp/upload-history/*; wget -r --no-parent -nd -A debian-devel-* -P /org/udd.debian.net/tmp/upload-history http://qa.debian.org/~filippo/ddc/
+ schema: upload_history
+ table: upload_history
+
+bugs:
+ type: bugs
+ archived: false
+ update-command: /org/udd.debian.net/mirrors/sync-bugs.debian.org
+ table: bugs
+ schema: bugs
+ archived-table: archived_bugs
+ packages-table: packages
+ usertags-table: bugs_usertags
+ sources-table: sources
+ debug: false
+
+bugs-archive:
+ type: bugs
+ archived: true
+ table: bugs
+ schema: bugs
+ archived-table: archived_bugs
+ packages-table: packages
+ usertags-table: bugs_usertags
+ sources-table: sources
+ update-command: /org/udd.debian.net/mirrors/sync-bugs.debian.org
+
+orphaned_packages:
+ type: orphaned_packages
+ table: orphaned_packages
+ setup: orphaned_packages
+ unarchived-table: bugs
+ schema: orphaned_packages
+ bugs-path: /org/bugs.debian.org
+
+carnivore:
+ type: carnivore
+ update-command: /org/udd.debian.net/mirrors/sync-carnivore
+ path: /org/udd.debian.net/mirrors/qa.debian.org/carnivore/report
+ emails-table: carnivore_emails
+ names-table: carnivore_names
+ keys-table: carnivore_keys
+ login-table: carnivore_login
+ schema: carnivore
+
+lintian:
+ type: lintian
+ update-command: rm -f /org/udd.debian.net/mirrors/lintian.log && wget http://lintian.debian.org/lintian.log -O /org/udd.debian.net/mirrors/lintian.log
+ path: /org/udd.debian.net/mirrors/lintian.log
+ table: lintian
+ schema: lintian
Copied: udd/debvercmp.sql (from rev 1209, udd/src/debvercmp.sql)
===================================================================
--- udd/debvercmp.sql (rev 0)
+++ udd/debvercmp.sql 2008-09-07 17:28:09 UTC (rev 1217)
@@ -0,0 +1,103 @@
+CREATE OR REPLACE FUNCTION debvercmp(v1 text, v2 text) RETURNS text AS $$
+ sub parseversion
+ {
+ my $ver = shift;
+ my %verhash;
+ if ($ver =~ /:/)
+ {
+ $ver =~ /^(\d+):(.+)/ or die "bad version number '$ver'";
+ $verhash{epoch} = $1;
+ $ver = $2;
+ }
+ else
+ {
+ $verhash{epoch} = 0;
+ }
+ if ($ver =~ /(.+)-(.+)$/)
+ {
+ $verhash{version} = $1;
+ $verhash{revision} = $2;
+ }
+ else
+ {
+ $verhash{version} = $ver;
+ $verhash{revision} = 0;
+ }
+ return %verhash;
+ }
+
+ sub verrevcmp
+ {
+
+ sub order{
+ my ($x) = @_;
+ ##define order(x) ((x) == '~' ? -1 \
+ # : cisdigit((x)) ? 0 \
+ # : !(x) ? 0 \
+ # : cisalpha((x)) ? (x) \
+ # : (x) + 256)
+ # This comparison is out of dpkg's order to avoid
+ # comparing things to undef and triggering warnings.
+ if (not defined $x) {
+ return 0;
+ }
+ elsif ($x eq '~') {
+ return -1;
+ }
+ elsif ($x =~ /^\d$/) {
+ return 0;
+ }
+ elsif ($x =~ /^[A-Z]$/i) {
+ return ord($x);
+ }
+ else {
+ return ord($x) + 256;
+ }
+ }
+
+ sub next_elem(\@){
+ my $a = shift;
+ return @{$a} ? shift @{$a} : undef;
+ }
+ my ($val, $ref) = @_;
+ $val = "" if not defined $val;
+ $ref = "" if not defined $ref;
+ my @val = split //,$val;
+ my @ref = split //,$ref;
+ my $vc = next_elem @val;
+ my $rc = next_elem @ref;
+ while (defined $vc or defined $rc) {
+ my $first_diff = 0;
+ while ((defined $vc and $vc !~ /^\d$/) or
+ (defined $rc and $rc !~ /^\d$/)) {
+ my $vo = order($vc); my $ro = order($rc);
+ # Unlike dpkg's verrevcmp, we only return 1 or -1 here.
+ return (($vo - $ro > 0) ? 1 : -1) if $vo != $ro;
+ $vc = next_elem @val; $rc = next_elem @ref;
+ }
+ while (defined $vc and $vc eq '0') {
+ $vc = next_elem @val;
+ }
+ while (defined $rc and $rc eq '0') {
+ $rc = next_elem @ref;
+ }
+ while (defined $vc and $vc =~ /^\d$/ and
+ defined $rc and $rc =~ /^\d$/) {
+ $first_diff = ord($vc) - ord($rc) if !$first_diff;
+ $vc = next_elem @val; $rc = next_elem @ref;
+ }
+ return 1 if defined $vc and $vc =~ /^\d$/;
+ return -1 if defined $rc and $rc =~ /^\d$/;
+ return $first_diff if $first_diff;
+ }
+ return 0;
+ }
+ my %version = parseversion $_[0];
+ my %refversion = parseversion $_[1];
+ return 1 if $version{epoch} > $refversion{epoch};
+ return -1 if $version{epoch} < $refversion{epoch};
+ my $r = verrevcmp($version{version}, $refversion{version});
+ return $r if $r;
+ return verrevcmp($version{revision}, $refversion{revision});
+$$ LANGUAGE plperl;
+
Copied: udd/schema (from rev 1209, udd/src/schema)
Deleted: udd/src/check-size.pl
===================================================================
--- udd/src/check-size.pl 2008-09-07 17:22:24 UTC (rev 1216)
+++ udd/src/check-size.pl 2008-09-07 17:28:09 UTC (rev 1217)
@@ -1,36 +0,0 @@
-#!/usr/bin/perl
-# Last-Modified: <Sat Jul 26 12:46:51 2008>
-
-# This script is part of the Debian Ultimate Database Project
-# It's used to check the size of the postgres database in use
-# synopsis: check-size.pl <configuration file>
-
-use strict;
-use warnings;
-
-use DBI;
-use YAML::Syck;
-
-$YAML::Syck::ImplicitTyping = 1;
-
-defined $ARGV[0] or die "Usage: $0 <config-file>";
-
-my $config = LoadFile($ARGV[0]);
-
-my $dbname = $config->{general}->{dbname};
-my $dbh = DBI->connect("dbi:Pg:dbname=$dbname") or die "Couldn't connect to database: $!";
-
-my $sth = $dbh->prepare("SELECT pg_database.datname,\
- pg_size_pretty(pg_database_size(pg_database.datname)) AS size\
- FROM pg_database;");
-$sth->execute() or die $!;
-
-while(my ($dbname, $dbsize) = $sth->fetchrow_array()) {
- if($dbname eq $config->{general}->{dbname}) {
- print "$dbsize\n";
- exit 0;
- }
-}
-
-print STDERR "Couldn't find database in response\n";
-exit 1;
Deleted: udd/src/config.yaml
===================================================================
--- udd/src/config.yaml 2008-09-07 17:22:24 UTC (rev 1216)
+++ udd/src/config.yaml 2008-09-07 17:28:09 UTC (rev 1217)
@@ -1,202 +0,0 @@
-general:
- dbname: udd
- types:
- sources: module udd.sources_gatherer
- packages: module udd.packages_gatherer
- setup: exec python db_manager.py
- delete: exec python db_manager.py
- src-pkg: module udd.src_and_pkg_gatherer
- popcon: module udd.popcon_gatherer
- testing-migrations: module udd.testing_migrations_gatherer
- upload-history: module udd.upload_history_gatherer
- orphaned_packages: module udd.orphaned_packages_gatherer
- bugs: exec DEBBUGS_CONFIG_FILE=/org/udd.debian.net/mirrors/bugs.debian.org/etc/config perl /org/udd.debian.net/udd/src/udd/bugs_gatherer.pl
- carnivore: module udd.carnivore_gatherer
- lintian: module udd.lintian_gatherer
- debug: 1
- timestamp-dir: /org/udd.debian.net/timestamps
- schema-dir: /org/udd.debian.net/udd/src/schema
- lock-dir: /org/udd.debian.net/locks
-
- archs:
- [alpha, amd64, arm, armeb, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc, all, any, lpia, m32r, s390x, sh3,
- sh3eb, sh4, sh4eb, sh, knetbsd-i386, netbsd-alpha, sparc64,
- netbsd-i386, hurd-powerpc, kfreebsd-powerpc, netbsd-powerpc, hurd-sparc,
- kfreebsd-sparc, netbsd-sparc, darwin-i386, freebsd-i386, openbsd-i386, darwin-powerpc]
-
-debian-lenny:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa,
- i386, ia64, mips,
- mipsel, powerpc, s390, sparc]
- directory: /org/ftp.debian.org/dists/lenny/
- components: [main, contrib, non-free]
- distribution: debian
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: lenny
-
-debian-sid:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc]
- directory: /org/ftp.debian.org/dists/sid/
- components: [main, contrib, non-free]
- distribution: debian
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: sid
-
-debian-etch:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc]
- directory: /org/ftp.debian.org/dists/etch/
- components: [main, contrib, non-free]
- distribution: debian
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: etch
-
-debian-backports-etch:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc]
- directory: /org/ftp.backports.org/dists/etch-backports/
- components: [main, contrib, non-free]
- distribution: debian-backports
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: etch
-
-debian-volatile-etch:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc]
- directory: /org/volatile.debian.org/dists/etch/volatile/
- components: [main, contrib, non-free]
- distribution: debian-volatile
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: etch
-
-ubuntu-intrepid:
- type: src-pkg
- archs: [amd64, i386]
- directory: /org/udd.debian.net/mirrors/ubuntu/intrepid/
- components: [main, multiverse, universe, restricted]
- distribution: ubuntu
- release: intrepid
- packages-table: ubuntu_packages
- sources-table: ubuntu_sources
- packages-schema: packages
- sources-schema: sources
- update-command: /org/udd.debian.net/mirrors/ubuntu-rsync intrepid /org/udd.debian.net/mirrors/ubuntu
-
-ubuntu-hardy:
- type: src-pkg
- archs: [amd64, i386]
- directory: /org/udd.debian.net/mirrors/ubuntu/hardy/
- components: [main, multiverse, universe, restricted]
- distribution: ubuntu
- release: hardy
- packages-table: ubuntu_packages
- sources-table: ubuntu_sources
- packages-schema: packages
- sources-schema: sources
- update-command: /org/udd.debian.net/mirrors/ubuntu-rsync hardy /org/udd.debian.net/mirrors/ubuntu
-
-
-debian-popcon:
- type: popcon
- path: /org/udd.debian.net/tmp/all-popcon-results.txt.gz
- update-command: wget -O /org/udd.debian.net/tmp/all-popcon-results.txt.gz http://popcon.debian.org/all-popcon-results.txt.gz
- table: popcon
- schema: popcon
- packages-table: packages
-
-ubuntu-popcon:
- type: popcon
- path: /org/udd.debian.net/tmp/ubuntu-popcon-results.txt.gz
- update-command: wget -O /org/udd.debian.net/tmp/ubuntu-popcon-results.txt.gz http://popcon.ubuntu.com/all-popcon-results.txt.gz
- table: ubuntu_popcon
- schema: popcon
- packages-table: ubuntu_packages
-
-testing-migrations:
- type: testing-migrations
- path: /org/udd.debian.net/tmp/migrations
- update-command: wget -O /org/udd.debian.net/tmp/migrations 'http://qa.debian.org/~lucas/testing-status.raw'
- schema: testing_migrations
- table: migrations
-
-upload-history:
- type: upload-history
- path: /org/udd.debian.net/tmp/upload-history
- update-command: if [ ! -e /org/udd.debian.net/tmp/upload-history/ ]; then mkdir /org/udd.debian.net/tmp/upload-history/; fi; rm -rf /org/udd.debian.net/tmp/upload-history/*; wget -r --no-parent -nd -A debian-devel-* -P /org/udd.debian.net/tmp/upload-history http://qa.debian.org/~filippo/ddc/
- schema: upload_history
- table: upload_history
-
-bugs:
- type: bugs
- archived: false
- update-command: /org/udd.debian.net/mirrors/sync-bugs.debian.org
- table: bugs
- schema: bugs
- archived-table: archived_bugs
- packages-table: packages
- usertags-table: bugs_usertags
- sources-table: sources
- debug: false
-
-bugs-archive:
- type: bugs
- archived: true
- table: bugs
- schema: bugs
- archived-table: archived_bugs
- packages-table: packages
- usertags-table: bugs_usertags
- sources-table: sources
- update-command: /org/udd.debian.net/mirrors/sync-bugs.debian.org
-
-orphaned_packages:
- type: orphaned_packages
- table: orphaned_packages
- setup: orphaned_packages
- unarchived-table: bugs
- schema: orphaned_packages
- bugs-path: /org/bugs.debian.org
-
-carnivore:
- type: carnivore
- update-command: /org/udd.debian.net/mirrors/sync-carnivore
- path: /org/udd.debian.net/mirrors/qa.debian.org/carnivore/report
- emails-table: carnivore_emails
- names-table: carnivore_names
- keys-table: carnivore_keys
- login-table: carnivore_login
- schema: carnivore
-
-lintian:
- type: lintian
- update-command: rm -f /org/udd.debian.net/mirrors/lintian.log && wget http://lintian.debian.org/lintian.log -O /org/udd.debian.net/mirrors/lintian.log
- path: /org/udd.debian.net/mirrors/lintian.log
- table: lintian
- schema: lintian
Deleted: udd/src/debvercmp.sql
===================================================================
--- udd/src/debvercmp.sql 2008-09-07 17:22:24 UTC (rev 1216)
+++ udd/src/debvercmp.sql 2008-09-07 17:28:09 UTC (rev 1217)
@@ -1,103 +0,0 @@
-CREATE OR REPLACE FUNCTION debvercmp(v1 text, v2 text) RETURNS text AS $$
- sub parseversion
- {
- my $ver = shift;
- my %verhash;
- if ($ver =~ /:/)
- {
- $ver =~ /^(\d+):(.+)/ or die "bad version number '$ver'";
- $verhash{epoch} = $1;
- $ver = $2;
- }
- else
- {
- $verhash{epoch} = 0;
- }
- if ($ver =~ /(.+)-(.+)$/)
- {
- $verhash{version} = $1;
- $verhash{revision} = $2;
- }
- else
- {
- $verhash{version} = $ver;
- $verhash{revision} = 0;
- }
- return %verhash;
- }
-
- sub verrevcmp
- {
-
- sub order{
- my ($x) = @_;
- ##define order(x) ((x) == '~' ? -1 \
- # : cisdigit((x)) ? 0 \
- # : !(x) ? 0 \
- # : cisalpha((x)) ? (x) \
- # : (x) + 256)
- # This comparison is out of dpkg's order to avoid
- # comparing things to undef and triggering warnings.
- if (not defined $x) {
- return 0;
- }
- elsif ($x eq '~') {
- return -1;
- }
- elsif ($x =~ /^\d$/) {
- return 0;
- }
- elsif ($x =~ /^[A-Z]$/i) {
- return ord($x);
- }
- else {
- return ord($x) + 256;
- }
- }
-
- sub next_elem(\@){
- my $a = shift;
- return @{$a} ? shift @{$a} : undef;
- }
- my ($val, $ref) = @_;
- $val = "" if not defined $val;
- $ref = "" if not defined $ref;
- my @val = split //,$val;
- my @ref = split //,$ref;
- my $vc = next_elem @val;
- my $rc = next_elem @ref;
- while (defined $vc or defined $rc) {
- my $first_diff = 0;
- while ((defined $vc and $vc !~ /^\d$/) or
- (defined $rc and $rc !~ /^\d$/)) {
- my $vo = order($vc); my $ro = order($rc);
- # Unlike dpkg's verrevcmp, we only return 1 or -1 here.
- return (($vo - $ro > 0) ? 1 : -1) if $vo != $ro;
- $vc = next_elem @val; $rc = next_elem @ref;
- }
- while (defined $vc and $vc eq '0') {
- $vc = next_elem @val;
- }
- while (defined $rc and $rc eq '0') {
- $rc = next_elem @ref;
- }
- while (defined $vc and $vc =~ /^\d$/ and
- defined $rc and $rc =~ /^\d$/) {
- $first_diff = ord($vc) - ord($rc) if !$first_diff;
- $vc = next_elem @val; $rc = next_elem @ref;
- }
- return 1 if defined $vc and $vc =~ /^\d$/;
- return -1 if defined $rc and $rc =~ /^\d$/;
- return $first_diff if $first_diff;
- }
- return 0;
- }
- my %version = parseversion $_[0];
- my %refversion = parseversion $_[1];
- return 1 if $version{epoch} > $refversion{epoch};
- return -1 if $version{epoch} < $refversion{epoch};
- my $r = verrevcmp($version{version}, $refversion{version});
- return $r if $r;
- return verrevcmp($version{revision}, $refversion{revision});
-$$ LANGUAGE plperl;
-
Deleted: udd/src/test.yaml
===================================================================
--- udd/src/test.yaml 2008-09-07 17:22:24 UTC (rev 1216)
+++ udd/src/test.yaml 2008-09-07 17:28:09 UTC (rev 1217)
@@ -1,202 +0,0 @@
-general:
- dbname: udd-test
- types:
- sources: module udd.sources_gatherer
- packages: module udd.packages_gatherer
- setup: exec python db_manager.py
- delete: exec python db_manager.py
- src-pkg: module udd.src_and_pkg_gatherer
- popcon: module udd.popcon_gatherer
- testing-migrations: module udd.testing_migrations_gatherer
- upload-history: module udd.upload_history_gatherer
- orphaned_packages: module udd.orphaned_packages_gatherer
- bugs: exec DEBBUGS_CONFIG_FILE=/org/udd.debian.net/mirrors/bugs.debian.org/etc/config perl /org/udd.debian.net/udd/src/udd/bugs_gatherer.pl
- carnivore: module udd.carnivore_gatherer
- lintian: module udd.lintian_gatherer
- debug: 1
- timestamp-dir: /org/udd.debian.net/timestamps
- schema-dir: /org/udd.debian.net/udd/src/schema
- lock-dir: /org/udd.debian.net/locks
-
- archs:
- [alpha, amd64, arm, armeb, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc, all, any, lpia, m32r, s390x, sh3,
- sh3eb, sh4, sh4eb, sh, knetbsd-i386, netbsd-alpha, sparc64,
- netbsd-i386, hurd-powerpc, kfreebsd-powerpc, netbsd-powerpc, hurd-sparc,
- kfreebsd-sparc, netbsd-sparc, darwin-i386, freebsd-i386, openbsd-i386, darwin-powerpc]
-
-debian-lenny:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa,
- i386, ia64, mips,
- mipsel, powerpc, s390, sparc]
- directory: /org/ftp.debian.org/dists/lenny/
- components: [main, contrib, non-free]
- distribution: debian
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: lenny
-
-debian-sid:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc]
- directory: /org/ftp.debian.org/dists/sid/
- components: [main, contrib, non-free]
- distribution: debian
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: sid
-
-debian-etch:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc]
- directory: /org/ftp.debian.org/dists/etch/
- components: [main, contrib, non-free]
- distribution: debian
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: etch
-
-debian-backports-etch:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc]
- directory: /org/ftp.backports.org/dists/etch-backports/
- components: [main, contrib, non-free]
- distribution: debian-backports
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: etch
-
-debian-volatile-etch:
- type: src-pkg
- archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
- i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
- mipsel, powerpc, ppc64, s390, sparc]
- directory: /org/volatile.debian.org/dists/etch/volatile/
- components: [main, contrib, non-free]
- distribution: debian-volatile
- packages-table: packages
- sources-table: sources
- packages-schema: packages
- sources-schema: sources
- release: etch
-
-ubuntu-intrepid:
- type: src-pkg
- archs: [amd64, i386]
- directory: /org/udd.debian.net/mirrors/ubuntu/intrepid/
- components: [main, multiverse, universe, restricted]
- distribution: ubuntu
- release: intrepid
- packages-table: ubuntu_packages
- sources-table: ubuntu_sources
- packages-schema: packages
- sources-schema: sources
- update-command: /org/udd.debian.net/mirrors/ubuntu-rsync intrepid /org/udd.debian.net/mirrors/ubuntu
-
-ubuntu-hardy:
- type: src-pkg
- archs: [amd64, i386]
- directory: /org/udd.debian.net/mirrors/ubuntu/hardy/
- components: [main, multiverse, universe, restricted]
- distribution: ubuntu
- release: hardy
- packages-table: ubuntu_packages
- sources-table: ubuntu_sources
- packages-schema: packages
- sources-schema: sources
- update-command: /org/udd.debian.net/mirrors/ubuntu-rsync hardy /org/udd.debian.net/mirrors/ubuntu
-
-
-debian-popcon:
- type: popcon
- path: /org/udd.debian.net/tmp/all-popcon-results.txt.gz
- update-command: wget -O /org/udd.debian.net/tmp/all-popcon-results.txt.gz http://popcon.debian.org/all-popcon-results.txt.gz
- table: popcon
- schema: popcon
- packages-table: packages
-
-ubuntu-popcon:
- type: popcon
- path: /org/udd.debian.net/tmp/ubuntu-popcon-results.txt.gz
- update-command: wget -O /org/udd.debian.net/tmp/ubuntu-popcon-results.txt.gz http://popcon.ubuntu.com/all-popcon-results.txt.gz
- table: ubuntu_popcon
- schema: popcon
- packages-table: ubuntu_packages
-
-testing-migrations:
- type: testing-migrations
- path: /org/udd.debian.net/tmp/migrations
- update-command: wget -O /org/udd.debian.net/tmp/migrations 'http://qa.debian.org/~lucas/testing-status.raw'
- schema: testing_migrations
- table: migrations
-
-upload-history:
- type: upload-history
- path: /org/udd.debian.net/tmp/upload-history
- update-command: if [ ! -e /org/udd.debian.net/tmp/upload-history/ ]; then mkdir /org/udd.debian.net/tmp/upload-history/; fi; rm -rf /org/udd.debian.net/tmp/upload-history/*; wget -r --no-parent -nd -A debian-devel-* -P /org/udd.debian.net/tmp/upload-history http://qa.debian.org/~filippo/ddc/
- schema: upload_history
- table: upload_history
-
-bugs:
- type: bugs
- archived: false
- update-command: /org/udd.debian.net/mirrors/sync-bugs.debian.org
- table: bugs
- schema: bugs
- archived-table: archived_bugs
- packages-table: packages
- usertags-table: bugs_usertags
- sources-table: sources
- debug: false
-
-bugs-archive:
- type: bugs
- archived: true
- table: bugs
- schema: bugs
- archived-table: archived_bugs
- packages-table: packages
- usertags-table: bugs_usertags
- sources-table: sources
- update-command: /org/udd.debian.net/mirrors/sync-bugs.debian.org
-
-orphaned_packages:
- type: orphaned_packages
- table: orphaned_packages
- setup: orphaned_packages
- unarchived-table: bugs
- schema: orphaned_packages
- bugs-path: /org/bugs.debian.org
-
-carnivore:
- type: carnivore
- update-command: /org/udd.debian.net/mirrors/sync-carnivore
- path: /org/udd.debian.net/mirrors/qa.debian.org/carnivore/report
- emails-table: carnivore_emails
- names-table: carnivore_names
- keys-table: carnivore_keys
- login-table: carnivore_login
- schema: carnivore
-
-lintian:
- type: lintian
- update-command: rm -f /org/udd.debian.net/mirrors/lintian.log && wget http://lintian.debian.org/lintian.log -O /org/udd.debian.net/mirrors/lintian.log
- path: /org/udd.debian.net/mirrors/lintian.log
- table: lintian
- schema: lintian
Deleted: udd/src/time-imports.rb
===================================================================
--- udd/src/time-imports.rb 2008-09-07 17:22:24 UTC (rev 1216)
+++ udd/src/time-imports.rb 2008-09-07 17:28:09 UTC (rev 1217)
@@ -1,17 +0,0 @@
-#!/usr/bin/ruby -w
-
-sources = [ 'debian-sid', 'debian-etch', 'debian-lenny', 'ubuntu-intrepid', 'ubuntu-hardy', 'debian-popcon', 'ubuntu-popcon', 'testing-migrations', 'upload-history', 'bugs', 'orphaned_packages', 'bugs_archived' ]
-# 'carnivore', 'lintian'
-
-sources.each do |s|
- ts = Time::now
- system("/org/udd.debian.net/update-and-dispatch.sh #{s}")
- te = Time::now
- puts "#### #{s} first import: #{te-ts}s"
-end
-sources.each do |s|
- ts = Time::now
- system("/org/udd.debian.net/update-and-dispatch.sh #{s}")
- te = Time::now
- puts "#### #{s} second import: #{te-ts}s"
-end
Deleted: udd/src/ubuntu-rsync
===================================================================
--- udd/src/ubuntu-rsync 2008-09-07 17:22:24 UTC (rev 1216)
+++ udd/src/ubuntu-rsync 2008-09-07 17:28:09 UTC (rev 1217)
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ $# != 2 ]; then
- echo "Usage: $0 <dist> <dest>"
- exit 1
-fi
-
-rsync -rdv --include "Packages.gz" --include "Sources.gz" --include "**/" --exclude "*" "archive.ubuntu.com::ubuntu/dists/$1/" $2/$1
Deleted: udd/src/udd.py
===================================================================
--- udd/src/udd.py 2008-09-07 17:22:24 UTC (rev 1216)
+++ udd/src/udd.py 2008-09-07 17:28:09 UTC (rev 1217)
@@ -1,77 +0,0 @@
-#!/usr/bin/env python
-# Last-Modified: <Tue Aug 19 13:55:40 2008>
-
-"""Dispatch udd gatherers
-
-This script is used to dispatch the source gatherers of the UDD project."""
-
-import sys
-from os import system
-from time import asctime
-import udd.aux
-import os.path
-
-def print_help():
- print "Usage: " + sys.argv[0] + " <configuration> <command> <source1> [source2 source3 ...]"
-
-if __name__ == '__main__':
- if len(sys.argv) < 4:
- print_help()
- sys.exit(1)
-
- command = sys.argv[2]
- if command not in ('run', 'setup', 'drop', 'tables', 'update', 'schema'):
- sys.stderr.write("command has to be one of 'run', 'setup', 'drop', 'update', 'schema' and 'tables'\n")
- sys.exit(1)
-
- config = udd.aux.load_config(open(sys.argv[1]).read())
-
- types = config['general']['types']
-
- connection = udd.aux.open_connection(config)
-
- schemata = {}
- # Process the sources
- for src in sys.argv[3:]:
- src_config = config[src]
- type = src_config['type']
- udd.aux.lock(config, src)
- try:
- # If the command is update, we need a special case. Otherwise we can just use the gatherer's methods
- if command == 'update':
- if "update-command" in src_config:
- result = system(src_config['update-command'])
- if result != 0:
- sys.exit(result)
- if 'timestamp-dir' in config['general']:
- f = open(os.path.join(config['general']['timestamp-dir'], src+".update"), "w")
- f.write(asctime())
- f.close()
- elif command == 'schema':
- for tag in ('schema', 'packages-schema', 'sources-schema'):
- if not tag in src_config:
- continue
- schema = config['general']['schema-dir'] + '/' + src_config[tag]
- print (open(schema).read() % src_config)
- else:
- (src_command,rest) = types[type].split(None, 1)
- if src_command == "exec":
- system(rest + " " + sys.argv[1] + " " + sys.argv[2] + " " + src)
- elif src_command == "module":
- exec("import " + rest)
- exec "gatherer = " + rest + ".get_gatherer(connection, config, src)"
- if command == 'tables':
- exec "tables = gatherer.%s()" % command
- print "\n".join(tables)
- else:
- exec "gatherer.%s()" % command
- if 'timestamp-dir' in config['general']:
- f = open(os.path.join(config['general']['timestamp-dir'], src+".dispatch"), "w")
- f.write(asctime())
- f.close()
- except:
- udd.aux.unlock(config, src)
- raise
- udd.aux.unlock(config, src)
- connection.commit()
-
Copied: udd/test.yaml (from rev 1215, udd/src/test.yaml)
===================================================================
--- udd/test.yaml (rev 0)
+++ udd/test.yaml 2008-09-07 17:28:09 UTC (rev 1217)
@@ -0,0 +1,202 @@
+general:
+ dbname: udd-test
+ types:
+ sources: module udd.sources_gatherer
+ packages: module udd.packages_gatherer
+ setup: exec python db_manager.py
+ delete: exec python db_manager.py
+ src-pkg: module udd.src_and_pkg_gatherer
+ popcon: module udd.popcon_gatherer
+ testing-migrations: module udd.testing_migrations_gatherer
+ upload-history: module udd.upload_history_gatherer
+ orphaned_packages: module udd.orphaned_packages_gatherer
+ bugs: exec DEBBUGS_CONFIG_FILE=/org/udd.debian.net/mirrors/bugs.debian.org/etc/config perl /org/udd.debian.net/udd/src/udd/bugs_gatherer.pl
+ carnivore: module udd.carnivore_gatherer
+ lintian: module udd.lintian_gatherer
+ debug: 1
+ timestamp-dir: /org/udd.debian.net/timestamps
+ schema-dir: /org/udd.debian.net/udd/src/schema
+ lock-dir: /org/udd.debian.net/locks
+
+ archs:
+ [alpha, amd64, arm, armeb, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc, all, any, lpia, m32r, s390x, sh3,
+ sh3eb, sh4, sh4eb, sh, knetbsd-i386, netbsd-alpha, sparc64,
+ netbsd-i386, hurd-powerpc, kfreebsd-powerpc, netbsd-powerpc, hurd-sparc,
+ kfreebsd-sparc, netbsd-sparc, darwin-i386, freebsd-i386, openbsd-i386, darwin-powerpc]
+
+debian-lenny:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa,
+ i386, ia64, mips,
+ mipsel, powerpc, s390, sparc]
+ directory: /org/ftp.debian.org/dists/lenny/
+ components: [main, contrib, non-free]
+ distribution: debian
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: lenny
+
+debian-sid:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc]
+ directory: /org/ftp.debian.org/dists/sid/
+ components: [main, contrib, non-free]
+ distribution: debian
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: sid
+
+debian-etch:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc]
+ directory: /org/ftp.debian.org/dists/etch/
+ components: [main, contrib, non-free]
+ distribution: debian
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: etch
+
+debian-backports-etch:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc]
+ directory: /org/ftp.backports.org/dists/etch-backports/
+ components: [main, contrib, non-free]
+ distribution: debian-backports
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: etch
+
+debian-volatile-etch:
+ type: src-pkg
+ archs: [alpha, amd64, arm, armel, hppa, hurd-i386,
+ i386, i486, ia64, kfreebsd-amd64, kfreebsd-i386, m68k, mips,
+ mipsel, powerpc, ppc64, s390, sparc]
+ directory: /org/volatile.debian.org/dists/etch/volatile/
+ components: [main, contrib, non-free]
+ distribution: debian-volatile
+ packages-table: packages
+ sources-table: sources
+ packages-schema: packages
+ sources-schema: sources
+ release: etch
+
+ubuntu-intrepid:
+ type: src-pkg
+ archs: [amd64, i386]
+ directory: /org/udd.debian.net/mirrors/ubuntu/intrepid/
+ components: [main, multiverse, universe, restricted]
+ distribution: ubuntu
+ release: intrepid
+ packages-table: ubuntu_packages
+ sources-table: ubuntu_sources
+ packages-schema: packages
+ sources-schema: sources
+ update-command: /org/udd.debian.net/mirrors/ubuntu-rsync intrepid /org/udd.debian.net/mirrors/ubuntu
+
+ubuntu-hardy:
+ type: src-pkg
+ archs: [amd64, i386]
+ directory: /org/udd.debian.net/mirrors/ubuntu/hardy/
+ components: [main, multiverse, universe, restricted]
+ distribution: ubuntu
+ release: hardy
+ packages-table: ubuntu_packages
+ sources-table: ubuntu_sources
+ packages-schema: packages
+ sources-schema: sources
+ update-command: /org/udd.debian.net/mirrors/ubuntu-rsync hardy /org/udd.debian.net/mirrors/ubuntu
+
+
+debian-popcon:
+ type: popcon
+ path: /org/udd.debian.net/tmp/all-popcon-results.txt.gz
+ update-command: wget -O /org/udd.debian.net/tmp/all-popcon-results.txt.gz http://popcon.debian.org/all-popcon-results.txt.gz
+ table: popcon
+ schema: popcon
+ packages-table: packages
+
+ubuntu-popcon:
+ type: popcon
+ path: /org/udd.debian.net/tmp/ubuntu-popcon-results.txt.gz
+ update-command: wget -O /org/udd.debian.net/tmp/ubuntu-popcon-results.txt.gz http://popcon.ubuntu.com/all-popcon-results.txt.gz
+ table: ubuntu_popcon
+ schema: popcon
+ packages-table: ubuntu_packages
+
+testing-migrations:
+ type: testing-migrations
+ path: /org/udd.debian.net/tmp/migrations
+ update-command: wget -O /org/udd.debian.net/tmp/migrations 'http://qa.debian.org/~lucas/testing-status.raw'
+ schema: testing_migrations
+ table: migrations
+
+upload-history:
+ type: upload-history
+ path: /org/udd.debian.net/tmp/upload-history
+ update-command: if [ ! -e /org/udd.debian.net/tmp/upload-history/ ]; then mkdir /org/udd.debian.net/tmp/upload-history/; fi; rm -rf /org/udd.debian.net/tmp/upload-history/*; wget -r --no-parent -nd -A debian-devel-* -P /org/udd.debian.net/tmp/upload-history http://qa.debian.org/~filippo/ddc/
+ schema: upload_history
+ table: upload_history
+
+bugs:
+ type: bugs
+ archived: false
+ update-command: /org/udd.debian.net/mirrors/sync-bugs.debian.org
+ table: bugs
+ schema: bugs
+ archived-table: archived_bugs
+ packages-table: packages
+ usertags-table: bugs_usertags
+ sources-table: sources
+ debug: false
+
+bugs-archive:
+ type: bugs
+ archived: true
+ table: bugs
+ schema: bugs
+ archived-table: archived_bugs
+ packages-table: packages
+ usertags-table: bugs_usertags
+ sources-table: sources
+ update-command: /org/udd.debian.net/mirrors/sync-bugs.debian.org
+
+orphaned_packages:
+ type: orphaned_packages
+ table: orphaned_packages
+ setup: orphaned_packages
+ unarchived-table: bugs
+ schema: orphaned_packages
+ bugs-path: /org/bugs.debian.org
+
+carnivore:
+ type: carnivore
+ update-command: /org/udd.debian.net/mirrors/sync-carnivore
+ path: /org/udd.debian.net/mirrors/qa.debian.org/carnivore/report
+ emails-table: carnivore_emails
+ names-table: carnivore_names
+ keys-table: carnivore_keys
+ login-table: carnivore_login
+ schema: carnivore
+
+lintian:
+ type: lintian
+ update-command: rm -f /org/udd.debian.net/mirrors/lintian.log && wget http://lintian.debian.org/lintian.log -O /org/udd.debian.net/mirrors/lintian.log
+ path: /org/udd.debian.net/mirrors/lintian.log
+ table: lintian
+ schema: lintian
Copied: udd/time-imports.rb (from rev 1209, udd/src/time-imports.rb)
===================================================================
--- udd/time-imports.rb (rev 0)
+++ udd/time-imports.rb 2008-09-07 17:28:09 UTC (rev 1217)
@@ -0,0 +1,17 @@
+#!/usr/bin/ruby -w
+
+sources = [ 'debian-sid', 'debian-etch', 'debian-lenny', 'ubuntu-intrepid', 'ubuntu-hardy', 'debian-popcon', 'ubuntu-popcon', 'testing-migrations', 'upload-history', 'bugs', 'orphaned_packages', 'bugs_archived' ]
+# 'carnivore', 'lintian'
+
+sources.each do |s|
+ ts = Time::now
+ system("/org/udd.debian.net/update-and-dispatch.sh #{s}")
+ te = Time::now
+ puts "#### #{s} first import: #{te-ts}s"
+end
+sources.each do |s|
+ ts = Time::now
+ system("/org/udd.debian.net/update-and-dispatch.sh #{s}")
+ te = Time::now
+ puts "#### #{s} second import: #{te-ts}s"
+end
Copied: udd/ubuntu-rsync (from rev 1209, udd/src/ubuntu-rsync)
===================================================================
--- udd/ubuntu-rsync (rev 0)
+++ udd/ubuntu-rsync 2008-09-07 17:28:09 UTC (rev 1217)
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ $# != 2 ]; then
+ echo "Usage: $0 <dist> <dest>"
+ exit 1
+fi
+
+rsync -rdv --include "Packages.gz" --include "Sources.gz" --include "**/" --exclude "*" "archive.ubuntu.com::ubuntu/dists/$1/" $2/$1
Copied: udd/udd (from rev 1216, udd/src/udd)
Copied: udd/udd.py (from rev 1215, udd/src/udd.py)
===================================================================
--- udd/udd.py (rev 0)
+++ udd/udd.py 2008-09-07 17:28:09 UTC (rev 1217)
@@ -0,0 +1,77 @@
+#!/usr/bin/env python
+# Last-Modified: <Tue Aug 19 13:55:40 2008>
+
+"""Dispatch udd gatherers
+
+This script is used to dispatch the source gatherers of the UDD project."""
+
+import sys
+from os import system
+from time import asctime
+import udd.aux
+import os.path
+
+def print_help():
+ print "Usage: " + sys.argv[0] + " <configuration> <command> <source1> [source2 source3 ...]"
+
+if __name__ == '__main__':
+ if len(sys.argv) < 4:
+ print_help()
+ sys.exit(1)
+
+ command = sys.argv[2]
+ if command not in ('run', 'setup', 'drop', 'tables', 'update', 'schema'):
+ sys.stderr.write("command has to be one of 'run', 'setup', 'drop', 'update', 'schema' and 'tables'\n")
+ sys.exit(1)
+
+ config = udd.aux.load_config(open(sys.argv[1]).read())
+
+ types = config['general']['types']
+
+ connection = udd.aux.open_connection(config)
+
+ schemata = {}
+ # Process the sources
+ for src in sys.argv[3:]:
+ src_config = config[src]
+ type = src_config['type']
+ udd.aux.lock(config, src)
+ try:
+ # If the command is update, we need a special case. Otherwise we can just use the gatherer's methods
+ if command == 'update':
+ if "update-command" in src_config:
+ result = system(src_config['update-command'])
+ if result != 0:
+ sys.exit(result)
+ if 'timestamp-dir' in config['general']:
+ f = open(os.path.join(config['general']['timestamp-dir'], src+".update"), "w")
+ f.write(asctime())
+ f.close()
+ elif command == 'schema':
+ for tag in ('schema', 'packages-schema', 'sources-schema'):
+ if not tag in src_config:
+ continue
+ schema = config['general']['schema-dir'] + '/' + src_config[tag]
+ print (open(schema).read() % src_config)
+ else:
+ (src_command,rest) = types[type].split(None, 1)
+ if src_command == "exec":
+ system(rest + " " + sys.argv[1] + " " + sys.argv[2] + " " + src)
+ elif src_command == "module":
+ exec("import " + rest)
+ exec "gatherer = " + rest + ".get_gatherer(connection, config, src)"
+ if command == 'tables':
+ exec "tables = gatherer.%s()" % command
+ print "\n".join(tables)
+ else:
+ exec "gatherer.%s()" % command
+ if 'timestamp-dir' in config['general']:
+ f = open(os.path.join(config['general']['timestamp-dir'], src+".dispatch"), "w")
+ f.write(asctime())
+ f.close()
+ except:
+ udd.aux.unlock(config, src)
+ raise
+ udd.aux.unlock(config, src)
+ connection.commit()
+
More information about the Collab-qa-commits
mailing list