our ($verbose, $mail_logs, $list_order, $list_state,
$curr_date, $op_mode, $user, $real_user, $distribution,
our ($verbose, $mail_logs, $list_order, $list_state,
$curr_date, $op_mode, $user, $real_user, $distribution,
$category, %catval, %short_category,
$short_date, $list_min_age, $dbbase, @curr_time,
$build_priority, %new_vers, $binNMUver, %merge_srcvers, %merge_binsrc,
$category, %catval, %short_category,
$short_date, $list_min_age, $dbbase, @curr_time,
$build_priority, %new_vers, $binNMUver, %merge_srcvers, %merge_binsrc,
- $printformat, $ownprintformat, $privmode
+ $printformat, $ownprintformat, $privmode, $extra_depends, $extra_conflicts
"dep-wait" => { mode => "set-dep-wait" },
forget => { mode => "forget" },
'forget-user' => { mode => 'forget-user' },
"dep-wait" => { mode => "set-dep-wait" },
forget => { mode => "forget" },
'forget-user' => { mode => 'forget-user' },
#"merge-quinn" => { mode => "merge-quinn" },
#"merge-partial-quinn" => { mode => "merge-partial-quinn" },
#"merge-packages" => { mode => "merge-packages" },
#"merge-quinn" => { mode => "merge-quinn" },
#"merge-partial-quinn" => { mode => "merge-partial-quinn" },
#"merge-packages" => { mode => "merge-packages" },
"format" => { arg => \$printformat },
"own-format" => { arg => \$ownprintformat },
"Pas" => { arg => \$Pas },
"format" => { arg => \$printformat },
"own-format" => { arg => \$ownprintformat },
"Pas" => { arg => \$Pas },
# special actions
export => { arg => \$export_to, mode => "export" },
import => { arg => \$import_from, mode => "import" },
# special actions
export => { arg => \$export_to, mode => "export" },
import => { arg => \$import_from, mode => "import" },
}
$list_order = $yamlmap->{"list-order"}{$list_state} if !$list_order and $list_state;
$list_order ||= $yamlmap->{"list-order"}{'default'};
}
$list_order = $yamlmap->{"list-order"}{$list_state} if !$list_order and $list_state;
$list_order ||= $yamlmap->{"list-order"}{'default'};
-if (isin( $op_mode, qw(list info)) && $distribution !~ /security/ && !(not -t and $user =~ /buildd-/) && !($privmode eq 'yes')) {
+$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';
$dbh = DBI->connect("DBI:Pg:service=wanna-build") ||
die "FATAL: Cannot open database: $DBI::errstr\n";
$schema_suffix = '_public';
elsif ($op_mode eq "set-binary-nmu") {
set_one_binnmu( $name, $version );
}
elsif ($op_mode eq "set-binary-nmu") {
set_one_binnmu( $name, $version );
}
- print "- $name:\n";
- print " - status: ok\n";
- if ($pkg->{'binary_nmu_version'}) {
- print " - binNMU:\n";
- print " - version: $pkg->{'binary_nmu_version'}\n";
- print " - changelog: $pkg->{'binary_nmu_changelog'}\n";
- }
+ print "- $name:\n";
+ print " - status: ok\n";
+ printf " - pkg-ver: %s_%s\n", $name, $version;
+ print " - binNMU: $pkg->{'binary_nmu_version'}\n" if $pkg->{'binary_nmu_version'};
+ print " - extra-changelog: $pkg->{'binary_nmu_changelog'}\n" if $pkg->{'binary_nmu_changelog'} && $pkg->{'binary_nmu_version'};
+ print " - extra-depends: $pkg->{'extra_depends'}\n" if $pkg->{'extra_depends'};
+ print " - extra-conflicts: $pkg->{'extra_conflicts'}\n" if $pkg->{'extra_conflicts'};
}
change_state( \$pkg, 'Building' );
$pkg->{'package'} = $name;
}
change_state( \$pkg, 'Building' );
$pkg->{'package'} = $name;
if (($pkg->{'state'} ne "Building") && ($pkg->{'state'} ne "Build-Attempted")) {
print "$name: not taken for building (state is $pkg->{'state'}). ",
if (($pkg->{'state'} ne "Building") && ($pkg->{'state'} ne "Build-Attempted")) {
print "$name: not taken for building (state is $pkg->{'state'}). ",
if (($pkg->{'state'} ne "Building") && ($pkg->{'state'} ne "Build-Attempted")) {
print "$name: not taken for building (state is $pkg->{'state'}). ",
if (($pkg->{'state'} ne "Building") && ($pkg->{'state'} ne "Build-Attempted")) {
print "$name: not taken for building (state is $pkg->{'state'}). ",
if ($pkg->{'state'} eq "Uploaded" &&
pkg_version_eq($pkg,$version)) {
if ($pkg->{'state'} eq "Uploaded" &&
pkg_version_eq($pkg,$version)) {
my $db_ver = $pkg->{'version'};
if (!version_eq($db_ver, $version)) {
my $db_ver = $pkg->{'version'};
if (!version_eq($db_ver, $version)) {
+sub set_one_update {
+ my $name = shift;
+ my $version = shift;
+ my $pkg = get_source_info($name);
+
+ if (!defined($pkg)) {
+ print "$name: not registered yet.\n";
+ return;
+ }
+ $pkg->{'version'} =~ s/\+b[0-9]+$//;
+
+ log_ta( $pkg, "--update" );
+ update_source_info($pkg);
+}
+
my $db = get_all_source_info(state => $state, user => $user, category => $category, list_min_age => $list_min_age);
foreach $name (keys %$db) {
next if $name =~ /^_/;
my $db = get_all_source_info(state => $state, user => $user, category => $category, list_min_age => $list_min_age);
foreach $name (keys %$db) {
next if $name =~ /^_/;
push @list, calculate_prio($db->{$name});
}
# filter components
@list = grep { my $i = $_->{'component'}; grep { $i eq $_ } split /[, ]+/, $yamlmap->{"restrict"}{'component'} } @list;
push @list, calculate_prio($db->{$name});
}
# filter components
@list = grep { my $i = $_->{'component'}; grep { $i eq $_ } split /[, ]+/, $yamlmap->{"restrict"}{'component'} } @list;
# first adjust ownprintformat, then set printformat accordingly
$printformat ||= $yamlmap->{"format"}{$ownprintformat};
# first adjust ownprintformat, then set printformat accordingly
$printformat ||= $yamlmap->{"format"}{$ownprintformat};
'permbuildpri' => 'PermBuildPri', 'rel' => 'Rel',
'calprio' => 'CalculatedPri', 'state_days' => 'State-Days',
'successtime' => 'Success-build-time',
'permbuildpri' => 'PermBuildPri', 'rel' => 'Rel',
'calprio' => 'CalculatedPri', 'state_days' => 'State-Days',
'successtime' => 'Success-build-time',
- 'anytime' => 'Build-time'
+ 'anytime' => 'Build-time',
+ 'extra_depends' => 'Extra-Dependencies',
+ 'extra_conflicts' => 'Extra-Conflicts',
-sub greparch {
- my ($gapkglong, $gaarch) = @_;
- my ($gapkg, $gaarchs) = split(/ \[/, $gapkglong);
- if ($gaarchs) {
- $_ = $gapkg;
- chop($gaarchs); # take away the ]
- my @gaarches = split(/ /, $gaarchs);
- if (substr($gaarches[0], 0, 1) eq '!') {
- return 0 if grep /^!$gaarch$/, @gaarches;
- } else { # positive case
- return 0 unless grep /^$gaarch$/, @gaarches;
- }
- };
- return 1;
-}
- my $faarch = $_[1];
- return join(', ', grep { &greparch($_, $faarch) } split(/, ?/, $_[0]));
+ return "" unless $_[0];
+ return Dpkg::Deps::parse($_[0], ("reduce_arch" => 1, "host_arch" => $_[1]))->dump();
print $SOURCES "Package: source---$key\n";
print $SOURCES "Version: $pkg->{'version'}\n";
my $t = &filterarch($srcs->{$key}{'dep'} || $srcs->{$key}{'depends'}, $arch);
print $SOURCES "Package: source---$key\n";
print $SOURCES "Version: $pkg->{'version'}\n";
my $t = &filterarch($srcs->{$key}{'dep'} || $srcs->{$key}{'depends'}, $arch);
print $SOURCES "Depends: $t\n" if $t;
my $u = &filterarch($srcs->{$key}{'conf'} || $srcs->{$key}{'conflicts'}, $arch);
print $SOURCES "Depends: $t\n" if $t;
my $u = &filterarch($srcs->{$key}{'conf'} || $srcs->{$key}{'conflicts'}, $arch);
my $q = "SELECT rel, priority, state_change, permbuildpri, section, buildpri, failed, state, binary_nmu_changelog, bd_problem, version, package, distribution, installed_version, notes, failed_category, builder, old_failed, previous_state, binary_nmu_version, depends, extract(days from date_trunc('days', now() - state_change)) as state_days"
. ", (SELECT max(build_time) FROM ".pkg_history_table_name()." WHERE pkg_history.package = packages.package AND pkg_history.distribution = packages.distribution AND result = 'successful') AS successtime"
. ", (SELECT max(build_time) FROM ".pkg_history_table_name()." WHERE pkg_history.package = packages.package AND pkg_history.distribution = packages.distribution ) AS anytime"
my $q = "SELECT rel, priority, state_change, permbuildpri, section, buildpri, failed, state, binary_nmu_changelog, bd_problem, version, package, distribution, installed_version, notes, failed_category, builder, old_failed, previous_state, binary_nmu_version, depends, extract(days from date_trunc('days', now() - state_change)) as state_days"
. ", (SELECT max(build_time) FROM ".pkg_history_table_name()." WHERE pkg_history.package = packages.package AND pkg_history.distribution = packages.distribution AND result = 'successful') AS successtime"
. ", (SELECT max(build_time) FROM ".pkg_history_table_name()." WHERE pkg_history.package = packages.package AND pkg_history.distribution = packages.distribution ) AS anytime"
. " FROM " . table_name()
. ' WHERE package = ? AND distribution = ?';
my $pkg = $dbh->selectrow_hashref( $q,
. " FROM " . table_name()
. ' WHERE package = ? AND distribution = ?';
my $pkg = $dbh->selectrow_hashref( $q,
my $q = "SELECT rel, priority, state_change, permbuildpri, section, buildpri, failed, state, binary_nmu_changelog, bd_problem, version, package, distribution, installed_version, notes, failed_category, builder, old_failed, previous_state, binary_nmu_version, depends, extract(days from date_trunc('days', now() - state_change)) as state_days"
# . ", (SELECT max(build_time) FROM ".pkg_history_table_name()." WHERE pkg_history.package = packages.package AND pkg_history.distribution = packages.distribution AND result = 'successful') AS successtime"
# . ", (SELECT max(build_time) FROM ".pkg_history_table_name()." WHERE pkg_history.package = packages.package AND pkg_history.distribution = packages.distribution ) AS anytime"
my $q = "SELECT rel, priority, state_change, permbuildpri, section, buildpri, failed, state, binary_nmu_changelog, bd_problem, version, package, distribution, installed_version, notes, failed_category, builder, old_failed, previous_state, binary_nmu_version, depends, extract(days from date_trunc('days', now() - state_change)) as state_days"
# . ", (SELECT max(build_time) FROM ".pkg_history_table_name()." WHERE pkg_history.package = packages.package AND pkg_history.distribution = packages.distribution AND result = 'successful') AS successtime"
# . ", (SELECT max(build_time) FROM ".pkg_history_table_name()." WHERE pkg_history.package = packages.package AND pkg_history.distribution = packages.distribution ) AS anytime"
- . ", successtime.build_time as successtime, anytime.build_time as anytime"
+ . ", successtime.build_time as successtime, anytime.build_time as anytime, extra_depends, extra_conflicts"
. " FROM " . table_name()
. " left join ( "
. "select distinct on (package, distribution) build_time, package, distribution from ".pkg_history_table_name()." where result = 'successful' order by package, distribution, timestamp "
. " FROM " . table_name()
. " left join ( "
. "select distinct on (package, distribution) build_time, package, distribution from ".pkg_history_table_name()." where result = 'successful' order by package, distribution, timestamp "
+ $pkg->{'extra_depends'} = $extra_depends if defined $extra_depends;
+ undef $pkg->{'extra_depends'} unless $pkg->{'extra_depends'};
+ $pkg->{'extra_conflicts'} = $extra_conflicts if defined $extra_conflicts;
+ undef $pkg->{'extra_conflicts'} unless $pkg->{'extra_conflicts'};
- " ($vars->{'arch'}, $vars->{'suite'}, previous: $pkg->{'version'}".
+ ($pkgs->{'binnmu'} ? ";b".$pkgs->{'binnmu'} : "").
+ "($vars->{'arch'}, $vars->{'suite'}, previous: $pkg->{'version'}".
+ ($pkg->{'binary_nmu_version'} ? ";b".$pkg->{'binary_nmu_version'} : "").
if ($pkg->{'state'} ne 'Installed') {
change_state( \$pkg, 'Installed');
delete $pkg->{'depends'};
if ($pkg->{'state'} ne 'Installed') {
change_state( \$pkg, 'Installed');
delete $pkg->{'depends'};
- delete $pkg->{'binary_nmu_version'};
- # delete $pkg->{'binary_nmu_changelog'}; - we keep the changelog for now in case there are bugs; activate in August 2010 or later
+ delete $pkg->{'extra_depends'};
+ delete $pkg->{'extra_conflicts'};
- my $attrs = { 'version' => 'version', 'installed_version' => 'version', 'section' => 'section', 'priority' => 'priority' };
+ my $attrs = { 'version' => 'version', 'installed_version' => 'version', 'binary_nmu_version' => 'binnmu', 'section' => 'section', 'priority' => 'priority' };
foreach my $k (keys %$attrs) {
if ($pkg->{$k} ne $pkgs->{$attrs->{$k}}) {
$pkg->{$k} = $pkgs->{$attrs->{$k}};
$change++;
}
}
foreach my $k (keys %$attrs) {
if ($pkg->{$k} ne $pkgs->{$attrs->{$k}}) {
$pkg->{$k} = $pkgs->{$attrs->{$k}};
$change++;
}
}
if (isin($pkgs->{'status'}, qw (related)) and $pkg->{'notes'} ne "related") {
$pkg->{'notes'} = "related";
$change++;
if (isin($pkgs->{'status'}, qw (related)) and $pkg->{'notes'} ne "related") {
$pkg->{'notes'} = "related";
$change++;