${PORTSDIR}/infrastructure/build/out-of-date generates unusable data
for a port with a packing list containing '@option always-update'.

The following patch fixes the problem (which appears to be fallout from the
recent pkg_add improvements):

Index: out-of-date
===================================================================
RCS file: /pub/cvsroot/OpenBSD/ports/infrastructure/build/out-of-date,v
retrieving revision 1.17
diff -u -p -r1.17 out-of-date
--- out-of-date 2 Jan 2010 12:54:22 -0000       1.17
+++ out-of-date 25 Jan 2010 15:15:34 -0000
@@ -53,9 +53,13 @@ sub collect_installed
                $pkg->{$subdir}->{name}      = $name;
                $pkg->{$subdir}->{stem}      = $stem;
                $pkg->{$subdir}->{version}   = $version;
-               my $sig = $plist->signature;
-               if (ref($sig)) { $sig = $sig->string; }
-               $pkg->{$subdir}->{signature} = $sig;
+               if (defined $plist->{'always-update'}) {
+                 $pkg->{$subdir}->{signature} = 'always-update';
+               } else {
+                 my $sig = $plist->signature;
+                 if (ref($sig)) { $sig = $sig->string; }
+                 $pkg->{$subdir}->{signature} = $sig;
+               }
        }
        return $pkg;
 }

Here's a simple way to replicate the problem from an empty ${PKG_DBDIR}:
x4v64:build/packages 2120>sudo pkg_add -rxi pkg_mgr
x4v64:build/packages 2121>pkg_info
p5-Curses-1.20p0    terminal screen handling and optimisation
p5-Curses-UI-0.9607 curses based user interface framework for Perl
p5-DBD-SQLite-1.25v0 SQLite drivers for the Perl DBI
p5-DBI-1.609        unified perl interface for database access
p5-Net-Daemon-0.43  extension for portable daemons
p5-PlRPC-0.2018p0   module for writing rpc servers and clients
p5-Term-ReadKey-2.30p1 change terminal modes, and perform non-blocking reads
pkg_mgr-0.1p0       user-friendly package browser and manager
quirks-1.6          exceptions to pkg_add rules
sqlite3-3.6.16.1    embedded SQL implementation
sqlports-1.7        sqlite database of ports, user version
x4v64:build/packages 2122>/usr/ports/infrastructure/build/out-of-date
Collecting installed packages
Collecting port versions: ok
Collecting port signatures: ok
Outdated ports:

databases/sqlports,-main       # -main cdrom=yes ftp=yes
@arch amd64
+DESC
@sha RJuKFE16R4FCIZ7y8y2PnPF0XkYTLOddknbdsfQDuBM=
@size 2297
@cwd /usr/local
share/sqlports
@sha qmpuuuMQRYvPyMAu0wL1J8DYCkeb0bw9/V+a+qJZjUY=
@size 36389888
,@comment $OpenBSD: PLIST-main,v 1.2 2009/12/01 18:27:46 espie Exp $
@name sqlports-1.7
@option always-update
@comment subdir=databases/sqlports ->
devel/quirks                   # @comment $OpenBSD: PLIST,v 1.1.1.1 2009/12/04
16:50:48 espie Exp $
@name quirks-1.6
@option always-update
@comment subdir=devel/quirks cdrom=yes ftp=yes
@arch *
+DESC
@sha ZcShuBxD9cPsWmJce9rnoKKlC4qYQve7PwElfX/uk8Q=
@size 348
@cwd /usr/local
libdata/perl5/site_perl/OpenBSD/
libdata/perl5/site_perl/OpenBSD/Quirks.pm
@sha 5rWWNlXYKVZaVzQGwzHb5AvcvdSBOk/A07+PzJ2F2fk=
@size 5646
 ->


Here's what is generated after applying the patch:

x4v64:build/packages 2123>/usr/ports/infrastructure/build/out-of-date
Collecting installed packages
Collecting port versions: ok
Collecting port signatures: ok
Outdated ports:

databases/sqlports,-main       # always-update -> sqlports-1.7
devel/quirks                   # always-update -> quirks-1.6

Reply via email to