+++ /dev/null
-#
-# WannaBuild.pm: library for wanna-build and sbuild
-# Copyright (C) 2005 Ryan Murray <rmurray@debian.org>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# $Id$
-#
-
-package WannaBuild;
-
-use strict;
-use POSIX;
-use FileHandle;
-use Time::Local;
-
-require Exporter;
-@WannaBuild::ISA = qw(Exporter);
-@WannaBuild::EXPORT = qw(version_less version_lesseq version_eq
- version_compare binNMU_version parse_date isin);
-
-$WannaBuild::opt_correct_version_cmp = 0;
-
-sub version_less {
- my $v1 = shift;
- my $v2 = shift;
-
- return version_compare( $v1, "<<", $v2 );
-}
-
-sub version_lesseq {
- my $v1 = shift;
- my $v2 = shift;
-
- return version_compare( $v1, "<=", $v2 );
-}
-
-sub version_eq {
- my $v1 = shift;
- my $v2 = shift;
-
- return version_compare( $v1, "=", $v2 );
-}
-
-sub version_compare {
- my $v1 = shift;
- my $rel = shift;
- my $v2 = shift;
-
- if ($WannaBuild::opt_correct_version_cmp) {
- system "dpkg", "--compare-versions", $v1, $rel, $v2;
- return $? == 0;
- }
- else {
- if ($rel eq "=" || $rel eq "==") {
- return $v1 eq $v2;
- }
- elsif ($rel eq "<<") {
- return do_version_cmp( $v1, $v2 );
- }
- elsif ($rel eq "<=" || $rel eq "<") {
- return $v1 eq $v2 || do_version_cmp( $v1, $v2 );
- }
- elsif ($rel eq ">=" || $rel eq ">") {
- return !do_version_cmp( $v1, $v2 );
- }
- elsif ($rel eq ">>") {
- return $v1 ne $v2 && !do_version_cmp( $v1, $v2 );
- }
- else {
- warn "version_compare called with bad relation '$rel'\n";
- return $v1 eq $2;
- }
- }
-}
-
-sub do_version_cmp {
- my($versa, $versb) = @_;
- my($epocha,$upstra,$reva);
- my($epochb,$upstrb,$revb);
- my($r);
-
- ($epocha,$upstra,$reva) = split_version($versa);
- ($epochb,$upstrb,$revb) = split_version($versb);
-
- # compare epochs
- return 1 if $epocha < $epochb;
- return 0 if $epocha > $epochb;
-
- # compare upstream versions
- $r = version_cmp_single( $upstra, $upstrb );
- return $r < 0 if $r != 0;
-
- # compare Debian revisions
- $r = version_cmp_single( $reva, $revb );
- return $r < 0;
-}
-
-sub order {
- for ($_[0])
- {
- /\~/ and return -1;
- /\d/ and return 0;
- /[a-z]/i and return ord;
- return (ord) + 256;
- }
-}
-
-sub version_cmp_single {
- my($versa, $versb) = @_;
- my($a,$b,$lena,$lenb,$va,$vb,$i);
-
- for(;;) {
- # compare non-numeric parts
- $versa =~ /^([^\d]*)(.*)/; $a = $1; $versa = $2;
- $versb =~ /^([^\d]*)(.*)/; $b = $1; $versb = $2;
- $lena = length($a);
- $lenb = length($b);
- for( $i = 0; $i < $lena || $i < $lenb; ++$i ) {
- $va = $i < $lena ? order(substr( $a, $i, 1 )) : 0;
- $vb = $i < $lenb ? order(substr( $b, $i, 1 )) : 0;
- return $va - $vb if $va != $vb;
- }
- # compare numeric parts
- $versa =~ /^(\d*)(.*)/; $a = $1; $a ||= 0; $versa = $2;
- $versb =~ /^(\d*)(.*)/; $b = $1; $b ||= 0; $versb = $2;
- return $a - $b if $a != $b;
- return 0 if !$versa && !$versb;
- if (!$versa) {
- return +1 if order(substr( $versb, 0, 1 ) ) < 0;
- return -1;
- }
- if (!$versb) {
- return -1 if order(substr( $versa, 0, 1 ) ) < 0;
- return +1;
- }
- }
-}
-
-sub split_version {
- my($vers) = @_;
- my($epoch,$revision) = (0,"");
-
- if ($vers =~ /^(\d+):(.*)/) {
- $epoch = $1;
- $vers = $2;
- }
-
- if ($vers =~ /(.*)-([^-]+)$/) {
- $revision = $2;
- $vers = $1;
- }
-
- return( $epoch, $vers, $revision );
-}
-
-sub binNMU_version {
- my $v = shift;
- my $binNMUver = shift;
-
- return "$v+b$binNMUver";
-}
-
-
-my %monname = ('jan', 0, 'feb', 1, 'mar', 2, 'apr', 3, 'may', 4, 'jun', 5,
- 'jul', 6, 'aug', 7, 'sep', 8, 'oct', 9, 'nov', 10, 'dec', 11 );
-
-sub parse_date {
- my $text = shift;
-
- return 0 if !$text;
-
- if ($text =~ /^(\d{4}) (\w{3}) (\d+) (\d{2}):(\d{2}):(\d{2})$/) {
- my ($year, $mon, $day, $hour, $min, $sec) = ($1, $2, $3, $4, $5, $6);
- $mon =~ y/A-Z/a-z/;
- die "Invalid month name $mon" if !exists $monname{$mon};
- $mon = $monname{$mon};
- return timegm($sec, $min, $hour, $day, $mon, $year);
- } elsif ($text =~ /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.\d+)?$/) {
- my ($year, $mon, $day, $hour, $min, $sec) = ($1, $2-1, $3, $4, $5, $6);
- return timegm($sec, $min, $hour, $day, $mon, $year);
- } else {
- die "Cannot parse date: $text\n";
- }
-}
-
-sub isin {
- my $val = shift;
-
- return 0 if !$val;
-
- return grep( $_ eq $val, @_ );
-}
-
-1;
+++ /dev/null
-#!/usr/bin/perl
-
-use File::Basename;
-$progname = basename($0);
-
-use DB_File;
-use GDBM_File;
-
-die "Filename missing\n" if !@ARGV;
-die "$ARGV[0]: $!\n" if !-f $ARGV[0];
-
-if ($progname =~ /catdb/) {
- tie %db, 'DB_File', $ARGV[0], O_RDONLY, 0664, $DB_HASH;
-}
-elsif ($progname =~ /catgdbm/) {
- tie %db, 'GDBM_File', $ARGV[0], GDBM_READER, 0644;
-}
-else {
- die "Called for unknown db type\n";
-}
-shift;
-
-if (@ARGV > 0) {
- foreach $key (@ARGV) {
- print "-"x78, "\n";
- if (exists $db{$key}) {
- print "$key:\n$db{$key}\n";
- }
- else {
- print "*UNDEFINED*\n";
- }
- }
-}
-else {
- while( ($key,$val) = each %db ) {
- print "-"x78, "\n";
- print "$key:\n$val\n";
- }
-}
-
-untie %db;
-exit 0;
+++ /dev/null
-wanna-build
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+. /org/wanna-build/triggers/common
+
+STATS_DISTS="sid wheezy squeeze lenny"
+ALL_ARCHES=$(echo $ARCHS_lenny $ARCHS_squeeze $ARCHS_wheezy $ARCHS_unstable \
+ | tr ' ' '\n' | sort -u)
+
+#
+# Only update stats if it's been at least 20h since the last time.
+#
+interval=72000
+last=`stat --format="%Y" /srv/wanna-build/etc/graph-data`
+now=`date +%s`
+if (( $last + $interval < $now )); then
+ echo "stats start: `date`"
+ /srv/wanna-build/bin/wb-graph >> /srv/wanna-build/etc/graph-data
+ /srv/wanna-build/bin/wb-graph -p >> /srv/wanna-build/etc/graph2-data
+ /srv/buildd.debian.org/bin/makegraph
+ for a in $ALL_ARCHES; do
+ echo Last Updated: `date -u` > /srv/buildd.debian.org/web/stats/$a.txt
+ for d in $STATS_DISTS; do
+ /srv/wanna-build/bin/wanna-build-statistics --database=$a/build-db --dist=$d >> /srv/buildd.debian.org/web/stats/$a.txt
+ done
+ done
+ echo "stats ended: `date`"
+fi
+
+++ /dev/null
-wanna-build
\ No newline at end of file
--- /dev/null
+#! /usr/bin/python
+
+
+import sys, os.path, gzip, subprocess
+#from debian_bundle import deb822
+import apt_pkg
+
+
+def check_source(ok, srcs, fw):
+ ret=[]
+ for f in srcs:
+ #f = open(f, 'r')
+ f = subprocess.Popen("zcat %s" % (f), shell=True, stdout=subprocess.PIPE).stdout
+ pkg = apt_pkg.ParseTagFile(f)
+ while pkg.Step():
+ if not pkg.Section.get('Package'): continue
+ if pkg.Section.get('Section','').startswith('non-free'):
+ if pkg.Section.get('Autobuild') != 'yes': continue
+ if pkg.Section['Package'] not in ok: continue
+ ret += [pkg.Section['Package']]
+ fw.write(str(pkg.Section))
+ fw.write("\n")
+ f.close()
+ fw.close()
+ return ret
+
+def check_binary(ok, bins, fw):
+ for f in bins:
+ f = subprocess.Popen("zcat %s" % (f), shell=True, stdout=subprocess.PIPE).stdout
+ pkg = apt_pkg.ParseTagFile(f)
+ while pkg.Step():
+ if pkg.Section.get('Source', pkg.Section.get('Package')).split(" ")[0] not in ok: continue
+ fw.write(str(pkg.Section))
+ fw.write("\n")
+ f.close()
+ fw.close()
+
+def outfile(name, file):
+ #return open(dir + "/" + os.path.basename(file), "w")
+ #return open(file + name, "w")
+ if file.endswith(name): return open(file[:-len(name)], "w")
+
+def replarch(arch, pkgs):
+ return [ x.replace('%ARCH%', arch) for x in pkgs ]
+
+def main():
+ # call me:
+ # /org/wanna-build/etc/non-free-include-list "arch1 arch2" write-sources write-packages Sources* . Packages*
+ if len(sys.argv) <= 4:
+ print "Error - too few args"
+ return
+
+ oklist = [ x[:-1].split(' ')[0] for x in open(sys.argv[1]) ]
+ #outsrcs = open(sys.argv[3], "w")
+ #outpkgs = open(sys
+ rem = sys.argv[5:]
+ if '.' not in rem:
+ print "need both Sources and Packages"
+ return
+ src = rem[:rem.index('.')]
+ bin = rem[rem.index('.')+1:]
+ if not src or not bin:
+ print "need non-empty Sources and Packages"
+ return
+ okpkgs = check_source(oklist, src, open(sys.argv[3], "w"))
+ print okpkgs
+ for arch in sys.argv[2].split(" "):
+ check_binary(okpkgs, replarch(arch, bin), open(replarch(arch, [sys.argv[4]])[0], "w"))
+
+if __name__ == '__main__':
+ main()
+++ /dev/null
-wanna-build
\ No newline at end of file
+++ /dev/null
-wanna-build
\ No newline at end of file
my $arch = shift @ARGV;
-local($/) = ""; # read in paragraph mode
-while (<>) {
- my( $version, $name, $architecture );
- $architecture="none"; # better to keep an entry too much than to delete an entry
- /^Package:\s*(\S+)$/mi and $name = $1;
- /^Version:\s*(\S+)$/mi and $version = $1;
- /^Architecture:\s*(\S+)$/mi and $architecture = $1;
- if (!defined $name or !defined $version) {
- warn "Stanza without Package or Version\n";
+#Read in all data files:
+for my $file (@ARGV) {
+ if (! -f $file) {
next;
}
- if ($arch ne "source" && defined $architecture && $architecture ne "all" && $architecture ne $arch) {
- next;
+ my $fh;
+ if ($file =~ /.gz$/) {
+ open($fh, '-|', 'gzip', '-d', '-c', $file)
+ or die("Can't open pipe from gzip: $!");
+ } else {
+ open($fh, '<', $file)
+ or die("Can't open $file: $!");
}
- my $key = $name;
- if ((!exists $version{$key}) or version_less($version{$key},$version)) {
- $version{$key} = $version;
- $data{$key} = $_;
+ local($/) = ""; # read in paragraph mode
+ while (<$fh>) {
+ my( $version, $name, $architecture );
+ $architecture="none"; # better to keep an entry too much than to delete an entry
+ /^Package:\s*(\S+)$/mi and $name = $1;
+ /^Version:\s*(\S+)$/mi and $version = $1;
+ /^Architecture:\s*(\S+)$/mi and $architecture = $1;
+ if (!defined $name or !defined $version) {
+ warn "Stanza without Package or Version\n";
+ next;
+ }
+ if ($arch ne "source" && defined $architecture && $architecture ne "all" && $architecture ne $arch) {
+ next;
+ }
+ my $key = $name;
+
+ if ((!exists $version{$key}) or version_less($version{$key},$version)) {
+ $version{$key} = $version;
+ $data{$key} = $_;
+ }
}
+
+ close($fh);
}
+
+#Now output the shortened list:
foreach (values %data) {
- chomp; $_ .= "\n\n";
+ chomp; chomp; $_ .= "\n\n";
print;
}
+++ /dev/null
-wanna-build
\ No newline at end of file
+++ /dev/null
-wanna-build
\ No newline at end of file
+++ /dev/null
-wanna-build
\ No newline at end of file
+++ /dev/null
-wanna-build
\ No newline at end of file
+++ /dev/null
-wanna-build
\ No newline at end of file
+++ /dev/null
-wanna-build
\ No newline at end of file
+++ /dev/null
-wanna-build
\ No newline at end of file
+++ /dev/null
-wanna-build
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+PREFIX=$1
+
+sudo -u postgres /usr/bin/pg_dumpall --cluster 8.4/wanna-build | gzip > /org/wanna-build/dumps/dump_${PREFIX}_$(date +%Y.%m.%d-%H:%M:%S).gz
+
+# Expire dumps only on post-trigger saves.
+if [ "$PREFIX" = "post" ]
+then
+ (cd /org/wanna-build/dumps && /org/wanna-build/expire_dumps -d . -f "dump_*")
+fi
+
USER=cimarosa
BUILDD_QUEUE_OPTIONS="--include=Packages.gz --include=Sources.gz --include=**Release* --exclude=* $RSYNC_OPTIONS"
rsync --password-file "$PASSWORD_FILE" $MIRROR_OPTIONS $USER@ftp-master.debian.org::debian/dists/ "$TARGET/archive"
- rsync --password-file "$PASSWORD_BASE/$1-buildd.rsync-password" $BUILDD_QUEUE_OPTIONS $USER@ftp-master.debian.org::buildd-unstable/ "$TARGET/buildd-unstable"
+ rsync --password-file "$PASSWORD_BASE/$1-buildd.rsync-password" $BUILDD_QUEUE_OPTIONS $USER@ftp-master.debian.org::buildd-sid/ "$TARGET/buildd-sid"
rsync --password-file "$PASSWORD_BASE/$1-buildd.rsync-password" $BUILDD_QUEUE_OPTIONS $USER@ftp-master.debian.org::buildd-experimental/ "$TARGET/buildd-experimental"
# Also sync the Maintainers and Uploaders files for consumption through the web interface.
rsync --password-file "$PASSWORD_FILE" $MIRROR_OPTIONS $USER@ftp-master.debian.org::debian/indices/Maintainers /srv/buildd.debian.org/etc/Maintainers
USER=cimarosa
BUILDD_QUEUE_OPTIONS="--include=Packages.gz --include=Sources.gz --include=**Release* --exclude=* $RSYNC_OPTIONS"
rsync $MIRROR_OPTIONS $USER@security-master.debian.org::debian-security/dists/ "$TARGET/archive"
+ rsync --password-file "$PASSWORD_BASE/$1-buildd.rsync-password" $BUILDD_QUEUE_OPTIONS $USER@security-master.debian.org::buildd-wheezy/ "$TARGET/buildd-wheezy"
rsync --password-file "$PASSWORD_BASE/$1-buildd.rsync-password" $BUILDD_QUEUE_OPTIONS $USER@security-master.debian.org::buildd-squeeze/ "$TARGET/buildd-squeeze"
rsync --password-file "$PASSWORD_BASE/$1-buildd.rsync-password" $BUILDD_QUEUE_OPTIONS $USER@security-master.debian.org::buildd-lenny/ "$TARGET/buildd-lenny"
- rsync --password-file "$PASSWORD_BASE/$1-buildd.rsync-password" $BUILDD_QUEUE_OPTIONS $USER@security-master.debian.org::buildd-etch/ "$TARGET/buildd-etch"
- [ -h "$TARGET/buildd-testing" ] || ln -sf buildd-squeeze "$TARGET/buildd-testing"
- [ -h "$TARGET/buildd-stable" ] || ln -sf buildd-lenny "$TARGET/buildd-stable"
- [ -h "$TARGET/buildd-oldstable" ] || ln -sf buildd-etch "$TARGET/buildd-oldstable"
;;
debian-volatile)
rsync $MIRROR_OPTIONS volatile-master.debian.org::debian-volatile/dists/ "$TARGET/archive"
+++ /dev/null
-wanna-build
\ No newline at end of file
die "transactlog is empty\n" if ! $transactlog;
die "mailprog binary $conf::mailprog does not exist or isn't executable\n"
if !-x $conf::mailprog;
-die "no distributions defined\n" if ! %distributions;
package main;
use strict;
use FileHandle;
use File::Copy;
use DBI;
-use lib '/org/wanna-build/bin';
use lib '/org/wanna-build/lib';
#use lib 'lib';
use WannaBuild;
$category, %catval, %short_category,
$short_date, $list_min_age, $dbbase, @curr_time,
$build_priority, %new_vers, $binNMUver, %merge_srcvers, %merge_binsrc,
- $printformat, $ownprintformat, $privmode, $extra_depends, $extra_conflicts
+ $printformat, $ownprintformat, $privmode, $extra_depends, $extra_conflicts,
+ %distributions, %distribution_aliases
);
our $Pas = '/org/buildd.debian.org/etc/packages-arch-specific/Packages-arch-specific';
our $simulate = 0;
export => { arg => \$export_to, mode => "export" },
import => { arg => \$import_from, mode => "import" },
"manual-edit" => { mode => "manual-edit" },
+ "distribution-architectures" => { mode => "distribution-architectures" },
+ "distribution-aliases" => { mode => "distribution-aliases" },
);
while( @ARGV && $ARGV[0] =~ /^-/ ) {
}
}
+my $dbh;
+
+END {
+ if (defined $dbh)
+ {
+ $dbh->disconnect or warn $dbh->errstr;
+ }
+}
+
+my $schema_suffix = '';
+$recorduser //= (not -t and $user =~ /^buildd_/);
+if (isin( $op_mode, qw(list info)) && $distribution !~ /security/ && !$recorduser && !($privmode eq 'yes')) {
+ $dbh = DBI->connect("DBI:Pg:service=wanna-build") ||
+ die "FATAL: Cannot open database: $DBI::errstr\n";
+ $schema_suffix = '_public';
+}
+else
+{
+ $dbh = DBI->connect("DBI:Pg:service=wanna-build-privileged") ||
+ die "FATAL: Cannot open database: $DBI::errstr\n";
+}
+
+# TODO: This shouldn't be needed, file a bug.
+$dbh->{pg_server_prepare} = 0;
+
+$dbh->begin_work or die $dbh->errstr;
+
+my $q = 'SELECT distribution, public, auto_dep_wait FROM distributions';
+my $rows = $dbh->selectall_hashref($q, 'distribution');
+foreach my $name (keys %$rows) {
+ $distributions{$name} = {};
+ $distributions{$name}->{'noadw'} = 1 if !($rows->{$name}->{'auto_dep_wait'});
+ $distributions{$name}->{'hidden'} = 1 if !($rows->{$name}->{'public'});
+}
+
+$q = 'SELECT alias, distribution FROM distribution_aliases';
+$rows = $dbh->selectall_hashref($q, 'alias');
+foreach my $name (keys %$rows) {
+ $distribution_aliases{$name} = $rows->{$name}->{'distribution'};
+}
+$distribution = $distribution_aliases{$distribution} if (isin($distribution, keys %distribution_aliases));
+
$op_mode = $category ? "set-failed" : "set-building"
if !$op_mode; # default operation
-$distribution ||= "unstable";
+$distribution ||= "sid";
if ($distribution eq 'any-priv') {
$privmode = 'yes';
$distribution = 'any';
my @dists = split(/[, ]+/, $distribution);
foreach my $dist (@dists) {
die "Bad distribution '$distribution'\n"
- if !isin($dist, keys %conf::distributions);
+ if !isin($dist, keys %distributions);
}
}
if (!isin ( $op_mode, qw(list) ) && ( !$distribution || $distribution =~ /[ ,]/)) {
if (!@ARGV && !isin( $op_mode, qw(list merge-quinn merge-partial-quinn import export
merge-packages manual-edit
- merge-sources))) {
+ merge-sources distribution-architectures
+ distribution-aliases))) {
warn "No packages given.\n";
usage();
}
$api //= $yamlmap->{"api"};
$api //= 0;
-my $dbh;
-
-END {
- if (defined $dbh)
- {
- $dbh->disconnect or warn $dbh->errstr;
- }
-}
-
-my $schema_suffix = '';
-$recorduser //= (not -t and $user =~ /^buildd_/);
-if (isin( $op_mode, qw(list info)) && $distribution !~ /security/ && !$recorduser && !($privmode eq 'yes')) {
- $dbh = DBI->connect("DBI:Pg:service=wanna-build") ||
- die "FATAL: Cannot open database: $DBI::errstr\n";
- $schema_suffix = '_public';
-}
-else
-{
- $dbh = DBI->connect("DBI:Pg:service=wanna-build-privileged") ||
- die "FATAL: Cannot open database: $DBI::errstr\n";
-}
-
-# TODO: This shouldn't be needed, file a bug.
-$dbh->{pg_server_prepare} = 0;
-
-$dbh->begin_work or die $dbh->errstr;
-
process();
$dbh->commit;
export_db( $export_to );
last SWITCH;
};
+ /^distribution-architectures/ && do {
+ show_distribution_architectures();
+ last SWITCH;
+ };
+ /^distribution-aliases/ && do {
+ show_distribution_aliases();
+ last SWITCH;
+ };
die "Unexpected operation mode $op_mode\n";
}
}
elsif ( !pkg_version_eq($pkg, $version) ) {
print "$name: version mismatch ".
- "($pkg->{'version'} ".
+ "$(pkg->{'version'} ".
"by $pkg->{'builder'})\n";
return;
}
}
elsif ( !pkg_version_eq($pkg, $version) ) {
print "$name: version mismatch ".
- "($pkg->{'version'} ".
+ "$(pkg->{'version'} ".
"by $pkg->{'builder'})\n";
return;
}
}
elsif ( !pkg_version_eq($pkg, $version) ) {
print "$name: version mismatch ".
- "($pkg->{'version'} ".
+ "$(pkg->{'version'} ".
"by $pkg->{'builder'})\n";
return;
}
$pkg->{'notes'} = 'out-of-date';
$pkg->{'buildpri'} = $pkg->{'permbuildpri'}
if (defined $pkg->{'permbuildpri'});
+ if (defined $distributions{$distribution}{noadw}) {
+ change_state( \$pkg, 'Installed' );
+ } else {
+ change_state( \$pkg, 'BD-Uninstallable' );
+ }
}
log_ta( $pkg, "--binNMU" );
update_source_info($pkg);
return;
}
- if ($distribution eq "unstable") {
+ if (!defined $distributions{$distribution}{noadw}) {
change_state( \$pkg, 'BD-Uninstallable' );
$pkg->{'bd_problem'} = "Installability of build dependencies not tested yet";
}
my( $name, $pkg, $key, $dist );
my @firstkeys = qw(package version builder state section priority
installed_version previous_state state_change);
- my @dists = $info_all_dists ? keys %conf::distributions : ($distribution);
+ my @dists = $info_all_dists ? keys %distributions : ($distribution);
my %beautykeys = ( 'package' => 'Package', 'version' => 'Version', 'builder' => 'Builder',
'state' => 'State', 'section' => 'Section', 'priority' => 'Priority',
'installed_version' => 'Installed-Version', 'previous_state' => 'Previous-State',
my $srcs = $args->{'srcs'};
my $key;
- return if defined ($conf::distributions{$distribution}{noadw}) && not defined $args->{'depwait'};
+ return if defined ($distributions{$distribution}{noadw}) && not defined $args->{'depwait'};
# We need to check all of needs-build, as any new upload could make
# something in needs-build have uninstallable deps
my $db = get_all_source_info();
foreach $key (keys %$db) {
my $pkg = $db->{$key};
- if (defined $pkg and isin($pkg->{'state'}, qw/Needs-Build BD-Uninstallable/) and not defined ($conf::distributions{$distribution}{noadw})) {
+ if (defined $pkg and isin($pkg->{'state'}, qw/Needs-Build BD-Uninstallable/) and not defined ($distributions{$distribution}{noadw})) {
$interesting_packages{$key} = undef;
}
if (defined $pkg and isin($pkg->{'state'}, qw/Dep-Wait/) and defined $args->{'depwait'}) {
$interesting_packages_depwait{$key} = undef;
# we always check for BD-Uninstallability in depwait - could be that depwait is satisfied but package is uninstallable
- $interesting_packages{$key} = undef unless defined ($conf::distributions{$distribution}{noadw});
+ $interesting_packages{$key} = undef unless defined ($distributions{$distribution}{noadw});
}
}
return $db;
}
+sub show_distribution_architectures {
+ my $q = 'SELECT distribution, spacecat_all(architecture) AS architectures '.
+ 'FROM distribution_architectures '.
+ 'GROUP BY distribution';
+ my $rows = $dbh->selectall_hashref($q, 'distribution');
+ foreach my $name (keys %$rows) {
+ print $name.': '.$rows->{$name}->{'architectures'}."\n";
+ }
+}
+
+sub show_distribution_aliases {
+ foreach my $alias (keys %distribution_aliases) {
+ print $alias.': '.$distribution_aliases{$alias}."\n";
+ }
+}
+
sub update_source_info {
my $pkg = shift;
$pkg->{'extra_depends'} = $extra_depends if defined $extra_depends;
use vars qw($verbose $dist $database);
$verbose = 0;
-$dist = "unstable";
+$dist = "sid";
$database = "build-db";
while( @ARGV && $ARGV[0] =~ /^-/ ) {
else {
$dist = shift @ARGV;
}
- $dist = "oldstable" if $dist eq "o";
- $dist = "stable" if $dist eq "s";
- $dist = "testing" if $dist eq "t";
- $dist = "unstable" if $dist eq "u";
- die "Bad distribution\n" if !isin($dist, qw(stable testing unstable stable-security testing-security oldstable oldstable-security));
}
elsif (/^--$/) {
last;
+++ /dev/null
-#!/usr/bin/perl -w
-
-# Copyright (C) 2008 Ralf Treinen <treinen@debian.org>
-# This program is free software: you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free Software
-# Foundation, version 2 of the License.
-
-$debug=0;
-
-# the prefix used to encode source packages
-$sourceprefix="source---";
-
-$architecture="";
-$binexplain=0;
-$edosoptions = "-failures -explain -quiet";
-while ( $arg = shift @ARGV ) {
- if ( $arg eq '-a' || $arg eq '--architecture' ) {
- if ($#ARGV == -1) {
- die "-a option needs a value";
- } else {
- $architecture = shift @ARGV;
- }
- } elsif ( $arg =~ "--binexplain" || $arg =~ "-be" ) {
- $binexplain = 1;
- } elsif ( $arg =~ /^-.*/ ) {
- die "unrecognized option: $arg";
- } else {
- last;
- }
-}
-
-if ($#ARGV != 0) {
- die "Usage: edos-debbuildcheck [options] Packages Sources"
-} else {
- $packagefile = $arg;
- $sourcesfile = shift(@ARGV);
-}
-
-if ($debug) {
- print "Arch: $architecture\n";
- print "Packages: $packagefile\n";
- print "Sources: $sourcesfile\n";
- print "Edos options: $edosoptions\n";
-}
-
-# check that all stanzas in the binary package file have the same
-# architecture.
-$packagearch="";
-open(P,$packagefile);
-while (<P>) {
- next unless /^Architecture/;
- next if /^Architecture:\s*all/;
- /Architecture:\s*([^\s]*)/;
- if ($packagearch eq "") {
- $packagearch = $1;
- } elsif ( $packagearch ne $1) {
- die "Package file contains different architectures: $packagearch, $1";
- }
-}
-close P;
-
-if ( $architecture eq "" ) {
- if ( $packagearch eq "" ) {
- die "No architecture option given, " .
- "and no non-all architecture found in the Packages file";
- } else {
- $architecture = $packagearch;
- }
-} else {
- if ( $packagearch ne "" & $architecture ne $packagearch) {
- die "Architecture option is $architecture ".
- "but the package file contains architecture $packagearch";
- }
-}
-
-open(RESULT,"cat $sourcesfile".
- "| edos-debcheck $edosoptions '-base FILE' $packagefile |");
-
-$sourcestanza=0;
-$explanation="";
-$binpackage="";
-
-while (<RESULT>) {
- if (/^\s+/) {
- if ($sourcestanza) {
- s/^(\s*)$sourceprefix(.*)depends on/$1$2build-depends on/o;
- s/^(\s*)$sourceprefix(.*) and (.*) conflict/$1$2 build-conflicts with $3/o;
- print;
- if (/depends on ([^\s]*) .*\{.*\}/) {
- push(@binqueue,$1);
- }
- } else {
- $explanation .= $_;
- }
- } else {
- if ($sourcestanza) {
- print "\n";
- $sourcestanza=0;
- }
- if ($binpackage ne ""){
- $binfailures{$binpackage} = $explanation;
- $binpackage="";
- }
- if (/^$sourceprefix(.*) \(.*\): FAILED/o) {
- print "Package: $1\n";
- print "Failed-Why:\n";
- $sourcestanza=1;
- } elsif (/^([^\s]*) .*: FAILED/) {
- $binpackage=$1;
- $explanation=$_;
- $explanation.=<RESULT>;
- $sourcestanza=0;
- } else {
- # we have someting strange here
- $sourcestanza=0;
- }
- }
-}
-
-close RESULT;
-
-if ($binexplain) {
- while (@binqueue) {
- $p=pop(@binqueue);
- $v=$binfailures{$p};
- next unless defined $v;
- $binfailures{$p}="";
- print "$v" if $v ne "";
- if ($v=~/depends on ([^\s]*) .*\{.*\}/) {
- push(@binqueue,$1);
- }
- }
-}
-
use vars qw($dist);
my $previously_built;
-$dist = "unstable";
+$dist = "sid";
while( @ARGV && $ARGV[0] =~ /^-/ ) {
$_ = shift @ARGV;
else {
$dist = shift @ARGV;
}
- $dist = "oldstable" if $dist eq "o";
- $dist = "stable" if $dist eq "s";
- $dist = "tesing" if $dist eq "t";
- $dist = "unstable" if $dist eq "u";
- die "Bad distribution\n" if !isin($dist, qw(oldstable stable testing unstable));
}
elsif (/^--$/) {
last;
my($lastmsg, %n_state, $total, %n_builder, $pu_total);
$pu_total = 0;
$n_state{"Installed"} = 0;
-open( PIPE, "wanna-build --database=$arch/build-db --dist=$dist --list=all 2>&1 |" )
+open( PIPE, "wanna-build --database=$arch/build-db --dist=$dist --list=all |" )
or die "Cannot spawn wanna-build: $!\n";
while( <PIPE> ) {
if (/^Database for $dist doesn't exist$/) {
+++ /dev/null
-#!/usr/bin/perl -w
-
-use strict;
-
-my $arch = "i386";
-my $suite = "unstable";
-my %dep;
-
-my $in_bd = 0;
-
-open F, "/org/wanna-build/tmp/Sources.$suite-old";
-while (<F>) {
- if (s/^Build-Depends:// or (/^\s/ and $in_bd)) {
- foreach my $pkg (split/,|\|/) {
- $pkg =~ s/\(.+\)//;
- $pkg =~ s/\[.+\]//;
- $pkg =~ s/^\s*(\S+)\s*/$1/;
- $dep{$pkg} = 1 if $pkg ne "\n";
- }
- $in_bd = 1;
- } else {
- $in_bd = 0;
- }
-}
-close F;
-
-open F, "/org/wanna-build/tmp/Packages.$suite.$arch-old";
-while (<F>) {
- if (s/^Package:
- if (s/^Depends:// or (/^\s/ and $in_bd)) {
- foreach my $pkg (split/,|\|/) {
- $pkg =~ s/\(.+\)//;
- $pkg =~ s/\[.+\]//;
- $pkg =~ s/^\s*(\S+)\s*/$1/;
- $dep{$pkg} = 1 if $pkg ne "\n";
- }
- $in_bd = 1;
- } else {
- $in_bd = 0;
- }
-}
-
-
-print join ("\n",sort keys %dep);
+++ /dev/null
-.alias
-.bash_history
-.bash_logout
-.bash_profile
-.bashrc
-.cshrc
-.lesshst
-.viminfo
-.zshrc
-attic
--- /dev/null
+#
+# WannaBuild.pm: library for wanna-build and sbuild
+# Copyright (C) 2005 Ryan Murray <rmurray@debian.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# $Id$
+#
+
+package WannaBuild;
+
+use strict;
+use POSIX;
+use FileHandle;
+use Time::Local;
+
+require Exporter;
+@WannaBuild::ISA = qw(Exporter);
+@WannaBuild::EXPORT = qw(version_less version_lesseq version_eq
+ version_compare binNMU_version parse_date isin);
+
+$WannaBuild::opt_correct_version_cmp = 0;
+
+sub version_less {
+ my $v1 = shift;
+ my $v2 = shift;
+
+ return version_compare( $v1, "<<", $v2 );
+}
+
+sub version_lesseq {
+ my $v1 = shift;
+ my $v2 = shift;
+
+ return version_compare( $v1, "<=", $v2 );
+}
+
+sub version_eq {
+ my $v1 = shift;
+ my $v2 = shift;
+
+ return version_compare( $v1, "=", $v2 );
+}
+
+sub version_compare {
+ my $v1 = shift;
+ my $rel = shift;
+ my $v2 = shift;
+
+ if ($WannaBuild::opt_correct_version_cmp) {
+ system "dpkg", "--compare-versions", $v1, $rel, $v2;
+ return $? == 0;
+ }
+ else {
+ if ($rel eq "=" || $rel eq "==") {
+ return $v1 eq $v2;
+ }
+ elsif ($rel eq "<<") {
+ return do_version_cmp( $v1, $v2 );
+ }
+ elsif ($rel eq "<=" || $rel eq "<") {
+ return $v1 eq $v2 || do_version_cmp( $v1, $v2 );
+ }
+ elsif ($rel eq ">=" || $rel eq ">") {
+ return !do_version_cmp( $v1, $v2 );
+ }
+ elsif ($rel eq ">>") {
+ return $v1 ne $v2 && !do_version_cmp( $v1, $v2 );
+ }
+ else {
+ warn "version_compare called with bad relation '$rel'\n";
+ return $v1 eq $2;
+ }
+ }
+}
+
+sub do_version_cmp {
+ my($versa, $versb) = @_;
+ my($epocha,$upstra,$reva);
+ my($epochb,$upstrb,$revb);
+ my($r);
+
+ ($epocha,$upstra,$reva) = split_version($versa);
+ ($epochb,$upstrb,$revb) = split_version($versb);
+
+ # compare epochs
+ return 1 if $epocha < $epochb;
+ return 0 if $epocha > $epochb;
+
+ # compare upstream versions
+ $r = version_cmp_single( $upstra, $upstrb );
+ return $r < 0 if $r != 0;
+
+ # compare Debian revisions
+ $r = version_cmp_single( $reva, $revb );
+ return $r < 0;
+}
+
+sub order {
+ for ($_[0])
+ {
+ /\~/ and return -1;
+ /\d/ and return 0;
+ /[a-z]/i and return ord;
+ return (ord) + 256;
+ }
+}
+
+sub version_cmp_single {
+ my($versa, $versb) = @_;
+ my($a,$b,$lena,$lenb,$va,$vb,$i);
+
+ for(;;) {
+ # compare non-numeric parts
+ $versa =~ /^([^\d]*)(.*)/; $a = $1; $versa = $2;
+ $versb =~ /^([^\d]*)(.*)/; $b = $1; $versb = $2;
+ $lena = length($a);
+ $lenb = length($b);
+ for( $i = 0; $i < $lena || $i < $lenb; ++$i ) {
+ $va = $i < $lena ? order(substr( $a, $i, 1 )) : 0;
+ $vb = $i < $lenb ? order(substr( $b, $i, 1 )) : 0;
+ return $va - $vb if $va != $vb;
+ }
+ # compare numeric parts
+ $versa =~ /^(\d*)(.*)/; $a = $1; $a ||= 0; $versa = $2;
+ $versb =~ /^(\d*)(.*)/; $b = $1; $b ||= 0; $versb = $2;
+ return $a - $b if $a != $b;
+ return 0 if !$versa && !$versb;
+ if (!$versa) {
+ return +1 if order(substr( $versb, 0, 1 ) ) < 0;
+ return -1;
+ }
+ if (!$versb) {
+ return -1 if order(substr( $versa, 0, 1 ) ) < 0;
+ return +1;
+ }
+ }
+}
+
+sub split_version {
+ my($vers) = @_;
+ my($epoch,$revision) = (0,"");
+
+ if ($vers =~ /^(\d+):(.*)/) {
+ $epoch = $1;
+ $vers = $2;
+ }
+
+ if ($vers =~ /(.*)-([^-]+)$/) {
+ $revision = $2;
+ $vers = $1;
+ }
+
+ return( $epoch, $vers, $revision );
+}
+
+sub binNMU_version {
+ my $v = shift;
+ my $binNMUver = shift;
+
+ return "$v+b$binNMUver";
+}
+
+
+my %monname = ('jan', 0, 'feb', 1, 'mar', 2, 'apr', 3, 'may', 4, 'jun', 5,
+ 'jul', 6, 'aug', 7, 'sep', 8, 'oct', 9, 'nov', 10, 'dec', 11 );
+
+sub parse_date {
+ my $text = shift;
+
+ return 0 if !$text;
+
+ if ($text =~ /^(\d{4}) (\w{3}) (\d+) (\d{2}):(\d{2}):(\d{2})$/) {
+ my ($year, $mon, $day, $hour, $min, $sec) = ($1, $2, $3, $4, $5, $6);
+ $mon =~ y/A-Z/a-z/;
+ die "Invalid month name $mon" if !exists $monname{$mon};
+ $mon = $monname{$mon};
+ return timegm($sec, $min, $hour, $day, $mon, $year);
+ } elsif ($text =~ /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(?:\.\d+)?$/) {
+ my ($year, $mon, $day, $hour, $min, $sec) = ($1, $2-1, $3, $4, $5, $6);
+ return timegm($sec, $min, $hour, $day, $mon, $year);
+ } else {
+ die "Cannot parse date: $text\n";
+ }
+}
+
+sub isin {
+ my $val = shift;
+
+ return 0 if !$val;
+
+ return grep( $_ eq $val, @_ );
+}
+
+#sub get_distributions {
+# my %distributions;
+
+# my $q = 'SELECT distribution, public, auto_dep_wait FROM distributions';
+# my $rows = $dbh->selectall_hashref($q, 'distribution');
+# foreach my $name (keys %$rows) {
+# $distributions{$name} = {};
+# $distributions{$name}->{'noadw'} = 1 if ($rows->{$name}->{'auto_dep_wait'});
+# $distributions{$name}->{'hidden'} = 1 if ($rows->{$name}->{'public'});
+# }
+
+# return %distributions;
+#}
+
+1;
+++ /dev/null
-ARCHS_oldstable="alpha amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc"
-ARCHS_stable="alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc s390 sparc"
-ARCHS_testing="amd64 armel hppa i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
-ARCHS_unstable="$ARCHS_testing alpha hurd-i386"
-CURLOPT="-q -s -S -R -f -Y 10 -y 120 -K /srv/wanna-build/trigger.curlrc"
-
-curl_index () {
- local url tmpname destname appendname curlopt
- url="$1"
- destname="$2"
- appendname="$3"
- tmpname=".$destname"
- rc=0
- rm -f "$tmpname"
- if [ -e "$destname" ]; then
- refdate=`perl -e "print scalar gmtime(((stat ('$destname'))[9]))"`
- curl $CURLOPT -z "$refdate" "$url" -o "$tmpname"
- rc=$?
- else
- curl $CURLOPT "$url" -o "$tmpname"
- rc=$?
- fi
- if [ $rc -eq 0 -a -e "$tmpname" ]; then
- if gzip -t "$tmpname"; then
- mv "$tmpname" "$destname"
- else
- rc=$?
- fi
- fi
- gzip -dc "$destname" >> "$appendname"
- return $rc
-}
-
+++ /dev/null
-#!/bin/sh
-# Meant to be run from the /srv/wanna-build/db dir
-
-set -e
-
-# lenny -> squeeze move
-ARCHS_old_stable="alpha amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc"
-ARCHS_new_stable="alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc s390 sparc"
-ARCHS_new_testing="alpha amd64 armel hppa i386 ia64 mips mipsel powerpc s390 sparc"
-
-#for a in $ALL_ARCHS; do
-# rm $a/build-db-oldstable
-# rm $a/build-db-oldstable-security
-#done
-
-for a in $ARCHS_old_stable; do
- mv $a/build-db-stable $a/build-db-oldstable
- mv $a/build-db-stable-security $a/build-db-oldstable-security
-done
-
-for a in $ARCHS_new_stable; do
- mv $a/build-db-testing $a/build-db-stable
- mv $a/build-db-testing-security $a/build-db-stable-security
-done
-
-for a in $ARCHS_new_testing; do
- group=wb-$a
- chmod 400 $a/build-db-stable
- cp -a $a/build-db-stable $a/build-db-testing
- wanna-build -b $a/build-db -d testing-security --create-db --list all
- if [ "$a" = "powerpc" ]; then
- group=wb-ppc
- fi
- if [ "$a" = "mipsel" ]; then
- group=wb-mips
- fi
- if [ "$a" = "amd64" ]; then
- group=wb-i386
- fi
- if [ "$a" = "armel" ]; then
- group=wb-arm
- fi
- chgrp $group $a/build-db-testing*
- chmod 000 $a/build-db-testing
- chmod 000 $a/build-db-testing-security
-done
-
-# Important! And rebuild it afterwards, check for sanity.
-#rm ../tmp/*
PAS_BASE="/org/buildd.debian.org/web/quinn-diff"
PAS_FILE="$PAS_BASE/$SUITE/Packages-arch-specific"
LOCKFILE="${ARCHIVE_BASE}/lock"
-ARCHS_etch="alpha amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc"
ARCHS_lenny="alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc s390 sparc"
-ARCHS_squeeze="amd64 armel hppa i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
-ARCHS_unstable="$ARCHS_squeeze alpha hurd-i386"
+ARCHS_squeeze="amd64 armel i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
+ARCHS_wheezy="amd64 armel i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
+ARCHS_sid="$ARCHS_squeeze alpha hppa hurd-i386"
# Creates a working environment within the corresponding archive
# directory and jumps there.
get_architectures() {
SUITE="$1"
- if [ "$SUITE" = "etch" -o "$SUITE" = "oldstable" ]; then echo $ARCHS_etch
- elif [ "$SUITE" = "lenny" -o "$SUITE" = "stable" ]; then echo $ARCHS_lenny
- elif [ "$SUITE" = "squeeze" -o "$SUITE" = "testing" ]; then echo $ARCHS_squeeze
- elif [ "$SUITE" = "unstable" -o "$SUITE" = "sid" ]; then echo $ARCHS_unstable
- elif [ "$SUITE" = "experimental" ]; then echo $ARCHS_unstable
+ if [ "$SUITE" = "lenny" -o "$SUITE" = "oldstable" ]; then echo $ARCHS_lenny
+ elif [ "$SUITE" = "squeeze" -o "$SUITE" = "stable" ]; then echo $ARCHS_squeeze
+ elif [ "$SUITE" = "wheezy" -o "$SUITE" = "testing" ]; then echo $ARCHS_wheezy
+ elif [ "$SUITE" = "unstable" -o "$SUITE" = "sid" ]; then echo $ARCHS_sid
+ elif [ "$SUITE" = "experimental" ]; then echo $ARCHS_sid
else
- echo "Unknown suite encountered, aborting." >2
+ echo "Unknown suite encountered, aborting." >&2
exit 1
fi
}
echo "`date`: Processing ${ARCHIVE}/${SUITE} ..."
- new-keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
+ keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
for ARCH in ${ARCHS}; do
- new-keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
+ keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
done
[ -f Packages.${SUITE}.i386.non-free ] && PNF="Packages.${SUITE}.%ARCH%.non-free" || PNF=""
[ -f Sources.${SUITE}.non-free ] && SNF="Sources.${SUITE}.non-free" || SNF=""
echo "`date`: Processing ${ARCHIVE}/${SUITE} ..."
- new-keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
- new-keep-latest source $(eval echo Sources.${SUITE} ${SOURCES_BASE}) > Sources.${SUITE}-all
+ keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
+ keep-latest source $(eval echo Sources.${SUITE} ${SOURCES_BASE}) > Sources.${SUITE}-all
for ARCH in ${ARCHS}; do
- new-keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
- new-keep-latest ${ARCH} Packages.${SUITE}.${ARCH} $(eval echo $(echo ${PACKAGES_BASE} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}-all
+ keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
+ keep-latest ${ARCH} Packages.${SUITE}.${ARCH} $(eval echo $(echo ${PACKAGES_BASE} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}-all
done
[ -f Packages.${SUITE}.i386.non-free ] && PNF="Packages.${SUITE}.%ARCH%.non-free" || PNF=""
[ -f Sources.${SUITE}.non-free ] && SNF="Sources.${SUITE}.non-free" || SNF=""
+ echo parallel -l 5 -i wanna-build -v --Pas ${PAS_FILE} --merge-v3 -A "{}" --dist=$WB_SUITE Packages.${SUITE}.%ARCH% $PNF . Sources.${SUITE} $SNF . \
+ Packages.${SUITE}.%ARCH%-all . Sources.${SUITE}-all $SNF -- ${ARCHS}
parallel -l 5 -i wanna-build -v --Pas ${PAS_FILE} --merge-v3 -A "{}" --dist=$WB_SUITE Packages.${SUITE}.%ARCH% $PNF . Sources.${SUITE} $SNF . \
Packages.${SUITE}.%ARCH%-all . Sources.${SUITE}-all $SNF -- ${ARCHS} || true
echo "`date`: Processing ${ARCHIVE}/${SUITE} ..."
- new-keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
+ keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
for ARCH in ${ARCHS}; do
- new-keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
+ keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
ucat Packages.${SUITE}.${ARCH} $(eval echo $(echo ${PACKAGES_BASE} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}-all
done
[ -f Packages.${SUITE}.i386.non-free ] && PNF="Packages.${SUITE}.%ARCH%.non-free" || PNF=""
fi
done
}
+
+filter_out_nonfree() {
+ INPUT="$1"
+ OUTPUT="$2"
+
+ gunzip -c "$INPUT" | grep-dctrl -v -r -F Section 'non-free/.*' | gzip -c > "$OUTPUT"
+}
+
+++ /dev/null
-#! /usr/bin/python
-
-
-import sys, os.path, gzip, subprocess
-#from debian_bundle import deb822
-import apt_pkg
-
-
-def check_source(ok, srcs, fw):
- ret=[]
- for f in srcs:
- #f = open(f, 'r')
- f = subprocess.Popen("zcat %s" % (f), shell=True, stdout=subprocess.PIPE).stdout
- pkg = apt_pkg.ParseTagFile(f)
- while pkg.Step():
- if not pkg.Section.get('Package'): continue
- if pkg.Section.get('Section','').startswith('non-free'):
- if pkg.Section.get('Autobuild') != 'yes': continue
- if pkg.Section['Package'] not in ok: continue
- ret += [pkg.Section['Package']]
- fw.write(str(pkg.Section))
- fw.write("\n")
- f.close()
- fw.close()
- return ret
-
-def check_binary(ok, bins, fw):
- for f in bins:
- f = subprocess.Popen("zcat %s" % (f), shell=True, stdout=subprocess.PIPE).stdout
- pkg = apt_pkg.ParseTagFile(f)
- while pkg.Step():
- if pkg.Section.get('Source', pkg.Section.get('Package')).split(" ")[0] not in ok: continue
- fw.write(str(pkg.Section))
- fw.write("\n")
- f.close()
- fw.close()
-
-def outfile(name, file):
- #return open(dir + "/" + os.path.basename(file), "w")
- #return open(file + name, "w")
- if file.endswith(name): return open(file[:-len(name)], "w")
-
-def replarch(arch, pkgs):
- return [ x.replace('%ARCH%', arch) for x in pkgs ]
-
-def main():
- # call me:
- # /org/wanna-build/etc/non-free-include-list "arch1 arch2" write-sources write-packages Sources* . Packages*
- if len(sys.argv) <= 4:
- print "Error - too few args"
- return
-
- oklist = [ x[:-1].split(' ')[0] for x in open(sys.argv[1]) ]
- #outsrcs = open(sys.argv[3], "w")
- #outpkgs = open(sys
- rem = sys.argv[5:]
- if '.' not in rem:
- print "need both Sources and Packages"
- return
- src = rem[:rem.index('.')]
- bin = rem[rem.index('.')+1:]
- if not src or not bin:
- print "need non-empty Sources and Packages"
- return
- okpkgs = check_source(oklist, src, open(sys.argv[3], "w"))
- print okpkgs
- for arch in sys.argv[2].split(" "):
- check_binary(okpkgs, replarch(arch, bin), open(replarch(arch, [sys.argv[4]])[0], "w"))
-
-if __name__ == '__main__':
- main()
#!/bin/bash
-# vim:set et ts=4 sw=4 ft=bash ai:
+# vim:set et ts=4 sw=4 ft=sh ai:
ARCHIVE="backports"
sync.sh $ARCHIVE nolock
# Autodetect suites by inspecting the directories in dists/.
- SUITES="$(find ${ARCHIVE_BASE}/archive/ -maxdepth 1 -mindepth 1 -type d | \
+ SUITES="$(find ${ARCHIVE_BASE}/archive/ -maxdepth 1 -mindepth 1 -type d -name '*-backports' | \
xargs -n 1 basename | \
sort | uniq)"
SOURCES="${ARCHIVE_BASE}/archive/${suite}/{main,contrib}/source/Sources.gz"
PACKAGES="${ARCHIVE_BASE}/archive/${suite}/{main,contrib}/binary-%ARCH%/Packages.gz"
PACKAGES_BASE="${ARCHIVE_MAIN}/archive/${base_suite}/{main,contrib}/binary-%ARCH%/Packages.gz"
- trigger_wb_update_with_secondary "$base_suite" "`get_architectures $base_suite`" "$PACKAGES_BASE" "$SOURCES" "$PACKAGES" "$suite"
+ trigger_wb_update_with_secondary "$suite" "`get_architectures $base_suite`" "$PACKAGES_BASE" "$SOURCES" "$PACKAGES" "$suite"
+ done
+
+ # Now the sloppy ones, which are a bit different.
+ SUITES="$(find ${ARCHIVE_BASE}/archive/ -maxdepth 1 -mindepth 1 -type d -name '*-backports-sloppy' | \
+ xargs -n 1 basename | \
+ sort | uniq)"
+
+ for suite in $SUITES
+ do
+ base_suite=${suite%%-backports-sloppy}
+ base_bpo_suite=${suite%%-sloppy}
+ SOURCES="${ARCHIVE_BASE}/archive/${suite}/{main,contrib}/source/Sources.gz"
+ PACKAGES="${ARCHIVE_BASE}/archive/${suite}/{main,contrib}/binary-%ARCH%/Packages.gz"
+ PACKAGES_BASE="${ARCHIVE_MAIN}/archive/${base_suite}/{main,contrib}/binary-%ARCH%/Packages.gz"
+ PACKAGES_BASE="${PACKAGES_BASE} ${ARCHIVE_BASE}/archive/${base_bpo_suite}/{main,contrib}/binary-%ARCH%/Packages.gz"
+ trigger_wb_update_with_secondary "$suite" "`get_architectures $base_suite`" "$PACKAGES_BASE" "$SOURCES" "$PACKAGES" "$suite"
done
cleanup
# vim:set et ts=4 sw=4 ft=sh ai:
ARCHIVE="debian"
-SUITES="stable testing"
+SUITES="lenny squeeze wheezy"
# Please note that SUITES_FAST_AUTOBUILD does not pull proposed-updates
# because there was no need for that yet.
-SUITES_FAST_AUTOBUILD="unstable experimental"
+SUITES_FAST_AUTOBUILD="sid experimental"
. /org/wanna-build/triggers/common
exec >> /org/wanna-build/db/merge.$ARCHIVE.log 2>&1
-if [ -f /org/wanna-build/NO-TRIGGERS ]
+if [ -f /org/wanna-build/NO-TRIGGERS -a -z "$1" ]
then
echo Trigger for $ARCHIVE skipped due to NO-TRIGGERS, aborting. >&2
exit 0
# files for -proposed-updates itself and additionally for
# debian-installer.
SOURCES="${ARCHIVE_BASE}/archive/${SUITE}-proposed-updates/{main,contrib}/source/Sources.gz"
+ NFSOURCES="${ARCHIVE_BASE}/archive/${SUITE}-proposed-updates/non-free/source/Sources.gz"
PACKAGES="${ARCHIVE_BASE}/archive/${SUITE}-proposed-updates/{main,contrib}/binary-%ARCH%/Packages.gz"
PACKAGES="${PACKAGES} ${ARCHIVE_BASE}/archive/${SUITE}-proposed-updates/{main,contrib}/debian-installer/binary-%ARCH%/Packages.gz"
+ NFPACKAGES="${ARCHIVE_BASE}/archive/${SUITE}-proposed-updates/non-free/binary-%ARCH%/Packages.gz"
+ NFPACKAGES="${NFPACKAGES} ${ARCHIVE_BASE}/archive/${SUITE}-proposed-updates/non-free/debian-installer/binary-%ARCH%/Packages.gz"
+ /org/wanna-build/bin/filter-nonfree /org/wanna-build/etc/non-free-include-list "`get_architectures $SUITE`" Sources.${SUITE}.non-free Packages.${SUITE}.%ARCH%.non-free ${NFSOURCES} . ${NFPACKAGES} || true
# Now add the overlay suite as above.
SOURCES_BASE="${ARCHIVE_BASE}/archive/${SUITE}/{main,contrib}/source/Sources.gz"
PACKAGES_BASE="${ARCHIVE_BASE}/archive/${SUITE}/{main,contrib}/binary-%ARCH%/Packages.gz"
for SUITE in $SUITES_FAST_AUTOBUILD
do
SOURCES="${ARCHIVE_BASE}/archive/${SUITE}/{main,contrib}/source/Sources.gz"
- SOURCES="${SOURCES} ${ARCHIVE_BASE}/buildd-${SUITE}/Sources.gz"
+ filter_out_nonfree "${ARCHIVE_BASE}/buildd-${SUITE}/Sources.gz" "Sources.${SUITE}.incoming-filtered.gz"
+ SOURCES="${SOURCES} Sources.${suite}.incoming-filtered.gz"
NFSOURCES="${ARCHIVE_BASE}/archive/${SUITE}/non-free/source/Sources.gz"
PACKAGES="${ARCHIVE_BASE}/archive/${SUITE}/{main,contrib}/binary-%ARCH%/Packages.gz"
PACKAGES="${PACKAGES} ${ARCHIVE_BASE}/archive/${SUITE}/{main,contrib}/debian-installer/binary-%ARCH%/Packages.gz"
PACKAGES="${PACKAGES} ${ARCHIVE_BASE}/buildd-${SUITE}/Packages.gz"
NFPACKAGES="${ARCHIVE_BASE}/archive/${SUITE}/non-free/binary-%ARCH%/Packages.gz"
NFPACKAGES="${NFPACKAGES} ${ARCHIVE_BASE}/archive/${SUITE}/non-free/debian-installer/binary-%ARCH%/Packages.gz"
- /org/wanna-build/triggers/filter-nonfree /org/wanna-build/etc/non-free-include-list "`get_architectures $SUITE`" Sources.${SUITE}.non-free Packages.${SUITE}.%ARCH%.non-free ${NFSOURCES} . ${NFPACKAGES} || true
+ /org/wanna-build/bin/filter-nonfree /org/wanna-build/etc/non-free-include-list "`get_architectures $SUITE`" Sources.${SUITE}.non-free Packages.${SUITE}.%ARCH%.non-free ${NFSOURCES} . ${NFPACKAGES} || true
if [ "$SUITE" != "experimental" ]
then
# The "it's not an overlay" part.
trigger_wb_update "${SUITE}" "`get_architectures ${SUITE}`" "$SOURCES" "$PACKAGES"
else
- BASE_SUITE=unstable
+ BASE_SUITE=sid
PACKAGES_BASE="${ARCHIVE_MAIN}/archive/${BASE_SUITE}/{main,contrib}/binary-%ARCH%/Packages.gz"
PACKAGES_BASE="${PACKAGES_BASE} ${ARCHIVE_MAIN}/archive/${BASE_SUITE}/{main,contrib}/debian-installer/binary-%ARCH%/Packages.gz"
#PACKAGES_BASE="${PACKAGES_BASE} ${ARCHIVE_MAIN}/buildd-${BASE_SUITE}/Packages.gz"
sync.sh $ARCHIVE nolock
# Handle unstable as a normal suite.
- suite=unstable
+ suite=sid
SOURCES="${ARCHIVE_BASE}/archive/${suite}/{main,contrib}/source/Sources.gz"
- SOURCES="${SOURCES} ${ARCHIVE_BASE}/buildd-${suite}/Sources.gz"
+ filter_out_nonfree "${ARCHIVE_BASE}/buildd-${suite}/Sources.gz" "Sources.${suite}.incoming-filtered.gz"
+ SOURCES="${SOURCES} Sources.${suite}.incoming-filtered.gz"
PACKAGES="${ARCHIVE_BASE}/archive/${suite}/{main,contrib}/binary-%ARCH%/Packages.gz"
PACKAGES="${PACKAGES} ${ARCHIVE_BASE}/archive/${suite}/main/debian-installer/binary-%ARCH%/Packages.gz"
PACKAGES="${PACKAGES} ${ARCHIVE_BASE}/buildd-${suite}/Packages.gz"
# Handle experimental as an overlay suite.
suite=experimental
- base_suite=unstable
+ base_suite=sid
SOURCES="${ARCHIVE_BASE}/archive/${suite}/{main,contrib}/source/Sources.gz"
- SOURCES="${SOURCES} ${ARCHIVE_BASE}/buildd-${suite}/Sources.gz"
+ filter_out_nonfree "${ARCHIVE_BASE}/buildd-${suite}/Sources.gz" "Sources.${suite}.incoming-filtered.gz"
+ SOURCES="${SOURCES} Sources.${suite}.incoming-filtered.gz"
PACKAGES="${ARCHIVE_BASE}/archive/${suite}/{main,contrib}/binary-%ARCH%/Packages.gz"
PACKAGES="${PACKAGES} ${ARCHIVE_BASE}/buildd-${suite}/Packages.gz"
if [ -f /org/wanna-build/NO-TRIGGERS ]
then
- echo Trigger for $ARCHIVE skipped due to NO-TRIGGERS, aborting. >2
+ echo Trigger for $ARCHIVE skipped due to NO-TRIGGERS, aborting. >&2
exit 0
fi
if [ -f /org/wanna-build/NO-TRIGGERS ]
then
- echo Trigger for $ARCHIVE skipped due to NO-TRIGGERS, aborting. >2
+ echo Trigger for $ARCHIVE skipped due to NO-TRIGGERS, aborting. >&2
exit 0
fi