summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/pkg_delete
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2003-10-23 17:48:08 +0000
committerMarc Espie <espie@cvs.openbsd.org>2003-10-23 17:48:08 +0000
commit7ca8748215f2ac022f2468348f5937e9c26b327c (patch)
treef692ca00004c558364c9b9de73ffd8ebe5489b98 /usr.sbin/pkg_add/pkg_delete
parentc86d3c20731de23b19be2bb0919e6faf852f27c1 (diff)
missing space in DEINSTALL message.
allow pkg_delete stem to work, unless ambiguous. put all pkg_info's work into a single function, so that pkg_info autoconf will work. ok fries@ sturm@
Diffstat (limited to 'usr.sbin/pkg_add/pkg_delete')
-rw-r--r--usr.sbin/pkg_add/pkg_delete14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete
index 51ca34c28a6..8ecbcbb8ea5 100644
--- a/usr.sbin/pkg_add/pkg_delete
+++ b/usr.sbin/pkg_add/pkg_delete
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_delete,v 1.2 2003/10/19 18:42:55 espie Exp $
+# $OpenBSD: pkg_delete,v 1.3 2003/10/23 17:48:07 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -213,7 +213,7 @@ sub delete
my $opt_v = $state->{verbose};
my $opt_n = $state->{not};
my $pkgname = $state->{pkgname};
- print "Deinstall script: $dir",DEINSTALL ,"$pkgname DEINSTALL\n" if $opt_v or $opt_n;
+ print "Deinstall script: $dir",DEINSTALL ," $pkgname DEINSTALL\n" if $opt_v or $opt_n;
unless ($opt_n) {
chmod 0755, $dir.DEINSTALL;
system($dir.DEINSTALL, $pkgname, "DEINSTALL") == 0 or
@@ -295,6 +295,16 @@ do {
for my $pkgname (@ARGV) {
next if $done{$pkgname};
unless (is_installed($pkgname)) {
+ if (OpenBSD::PackageName::is_stem($pkgname)) {
+ my @l = OpenBSD::PackageName::findstem($pkgname, installed_packages());
+ if (@l == 1) {
+ $pkgname = $l[0];
+ } elsif (@l != 0) {
+ print "Ambiguous: $pkgname could be ", join(' ', @l),"\n";
+ }
+ }
+ }
+ unless (is_installed($pkgname)) {
print "$pkgname was not installed\n";
$done{$pkgname} = 1;
$removed++;