From: Joerg Jaspert Date: Wed, 6 Aug 2008 23:20:23 +0000 (+0200) Subject: Merge from Joachim X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=a9cd0a9b4d5fc20932b3818bf4e45fbffebc9fc5;hp=79065951288e5dc925b8b83499eff70986f8271f;p=dak.git Merge from Joachim --- diff --git a/ChangeLog b/ChangeLog index 74879a3b..4bb52a3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2008-08-07 Joerg Jaspert + + * dak/process_accepted.py (install): Error out with the new + exception if we dont know the source package for a file we want to + install. Shouldn't ever hit us, but better safe than sorry. + + * daklib/dak_exceptions.py (dakerrors): new exception - no source field. + +2008-08-05 Joerg Jaspert + + * config/debian/cron.unchecked: disable the ssh-move insanity (and + as soon as rietz is back online - replace it with a one-line scp + or rsync statement followed by a one-line rm) + And now replaced this 128 line perl "not-invented-here" with a + one-line rsync command, using a feature rsync only understands + since sarge - damn new-fangled technology. + 2008-08-05 Joachim Breitner * dak/cruft_report.py: In full mode, report out-of-date binaries on diff --git a/config/debian/cron.unchecked b/config/debian/cron.unchecked old mode 100644 new mode 100755 index 0e595736..92f40cc9 --- a/config/debian/cron.unchecked +++ b/config/debian/cron.unchecked @@ -33,7 +33,7 @@ if lockfile -r3 $LOCKFILE; then echo "--" >> $report # sync with debbugs - $scriptsdir/ssh-move --server --ssh-identity /srv/ftp.debian.org/s3kr1t/id_debbugs-vt --ssh-move-path /home/debbugs/ssh-move --from-directory $queuedir/bts_version_track --to-directory /org/bugs.debian.org/versions/queue/ftp-master debbugs@bugs.debian.org \*.debinfo \*.versions + rsync -aq --remove-source-files $queuedir/bts_version_track/ bugs-sync:/org/bugs.debian.org/versions/queue/ftp-master/ if lockfile -r3 $NOTICE; then LOCKDAILY="YES" diff --git a/config/debian/cron.weekly b/config/debian/cron.weekly index 9a4c56f1..4baaf46c 100755 --- a/config/debian/cron.weekly +++ b/config/debian/cron.weekly @@ -50,7 +50,7 @@ apt-ftparchive -q clean apt.conf apt-ftparchive -q clean apt.conf.buildd # Update wanna-build dump -echo "Update wanan-build database dump" +echo "Update wanna-build database dump" /org/ftp.debian.org/scripts/nfu/get-w-b-db echo "Finally, all is done, compressing logfile" diff --git a/dak/process_accepted.py b/dak/process_accepted.py index e99c35b3..94c2ea30 100755 --- a/dak/process_accepted.py +++ b/dak/process_accepted.py @@ -35,6 +35,7 @@ from daklib import database from daklib import logging from daklib import queue from daklib import utils +from daklib.dak_exceptions import * ############################################################################### @@ -354,8 +355,7 @@ def install (): projectB.query("INSERT INTO binaries (package, version, maintainer, source, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, %d, '%s', %d)" % (package, version, maintainer_id, source_id, architecture_id, files[file]["files id"], type, fingerprint_id)) else: - projectB.query("INSERT INTO binaries (package, version, maintainer, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, '%s', %d)" - % (package, version, maintainer_id, architecture_id, files[file]["files id"], type, fingerprint_id)) + raise NoSourceFieldError, "Unable to find a source id for %s (%s), %s, file %s, type %s, signed by %s" % (package, version, architecture, file, type, sig_fpr) for suite in changes["distribution"].keys(): suite_id = database.get_suite_id(suite) projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))" % (suite_id)) diff --git a/daklib/dak_exceptions.py b/daklib/dak_exceptions.py index b52e0657..4e795461 100644 --- a/daklib/dak_exceptions.py +++ b/daklib/dak_exceptions.py @@ -48,7 +48,8 @@ dakerrors = { "FileExistsError": """Exception raised when destination file exists.""", "SendmailFailedError": """Exception raised when Sendmail invocation failed.""", "NoFreeFilenameError": """Exception raised when no alternate filename was found.""", - "TransitionsError": """Exception raised when transitions file can't be parsed.""" + "TransitionsError": """Exception raised when transitions file can't be parsed.""", + "NoSourceFieldError": """Exception raised - we cant find the source - wtf?""" } def construct_dak_exception(name, description): diff --git a/scripts/debian/ssh-move b/scripts/debian/ssh-move deleted file mode 100755 index ab820a7d..00000000 --- a/scripts/debian/ssh-move +++ /dev/null @@ -1,128 +0,0 @@ -#! /usr/bin/perl -w -use strict; - -use IPC::Open2; - -$ENV{LANG} = "C"; - -# The protocol consists of repeated exchanges of the following: -# -# S: -# S: -# S: . -# C: [writes file] -# C: -# S: [unlinks file] - -my $server = 0; -my $verbose = 0; -my $nonint = 0; -my $sshidentity; -my $sshmovepath = 'ssh-move'; -my $fromdir; -my $todir; - -while (@ARGV) { - local $_ = shift @ARGV; - if (/^--server$/) { - $server = 1; - } elsif (/^--verbose$/) { - $verbose = 1; - } elsif (/^--ssh-identity$/) { - $sshidentity = shift @ARGV; - } elsif (/^--ssh-move-path$/) { - $sshmovepath = shift @ARGV; - } elsif (/^--from-directory$/) { - $fromdir = shift @ARGV; - } elsif (/^--to-directory$/) { - $todir = shift @ARGV; - } elsif (/^--non-interactive$/) { - $nonint = 1; - } else { - unshift @ARGV, $_; - last; - } -} - -local $| = 1; - - -my ($in, $out) = (*STDIN, *STDOUT); - -unless ($nonint) { - my $servername = shift @ARGV; - local (*READER, *WRITER); - - my @args = ('ssh'); - push @args, '-i', $sshidentity if defined $sshidentity; - - push @args, $servername, $sshmovepath; - push @args, '--server' unless ($server); - push @args, '--to-directory', $todir if (defined $todir && $server); - push @args, '--from-directory', $fromdir if (defined $fromdir && !$server); - push @args, '--non-interactive'; - push @args, map quotemeta, @ARGV unless ($server); - - my $pid = open2 (\*READER, \*WRITER, @args); - - ($in, $out) = (*READER, *WRITER); -} - -sub server () -{ - chdir $fromdir if defined $fromdir; - - my @files = map glob, @ARGV; - - for my $file (@files) { - print $out "$file\n" or die "can't print to client: $!"; - open FILE, "< $file" or die "can't open $file: $!\n"; - local $_; - while () { - chomp; - $_ = ".$_" if /^\./; - print $out "$_\n" or die "can't print to client: $!"; - } - print $out ".\n" or die "can't print to client: $!"; - - my $confirm = <$in>; - chomp $confirm if defined $confirm; - unlink $file if defined $confirm and $confirm eq $file; - } -} - -sub client () -{ - chdir $todir if defined $todir; - - my $file; - while (defined ($file = <$in>)) { - chomp $file; - print STDERR $file if $verbose; - (my $tmpfile = $file) =~ s[.*/][]; - $tmpfile .= ".$$.tmp"; - # TODO: unlink $tmpfile if things go wrong - open TMP, "> $tmpfile" or die "can't open $tmpfile: $!"; - local $_; - while (<$in>) { - chomp; - if ($_ eq '.') { - close TMP or die "can't close $tmpfile: $!"; - rename $tmpfile, $file - or die "can't rename $tmpfile to $file: $!"; - print $out "$file\n" or die "can't print to server: $!"; - last; - } else { - s/^\.//; - print TMP "$_\n" or die "can't print to $tmpfile: $!"; - } - } - print STDERR " ok\n" if $verbose; - } -} - -if ($server) { - server (); -} else { - client (); -} diff --git a/scripts/nfu/get-w-b-db b/scripts/nfu/get-w-b-db index 48d2c5f8..c34e5e38 100755 --- a/scripts/nfu/get-w-b-db +++ b/scripts/nfu/get-w-b-db @@ -1,5 +1,7 @@ #!/bin/bash +set -e + # list of architectures taken from # http://buildd.debian.org/stats/ @@ -7,7 +9,7 @@ # the WB_DB_DIR enviroment variable if [ -z "$WB_DB_DIR" ] then - WB_DB_DIR=/org/ftp.debian.org/scripts/nfu + WB_DB_DIR=/srv/ftp.debian.org/scripts/nfu fi cd $WB_DB_DIR || { echo "Failed to cd to $WB_DB_DIR" ; exit 1 ;}