summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Handle.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocation.pm61
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocator.pm14
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository.pm10
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm17
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgDelete.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/State.pm10
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm3
9 files changed, 31 insertions, 98 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Handle.pm b/usr.sbin/pkg_add/OpenBSD/Handle.pm
index 0a41e514b4f..95863054ad1 100644
--- a/usr.sbin/pkg_add/OpenBSD/Handle.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Handle.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Handle.pm,v 1.28 2011/07/12 10:30:29 espie Exp $
+# $OpenBSD: Handle.pm,v 1.29 2011/08/26 08:46:09 espie Exp $
#
# Copyright (c) 2007-2009 Marc Espie <espie@openbsd.org>
#
@@ -147,7 +147,7 @@ sub create_old
my $self= $class->new;
$self->{name} = $pkgname;
- my $location = $state->repo->installed->find($pkgname, $state->{arch});
+ my $location = $state->repo->installed->find($pkgname);
if (defined $location) {
$self->{location} = $location;
}
@@ -223,7 +223,7 @@ sub get_location
my $name = $handle->{name};
- my $location = $state->repo->find($name, $state->{arch});
+ my $location = $state->repo->find($name);
if (!$location) {
$state->print("#1", $state->deptree_header($name));
$handle->set_error(NOT_FOUND);
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
index 369c09ee8a3..81b638b681a 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageLocation.pm,v 1.29 2011/03/20 08:17:49 espie Exp $
+# $OpenBSD: PackageLocation.pm,v 1.30 2011/08/26 08:46:09 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -26,24 +26,14 @@ use OpenBSD::Error;
sub new
{
- my ($class, $repository, $name, $arch) = @_;
+ my ($class, $repository, $name) = @_;
my $self = { repository => $repository, name => $repository->canonicalize($name), state => $repository->{state} };
- if (defined $arch) {
- $self->{arch} = $arch;
- }
bless $self, $class;
return $self;
}
-sub set_arch
-{
- my ($self, $arch) = @_;
-
- $self->{arch} = $arch;
-}
-
sub url
{
my $self = shift;
@@ -122,32 +112,6 @@ sub find_contents
}
}
-sub find_fat_contents
-{
- my $self = shift;
-
- while (my $e = $self->_next) {
- unless ($e->{name} =~ m/^(.*)\/\+CONTENTS$/o) {
- last;
- }
- my $prefix = $1;
- my $contents = $e->contents;
- require OpenBSD::PackingList;
-
- my $plist = OpenBSD::PackingList->fromfile(\$contents,
- \&OpenBSD::PackingList::FatOnly);
- if (defined $self->name) {
- next if $plist->pkgname ne $self->name;
- }
- if ($plist->has('arch')) {
- if ($plist->{arch}->check($self->{arch})) {
- $self->{filter} = $prefix;
- return $contents;
- }
- }
- }
-}
-
sub contents
{
my ($self, $extra) = @_;
@@ -159,12 +123,10 @@ sub contents
my $contents = $self->find_contents($extra);
if ($contents) {
$self->unput;
- return $contents;
}
- return $self->find_fat_contents;
+ return $contents;
}
- $self->{contents} = $self->find_contents ||
- $self->find_fat_contents;
+ $self->{contents} = $self->find_contents;
}
return $self->{contents};
@@ -339,20 +301,7 @@ sub getNext
{
my $self = shift;
- my $e = $self->{_archive}->next;
- if (defined $self->{filter}) {
- if ($e->{name} =~ m/^(.*?)\/(.*)$/o) {
- my ($beg, $name) = ($1, $2);
- if (index($beg, $self->{filter}) == -1) {
- return $self->getNext;
- }
- $e->{name} = $name;
- if ($e->isHardLink) {
- $e->{linkname} =~ s/^(.*?)\///o;
- }
- }
- }
- return $e;
+ return $self->{_archive}->next;
}
sub skip
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
index ad4c1ee511c..1760a5afb58 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageLocator.pm,v 1.98 2010/12/24 09:04:14 espie Exp $
+# $OpenBSD: PackageLocator.pm,v 1.99 2011/08/26 08:46:10 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -65,34 +65,34 @@ sub path_parse
sub find
{
- my ($self, $_, $arch, $state) = @_;
+ my ($self, $_, $state) = @_;
my $package;
if (m/[\/\:]/o) {
my ($repository, $pkgname) = $self->path_parse($_, $state);
- $package = $repository->find($pkgname, $arch);
+ $package = $repository->find($pkgname);
if (defined $package) {
$self->default_path($state)->add($repository);
}
} else {
- $package = $self->default_path($state)->find($_, $arch);
+ $package = $self->default_path($state)->find($_);
}
return $package;
}
sub grabPlist
{
- my ($self, $_, $arch, $code, $state) = @_;
+ my ($self, $_, $code, $state) = @_;
my $plist;
if (m/[\/\:]/o) {
my ($repository, $pkgname) = $self->path_parse($_, $state);
- $plist = $repository->grabPlist($pkgname, $arch, $code);
+ $plist = $repository->grabPlist($pkgname, $code);
if (defined $plist) {
$self->default_path($state)->add($repository);
}
} else {
- $plist = $self->default_path($state)->grabPlist($_, $arch, $code);
+ $plist = $self->default_path($state)->grabPlist($_, $code);
}
return $plist;
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
index 6aa19e54a36..55e663e6784 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageRepository.pm,v 1.93 2010/12/24 09:04:14 espie Exp $
+# $OpenBSD: PackageRepository.pm,v 1.94 2011/08/26 08:46:10 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -235,8 +235,8 @@ sub open
sub find
{
- my ($repository, $name, $arch) = @_;
- my $self = $repository->new_location($name, $arch);
+ my ($repository, $name) = @_;
+ my $self = $repository->new_location($name);
if ($self->contents) {
return $self;
@@ -245,8 +245,8 @@ sub find
sub grabPlist
{
- my ($repository, $name, $arch, $code) = @_;
- my $self = $repository->new_location($name, $arch);
+ my ($repository, $name, $code) = @_;
+ my $self = $repository->new_location($name);
return $self->grabPlist($code);
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index e6a1279035f..5eff0ebd738 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingList.pm,v 1.114 2011/06/16 14:48:36 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.115 2011/08/26 08:46:10 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -291,21 +291,6 @@ sub UpdateInfoOnly
}
}
-sub FatOnly
-{
- my ($fh, $cont) = @_;
- my $_;
- while (<$fh>) {
- # XXX optimization
- if (m/^\@arch\b/o) {
- &$cont($_);
- return;
- }
- next unless m/^\@(?:name\b)/o;
- &$cont($_);
- }
-}
-
sub ConflictOnly
{
my ($fh, $cont) = @_;
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index ee1d18953e1..567fe05b2ec 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.32 2011/08/23 10:32:27 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.33 2011/08/26 08:46:10 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -1065,7 +1065,7 @@ sub process_parameters
if (OpenBSD::PackageName::is_stem($pkgname)) {
$l = $state->updater->stem2location($inst, $pkgname, $state);
} else {
- $l = $inst->find($pkgname, $state->{arch});
+ $l = $inst->find($pkgname);
}
if (!defined $l) {
$state->say("Problem finding #1", $pkgname);
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm b/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm
index e6efc43066f..10525f2f3b8 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgDelete.pm,v 1.23 2011/08/23 10:32:27 espie Exp $
+# $OpenBSD: PkgDelete.pm,v 1.24 2011/08/26 08:46:10 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -222,7 +222,7 @@ sub process_parameters
$l = $state->stem2location($inst, $pkgname,
$state);
} else {
- $l = $inst->find($pkgname, $state->{arch});
+ $l = $inst->find($pkgname);
}
if (!defined $l) {
$state->say("Problem finding #1", $pkgname);
diff --git a/usr.sbin/pkg_add/OpenBSD/State.pm b/usr.sbin/pkg_add/OpenBSD/State.pm
index 8384ef504d5..2f848eff898 100644
--- a/usr.sbin/pkg_add/OpenBSD/State.pm
+++ b/usr.sbin/pkg_add/OpenBSD/State.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: State.pm,v 1.20 2010/12/24 09:04:14 espie Exp $
+# $OpenBSD: State.pm,v 1.21 2011/08/26 08:46:10 espie Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
@@ -119,10 +119,10 @@ sub path_parse
sub find
{
- my ($self, $pkg, $arch) = @_;
+ my ($self, $pkg) = @_;
require OpenBSD::PackageLocator;
- return OpenBSD::PackageLocator->find($pkg, $arch, $self->{state});
+ return OpenBSD::PackageLocator->find($pkg, $self->{state});
}
sub match_locations
@@ -135,10 +135,10 @@ sub match_locations
sub grabPlist
{
- my ($self, $url, $arch, $code) = @_;
+ my ($self, $url, $code) = @_;
require OpenBSD::PackageLocator;
- return OpenBSD::PackageLocator->grabPlist($url, $arch, $code, $self->{state});
+ return OpenBSD::PackageLocator->grabPlist($url, $code, $self->{state});
}
sub path
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index dd57d45bc1d..ef4db8a822a 100644
--- a/usr.sbin/pkg_add/OpenBSD/Update.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Update.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Update.pm,v 1.149 2011/07/19 20:04:23 espie Exp $
+# $OpenBSD: Update.pm,v 1.150 2011/08/26 08:46:10 espie Exp $
#
# Copyright (c) 2004-2010 Marc Espie <espie@openbsd.org>
#
@@ -148,7 +148,6 @@ sub process_handle
}
my @l2 = ();
for my $loc (@$l) {
- $loc->set_arch($state->{arch});
if (!$loc) {
next;
}