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/Add.pm9
-rw-r--r--usr.sbin/pkg_add/OpenBSD/CollisionReport.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm3
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageInfo.pm12
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm35
6 files changed, 28 insertions, 39 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index c3b1046220c..c16e3f6a3d6 100644
--- a/usr.sbin/pkg_add/OpenBSD/Add.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Add.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.24 2004/12/12 11:26:16 espie Exp $
+# $OpenBSD: Add.pm,v 1.25 2004/12/16 11:07:33 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -46,6 +46,7 @@ sub manpages_index
sub register_installation
{
my ($dir, $dest, $plist) = @_;
+ return if $main::not;
mkdir($dest);
for my $i (info_names()) {
copy($dir.$i, $dest);
@@ -104,11 +105,11 @@ sub validate_plist($$)
sub borked_installation
{
- my ($plist, $dir) = @_;
+ my ($plist, $dir, @msg) = @_;
use OpenBSD::PackingElement;
- my $borked = borked_package();
+ my $borked = borked_package($plist->pkgname());
# fix packing list for pkg_delete
$plist->{items} = $plist->{done};
@@ -136,7 +137,7 @@ sub borked_installation
$plist->{pkgdep} = [];
my $dest = installed_info($borked);
register_installation($dir, $dest, $plist);
- Fatal "Installation of $pkgname failed, partial installation recorded as $borked";
+ Fatal @msg, ", partial installation recorded as $borked";
}
# used by newuser/newgroup to deal with options.
diff --git a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
index 1b027aae011..b28eda98c5c 100644
--- a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
+++ b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: CollisionReport.pm,v 1.4 2004/11/15 17:05:50 espie Exp $
+# $OpenBSD: CollisionReport.pm,v 1.5 2004/12/16 11:07:33 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -52,7 +52,7 @@ sub collision_report($$)
for my $item (sort @{$bypkg->{$pkg}}) {
print "\t$item ($pkg)\n";
}
- if ($pkg =~ m/^borked\.\d+$/) {
+ if ($pkg =~ m/^partial\-/) {
$clueless_bat = $pkg;
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 19ac1bd56a6..c84c9029d3e 100644
--- a/usr.sbin/pkg_add/OpenBSD/Delete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.16 2004/12/15 01:07:10 espie Exp $
+# $OpenBSD: Delete.pm,v 1.17 2004/12/16 11:07:33 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -150,7 +150,6 @@ sub delete_plist
}
remove_packing_info($dir) unless $state->{not};
- $plist->forget();
}
package OpenBSD::PackingElement;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm b/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
index 873758a0843..e6eed5776c5 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageInfo.pm,v 1.13 2004/11/14 19:10:41 espie Exp $
+# $OpenBSD: PackageInfo.pm,v 1.14 2004/12/16 11:07:33 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -119,14 +119,18 @@ sub installed_contents($)
return installed_info(shift).CONTENTS;
}
-sub borked_package()
+sub borked_package($)
{
+ my $pkgname = $_[0];
+ unless (-e "$pkg_db/partial-$pkgname") {
+ return "partial-$pkgname";
+ }
my $i = 1;
- while (-e "$pkg_db/borked.$i") {
+ while (-e "$pkg_db/partial-$pkgname.$i") {
$i++;
}
- return "borked.$i";
+ return "partial-$pkgname.$i";
}
sub is_installed($)
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index d2552514585..13178f54d06 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.74 2004/12/09 18:58:25 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.75 2004/12/16 11:07:33 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -434,7 +434,7 @@ sub ensure_ldconfig
if ($todo) {
require OpenBSD::SharedLibs;
- &OpenBSD::SharedLibs::ensure_ldconfig();
+ &OpenBSD::SharedLibs::ensure_ldconfig;
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 6c6f8a42758..781983dcb24 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.42 2004/12/15 01:07:10 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.43 2004/12/16 11:07:33 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -67,7 +67,6 @@ sub read
$plist = $a;
} else {
$plist = new $a;
- $plist->{code} = $code;
}
&$code($fh,
sub {
@@ -334,30 +333,22 @@ sub from_installation
require OpenBSD::PackageInfo;
- if (defined $plist_cache->{\&defaultCode}->{$pkgname}) {
- return $plist_cache->{\&defaultCode}->{$pkgname};
- }
$code = \&defaultCode if !defined $code;
- if (!defined $plist_cache->{$code}->{$pkgname}) {
- my $plist =
- $o->fromfile(OpenBSD::PackageInfo::installed_contents($pkgname),
- $code);
- if (defined $plist) {
- $plist_cache->{$code}->{$pkgname} = $plist;
- return $plist;
- } else {
- return undef;
- }
+ if ($code == \&DependOnly && defined $plist_cache->{$pkgname}) {
+ return $plist_cache->{$pkgname};
+ }
+ my $plist =
+ $o->fromfile(OpenBSD::PackageInfo::installed_contents($pkgname),
+ $code);
+ if (defined $plist && $code == \&DependOnly) {
+ $plist_cache->{$pkgname} = $plist;
}
- return $plist_cache->{$code}->{$pkgname};
+ return $plist;
}
sub to_cache
{
- my ($self) = @_;
-
- $plist_cache->{\&defaultCode}->{$self->pkgname()} = $self;
}
sub to_installation
@@ -366,7 +357,6 @@ sub to_installation
require OpenBSD::PackageInfo;
- $self->to_cache();
return if $main::not;
$self->tofile(OpenBSD::PackageInfo::installed_contents($self->pkgname()));
@@ -375,11 +365,6 @@ sub to_installation
sub forget
{
- my ($self) = @_;
-
- if (defined $plist_cache->{$self->{code}}) {
- delete $plist_cache->{$self->{code}}->{$self->pkgname()};
- }
}
1;