diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-08-02 12:08:26 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-08-02 12:08:26 +0000 |
commit | efa379bc32ae3c2e62eda2303fc862a8739b5025 (patch) | |
tree | 74013ef37c4b50d2b56700fc87eaf4751a775b48 /usr.sbin/pkg_add/OpenBSD | |
parent | 913bed0b7b038840f1a3f46d46cf3d1b0866a1a6 (diff) |
Reuse first component of @newdepends, @libdepends to contain
a PKG_PATH (easy backward compatibility: is there a slash ?)
That's missing info to enable pkg_add to launch package building
in the ports tree as an alternate source of binary packages.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index fb18e6dd0dd..cf93270fed5 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,4 +1,4 @@ -# $OpenBSD: PackingElement.pm,v 1.13 2004/07/22 22:23:26 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.14 2004/08/02 12:08:25 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -441,13 +441,21 @@ sub new { my ($class, $args) = @_; my ($name, $pattern, $def) = split /\:/, $args; - bless { name => $name, pattern => $pattern, def => $def }, $class; + my $self = bless { pattern => $pattern, def => $def }, $class; + # very old packages still work + if ($name =~ m|/|) { + $self->{pkgpath} = $name; + } else { + $self->{name} = $name; + } + return $self; } sub stringize($) { my $self = $_[0]; - return $self->{name}.':'.$self->{pattern}.':'.$self->{def}; + return (defined $self->{name} ? $self->{name} : $self->{pkgpath}). + ':'.$self->{pattern}.':'.$self->{def}; } package OpenBSD::PackingElement::LibDepend; @@ -462,15 +470,22 @@ sub new { my ($class, $args) = @_; my ($name, $libspec, $pattern, $def) = split /\:/, $args; - bless { name => $name, libspec => $libspec, pattern => $pattern, + my $self = bless { libspec => $libspec, pattern => $pattern, def => $def }, $class; + # very old packages still work + if ($name =~ m|/|) { + $self->{pkgpath} = $name; + } else { + $self->{name} = $name; + } + return $self; } sub stringize($) { my $self = $_[0]; - return $self->{name}.':'.$self->{libspec}.':'.$self->{pattern}. - ':'.$self->{def}; + return (defined $self->{name} ? $self->{name} : $self->{pkgpath}). + ':'.$self->{libspec}.':'.$self->{pattern}.':'.$self->{def}; } package OpenBSD::PackingElement::Unique; |