Fixed version below, forgot about the fast path in PackingList.pm

On Mon, May 28, 2012 at 11:35:08AM +0200, Marc Espie wrote:
> This changes the external representation of 
> @comment subdir=... cdrom=... ftp=...
> into
> @comment pkgpath=... cdrom=... ftp=...
> 
> 
> thus, making the vocabulary more consistent.
> (especially since what's stored there is attained thru -DFULLPKGPATH=...
> which is already a "normalized" version of SUBDIR (flavors, subpackage,
> and gory details taken care of).
> 
> Since *all* official tools reuse this code, this should be totally
> transparent (in particular, register-plist is completely happy with this)
> 
Index: OpenBSD/PackingElement.pm
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PackingElement.pm,v
retrieving revision 1.205
diff -u -p -r1.205 PackingElement.pm
--- OpenBSD/PackingElement.pm   15 May 2012 08:14:29 -0000      1.205
+++ OpenBSD/PackingElement.pm   28 May 2012 09:57:04 -0000
@@ -684,7 +684,7 @@ sub add
 
        if ($args =~ m/^\$OpenBSD.*\$\s*$/o) {
                return OpenBSD::PackingElement::CVSTag->add($plist, $args);
-       } elsif ($args =~ m/^subdir\=(.*?)\s+cdrom\=(.*?)\s+ftp\=(.*?)\s*$/o) {
+       } elsif ($args =~ 
m/^(?:subdir|pkgpath)\=(.*?)\s+cdrom\=(.*?)\s+ftp\=(.*?)\s*$/o) {
                return OpenBSD::PackingElement::ExtraInfo->add($plist, $1, $2, 
$3);
        } elsif ($args eq 'no checksum') {
                $plist->{state}->{nochecksum} = 1;
@@ -940,7 +940,7 @@ sub stringize
 {
        my $self = shift;
        return join(' ',
-           "subdir=".$self->{subdir},
+           "pkgpath=".$self->{subdir},
            "cdrom=".may_quote($self->{cdrom}),
            "ftp=".may_quote($self->{ftp}));
 }
Index: OpenBSD/PackingList.pm
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PackingList.pm,v
retrieving revision 1.119
diff -u -p -r1.119 PackingList.pm
--- OpenBSD/PackingList.pm      15 May 2012 08:14:29 -0000      1.119
+++ OpenBSD/PackingList.pm      28 May 2012 09:57:04 -0000
@@ -237,7 +237,7 @@ sub ExtraInfoOnly
        my ($fh, $cont) = @_;
        my $_;
        while (<$fh>) {
-               if (m/^\@(?:name|pkgpath|comment\s+subdir\=)\b/o) {
+               if (m/^\@(?:name|pkgpath|comment\s+(?:subdir|pkgpath)\=)\b/o) {
                        &$cont($_);
                # XXX optimization
                } elsif (m/^\@(?:depend|wantlib|newgroup|newuser|cwd)\b/o) {
@@ -259,7 +259,7 @@ sub UpdateInfoOnly
                    }
                    return;
                }
-               if 
(m/^\@(?:name|depend|wantlib|conflict|option|pkgpath|url|arch|comment\s+subdir\=)\b/o)
 {
+               if 
(m/^\@(?:name|depend|wantlib|conflict|option|pkgpath|url|arch|comment\s+(?:subdir|pkgpath)\=)\b/o)
 {
                        &$cont($_);
                # XXX optimization
                } elsif (m/^\@(?:newgroup|newuser|cwd)\b/o) {

Reply via email to