From ee46693fa80dcafcc98db9adeca3d74e039be8b7 Mon Sep 17 00:00:00 2001 From: Andreas Barth Date: Fri, 11 Jun 2010 15:15:07 +0000 Subject: [PATCH] fix binNMU detection of installed packages, and fix testsuite and logging --- bin/wanna-build | 7 ++++++- lib/WB/QD.pm | 3 ++- tests/qd.pl | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/wanna-build b/bin/wanna-build index 1b75e76..6124fb3 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -42,6 +42,7 @@ use File::Copy; use DBI; use lib '/org/wanna-build/bin'; use lib '/org/wanna-build/lib'; +#use lib 'lib'; use WannaBuild; use YAML::Tiny; use Data::Dumper; @@ -2947,7 +2948,11 @@ sub parse_all_v3() { } $pkg->{'package'} = $name; } - my $logstr = "merge-v3 $vars->{'time'} ".$name."_$pkgs->{'version'} ($vars->{'arch'}, $vars->{'suite'}, previous: $pkg->{'version'}, $pkg->{'state'}):"; + my $logstr = "merge-v3 $vars->{'time'} ".$name."_$pkgs->{'version'}". + ($pkgs->{'binnmu'} ? ";b".$pkgs->{'binnmu'} : ""). + "($vars->{'arch'}, $vars->{'suite'}, previous: $pkg->{'version'}". + ($pkg->{'binary_nmu_version'} ? ";b".$pkg->{'binary_nmu_version'} : ""). + ", $pkg->{'state'}):"; if (isin($pkgs->{'status'}, qw (installed related)) && $pkg->{'binary_nmu_version'} && $pkgs->{'binnmu'} < $pkg->{'binary_nmu_version'}) { $pkgs->{'status'} = 'out-of-date'; diff --git a/lib/WB/QD.pm b/lib/WB/QD.pm index f4b1f5f..d5cefb3 100644 --- a/lib/WB/QD.pm +++ b/lib/WB/QD.pm @@ -3,6 +3,7 @@ package WB::QD; use strict; use IO::Uncompress::AnyInflate qw(anyinflate); use Dpkg::Version qw(vercmp); +use Data::Dumper; sub readsourcebins { my $arch = shift; @@ -60,12 +61,12 @@ sub readsourcebins { while(<$P>) { my $p; /^Version:\s*(\S+)$/mi and $p->{'version'} = $1; + /^Version:\s*(\S+)\+b([0-9]+)$/mi and $p->{'version'} = $1 and $p->{'binnmu'} = $2; /^Architecture:\s*(\S+)$/mi and $p->{'arch'} = $1; /^Package:\s*(\S+)$/mi and $p->{'binary'} = $1; /^Package:\s*(\S+)$/mi and $p->{'source'} = $1; /^Source:\s*(\S+)$/mi and $p->{'source'} = $1; /^Source:\s*(\S+)\s+\((\S+)\)$/mi and $p->{'source'} = $1 and $p->{'version'} = $2; - $p->{'version'} =~ /(\S+)\+b([0-9]+)/ and $p->{'version'} = $1 and $p->{'binnmu'} = $2; next unless $p->{'arch'} eq 'all' || $p->{'arch'} eq ${arch}; $binary->{$p->{'binary'}} = { 'version' => $p->{'version'}, 'arch' => $p->{'arch'}} unless $binary->{$p->{'binary'}} and vercmp($binary->{$p->{'binary'}}->{'version'}, $p->{'version'}) < 0; diff --git a/tests/qd.pl b/tests/qd.pl index 899eb10..9a4ceab 100755 --- a/tests/qd.pl +++ b/tests/qd.pl @@ -80,6 +80,7 @@ Architecture: i386 Version: 5.6 Package: bash +Source: bash (4.1-3) Priority: required Section: shells Architecture: i386 -- 2.39.2