--- a/bin/add-missing-orig Mon Sep 19 16:13:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#!/usr/bin/perl
-
-# some packages list the orig.tar.gz in the source package,
-# but not in the changes file; reprepro will complain later if
-# it cant find the file in the pool; we include the .dsc to
-# make sure that the orig.tar.gz is there
-
-use strict;
-use warnings;
-
-my $incoming = "/home/apt/incoming";
-my $repo = "/home/apt/repo";
-my $cc = "/usr/bin/changestool";
-my $cs = "gpg --clearsign";
-
-my @changes = qw(
-cyrus-imapd-2.2_2.2.13-6.ius.stable_i386.changes
-drbdlinks_1.09-1~ius.3_i386.changes
-exigrey_0.1-3_i386.changes
-interchange_5.5.1-1.ius.etch.1_i386.changes
-libnet-pcap-perl_0.12-hs.1_i386.changes
-libnss-ldap_238-1.schlittermann.1_i386.changes
-);
-
-for (@changes) {
-
- my $c = "$incoming/$_";
- my $cmd;
-
- print "Attempting to add missing upstream sources for [$c] .. ";
- $cmd = "$cc $c includeallsources";
- system($cmd) == 0 or warn "[system($cmd)] failed: [$?] [$!]\n";
- print "done\n";
-
- print "Attempting to sign updated changes file [$c] .. ";
- $cmd = "$cs $c";
- system($cmd) == 0 or warn "[system($cmd)] failed: [$?] [$!]\n";
- rename("$c.asc", $c) or warn "rename([$c.asc], [$c]) failed: [$!]\n";
- print "done\n";
-
-}
--- a/bin/fix-all-necessary Mon Sep 19 16:13:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-~/bin/add-missing-orig
-~/bin/sign-unsigned-changes
-~/bin/sign-unsigned-dsc-and-changes
-~/bin/resign-revoked
-~/bin/resign-expired
--- a/bin/fix-sections Mon Sep 19 16:13:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-
-use IO::File;
-use File::Find;
-use File::Basename;
-
-my $build_dir = "/home/apt/build";
-my $invalid_sections = "unknown";
-my $default_section = "misc";
-my $sign_with = 'me@debrep.vbox.hurz.is.schlittermann.de';
-my $sections = {
- '^nagios' => 'net',
- '^exi(acl|grey)$' => 'mail',
- '^ha-sync$' => 'admin',
- '^ca-certificates' => 'misc',
- '^firestart$' => 'admin',
- '^logbuch$' => 'admin',
- '^sitecp$' => 'web',
- '^texmf' => 'tex',
- '^schlittermann-apt-keys$' => 'net',
- '^update-serial$' => 'net'
-};
-
-my @tofix;
--d $build_dir or mkdir $build_dir or die "Can't mkdir [$build_dir]: $!";
-chdir $build_dir or die "Can't chdir [$build_dir]: $!";
-
-#find(\&f, qw(/home/apt/incoming/));
-
-for my $cf (@tofix) {
- print "Attempting to fix Sections for [$cf] .. ";
- $cf =~ /^(.+\/)?(.+)_([^-]+)(-(.+))?_(.+).changes$/;
- my ($p, $v, $r, $a) = ($2, $3, $5, $6);
-
- my $ra = qx/dpkg --print-architecture/;
- chomp $ra;
- unless ($a eq $ra) {
- warn "skipping foreign arch [$a]\n";
- next;
- }
-
- (my $sf = $cf) =~ s/_[0-9a-z]+\.changes$/.dsc/;
- system("dpkg-source -x $sf") == 0 or warn "[dpkg-source -x $sf] failed: $?\n";
- chdir "$p-$v" or warn "Can't chdir [$p-$v]: $!\n";
- if ("$p-$v" =~ /nagios-plugin-ntp-1.0$/) {
- chmod 0755, "configure" or warn "Can't chmod 0755, [$p-$v/configure]: $!\n";
- }
- {
- local $/;
- my $fh = new IO::File "< debian/control" or warn "Can't open [< debian/control]: $!\n";
- my $c = <$fh>;
- close $fh or warn "Can't close [$fh]: $!\n";
- my $s;
- for (keys %{$sections}) {
- if ($p =~ /$_/) {
- $s = $sections->{$_};
- last;
- }
- }
- $s ||= $default_section;
- $c =~ s/(\n)?section:\s+$invalid_sections\n/${1}Section: $s\n/i;
- $fh = new IO::File "> debian/control" or warn "Can't open [> debian/control]: $!\n";
- print $fh $c;
- close $fh or warn "Can't close [$fh]: $!\n";
- }
-
- system("dpkg-buildpackage -k$sign_with -rfakeroot") == 0 or warn "[dpkg-buildpackage -k$sign_with -rfakeroot] failed: $?\n";
- chdir ".." or warn "Can't chdir [..]: $!\n";
- (my $uf = basename($cf)) =~ s/.changes$/.upload/;
- -e $uf and { unlink $uf or warn "Can't unlink [$uf]: $!\n" };
- system("dupload " . basename($cf)) == 0 or warn "[dupload $cf] failed: $?\n";
-
- print "finished\n";
-}
-
-=pod
-sub f {
-
- /\.changes$/ or return;
-
- my $f = $_;
- my $fh = new IO::File "< $f";
- warn "Can't open [< $f]: $!\n" unless defined $fh;
- while (<$fh>) {
- chomp;
- my $s;
- if (/([0-9a-fA-F]{32}) ([0-9]+) ([a-z]+) ([a-z]+) (.+)$/ && ($s = $3) =~ /$invalid_sections/) {
- push @tofix, $File::Find::name;
- close $fh or warn "Can't close [$fh]: $!\n";
- return;
- }
- }
- close $fh or warn "Can't close [$fh]: $!\n";
-}
-=cut
--- a/bin/rebuild-unsigned-dsc Mon Sep 19 16:13:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-#!/usr/bin/perl
-
-# Some source packages come unsigned. This wouldnt be a problem if it wouldnt
-# cause reprepro to spit messages like: 'Data seems not to be signed trying to
-# use directly...' which may be confusing when you think that it is related to
-# a changes file
-# play with -d option of dpkg-buildpackage to either show unmet build deps and
-# fail or to hide and try to ignore them
-use strict;
-
-die 'dont use me, use sign-unsigned-dsc-and-changes instead';
-
-use IO::File;
-use File::Basename;
-use Symbol qw(gensym);
-
-my $build_dir = "/home/apt/build";
-my $sign_with = 'me@debrep.vbox.hurz.is.schlittermann.de';
-my @unsigned = qw(
-
- /home/apt/incoming/nagios-client-check_1.4.5-1_i386.changes
- /home/apt/incoming/freeradius_1.0.0+cvs20040609-0.hs_i386.changes
-
-);
-
-my $vc = "gpg --verify";
-my $cc = "gpg --clearsign";
-
--d $build_dir or mkdir $build_dir or die "Can't mkdir [$build_dir]: $!";
-chdir $build_dir or die "Can't chdir [$build_dir]: $!";
-
-for my $cf (@unsigned) {
-
- (my $sf = $cf) =~ s/_[0-9a-z]+\.changes$/.dsc/;
-
- # we assume that the dsc has been successfully rebuilt when its signature can
- # be verified
- my $r = qx/$vc $sf 2>&1/;
- next unless $?;
-
- print "Attempting to rebuild unsigned [$sf] ... ";
-
- $cf =~ /^(.+\/)?(.+)_([^-]+)(-(.+))?_(.+).changes$/;
- my ($p, $v, $r, $a) = ($2, $3, $5, $6);
-
- my $ra = qx/dpkg --print-architecture/;
- chomp $ra;
- unless ($a eq $ra) {
- warn "skipping foreign arch [$a]\n";
- next;
- }
-
- system("dpkg-source -x $sf") == 0 or warn "[dpkg-source -x $sf] failed: $?\n";
- chdir "$p-$v" or warn "Can't chdir [$p-$v]: $!\n";
-
- apply_patches($sf);
-
- my $cmd = "dpkg-buildpackage -d -k$sign_with -rfakeroot";
- system($cmd) == 0 or warn "[$cmd] failed: $?\n";
- chdir ".." or warn "Can't chdir [..]: $!\n";
- (my $uf = basename($cf)) =~ s/.changes$/.upload/;
- -e $uf and { unlink $uf or warn "Can't unlink [$uf]: $!\n" };
- system("dupload " . basename($cf)) == 0 or warn "[dupload $cf] failed: $?\n";
-
- print "finished\n";
-}
-
-sub apply_patches($) {
-
- my ($f) = @_;
-
- if ($f eq "/home/apt/incoming/freeradius_1.0.0+cvs20040609-0.hs.dsc") {
- my $ch = gensym;
- my $cmd = "|patch -p0";
- open $ch, $cmd or warn "Can't run [$cmd]: $!\n";
- print $ch <<EOP;
---- src/modules/rlm_x99_token/x99_rlm.c.orig 2004-02-26 20:04:37.000000000 +0100
-+++ src/modules/rlm_x99_token/x99_rlm.c 2009-06-15 11:12:48.000000000 +0200
-@@ -516,9 +516,7 @@
- return RLM_MODULE_INVALID;
- }
-
-- /* Fast path if we didn't protect the state. */
-- if (!(user_info.card_id & X99_CF_AM))
-- goto good_state;
-+ if (user_info.card_id & X99_CF_AM) {
-
- /* Verify the state. */
- (void) memset(challenge, 0, sizeof(challenge));
-@@ -544,8 +542,8 @@
- "auth: bad state for [%s]: expired", username);
- return RLM_MODULE_REJECT;
- }
--good_state:
-- /* State is good! */
-+
-+ }
-
- } else {
- /* This should only happen if the authorize code didn't run. */
-EOP
- close $ch or warn "Can't close [$ch]: $!\n";
- }
-
-}
--- a/bin/resign-expired Mon Sep 19 16:13:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use File::Find;
-use File::Temp;
-
-$ENV{LANG} = "POSIX";
-my $vc = qq(gpg --verify);
-my $dc = qq(gpg --batch --yes --decrypt);
-my $cc = qq(gpg --batch --yes --clearsign);
-#my $expired = "Hinweis: Dieser Schlüssel ist verfallen!";
-my $expired = "Note: This key has expired!";
-
-find(\&f, qw(/home/apt/incoming/));
-
-sub f {
-
- /\.changes$/ or return;
- my $f = $_;
- my $r = qx/$vc $f 2>&1/;
- return if $?;
- $r =~ /$expired/ || return;
- print "Attempting to resign [$f] .. ";
- my $t = File::Temp->new()->filename();
- my $cmd = "$dc -o $t $f &>/dev/null";
- open PIPE, "$cmd |" or warn "Can't open [$cmd |]: [$?] [$!]\n";
- $cmd = "$cc -o $f $t";
- open PIPE, "$cmd |" or warn "Can't open [$cmd |]: [$?] [$!]\n";
- print "finished\n";
-
-}
--- a/bin/resign-revoked Mon Sep 19 16:13:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use File::Find;
-use File::Temp;
-
-my $incoming = "/home/apt/incoming";
-
-my @tofix = qw(
-
- send-config_1.0-1_i386.changes
-
-);
-
-my $dc = qq(gpg --batch --yes --decrypt);
-my $cc = qq(gpg --batch --yes --clearsign);
-
-for (@tofix) {
-
- my $f = "$incoming/$_";
-
- print "Attempting to resign [$f] .. ";
- my $t = File::Temp->new()->filename();
- my $cmd = "$dc -o $t $f &>/dev/null";
- open PIPE, "$cmd |" or warn "Can't open [$cmd |]: [$?] [$!]\n";
- $cmd = "$cc -o $f $t";
- open PIPE, "$cmd |" or warn "Can't open [$cmd |]: [$?] [$!]\n";
- print "finished\n";
-
-}
--- a/bin/sign-unsigned-changes Mon Sep 19 16:13:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use File::Find;
-
-my $incoming = "/home/apt/incoming";
-
-my @unsigned = qw(
-
- freeradius_1.0.0+cvs20040609-0.hs.5_i386.changes
-
-);
-
-my $vc = "gpg --verify";
-my $cc = "gpg --clearsign";
-
-for (@unsigned) {
-
- my $f = "$incoming/$_";
-
- # since we use a fixed list of unsigned files we shouldnt sign them twice
- my $r = qx/$vc $f 2>&1/;
- next unless $?;
-
- print "Attempting to sign [$f] .. ";
- system("$cc $f") == 0 or warn "system([$cc] [$f]) failed: [$?] [$!]\n";
- rename("$f.asc", $f) or warn "rename([$f.asc], [$f]) failed: [$!]\n";
- print "finished\n";
-
-}
--- a/bin/sign-unsigned-dsc-and-changes Mon Sep 19 16:13:57 2011 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#!/usr/bin/perl
-
-# Some source packages come unsigned. This wouldnt be a problem if it wouldnt
-# cause reprepro to spit messages like: 'Data seems not to be signed trying to
-# use directly...' which may be confusing when you think that it is related to
-# a changes file
-use strict;
-
-use IO::File;
-use File::Basename;
-use Symbol qw(gensym);
-
-my $arch = 'i386';
-my $incoming = "/home/apt/incoming";
-
-my @unsigned = qw(
-
- nagios-client-check_1.4.5-1.dsc
- freeradius_1.0.0+cvs20040609-0.hs.dsc
- libnss-ldap_238-1.schlittermann.1.dsc
-
-);
-
-my $cv = "/usr/bin/gpg --verify";
-my $cc = "/usr/bin/gpg --clearsign";
-my $cu = "/usr/bin/changestool";
-
-for (@unsigned) {
-
- my $cmd;
-
- my $sf = "$incoming/$_";
- (my $cf = $sf) =~ s/\.dsc$/_${arch}.changes/;
-
- # we assume that the changes have been successfully resigned too when the dsc
- # files can be verified
- my $r = qx/$cv $sf 2>&1/;
- next unless $?;
-
- print "Attempting to sign [$sf] .. ";
- $cmd = "$cc $sf";
- system($cmd) == 0 or warn "[system($cmd)] failed: [$?] [$!]\n";
- rename("$sf.asc", $sf) or warn "rename([$sf.asc], [$sf]) failed: [$!]\n";
- print "finished\n";
-
- print "Attempting to update and sign [$cf] .. ";
- $cmd = "$cu $cf updatechecksums $sf";
- system("$cmd") == 0 or warn "[system($cmd)] failed: [$?] [$!]\n";
- $cmd = "$cc $cf";
- system($cmd) == 0 or warn "[system($cmd)] failed: [$?] [$!]\n";
- rename("$cf.asc", $cf) or warn "rename([$cf.asc], [$cf]) failed: [$!]\n";
- print "finished\n";
-
-}