summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-06-21 15:19:34 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-06-21 15:19:34 +0000
commitaf50bab383360bb677dec3fd31407782f63ee776 (patch)
treed8dcb6e6107883928d3c8f65f03b4cd4b4473682 /usr.sbin
parent8dbb08a748a70c14e7955e9540ce1835e28d0c7a (diff)
Implement pkg_add -I for real; ok espie@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/pkg_add32
1 files changed, 19 insertions, 13 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index e0cdf715b11..6ec35894cd7 100644
--- a/usr.sbin/pkg_add/pkg_add
+++ b/usr.sbin/pkg_add/pkg_add
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_add,v 1.31 2004/04/28 06:53:17 espie Exp $
+# $OpenBSD: pkg_add,v 1.32 2004/06/21 15:19:33 miod Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -460,12 +460,15 @@ sub really_add($$)
borked_script("require script");
}
}
- if ($plist->has(INSTALL)) {
- print "Install script: $dir",INSTALL," $pkgname PRE-INSTALL\n" if $opt_v or $opt_n;
- unless ($opt_n) {
- chmod 0755, $dir.INSTALL;
- system($dir.INSTALL, $pkgname, "PRE-INSTALL") == 0 or
- borked_script("install script");
+
+ unless ($opt_I) {
+ if ($plist->has(INSTALL)) {
+ print "Install script: $dir",INSTALL," $pkgname PRE-INSTALL\n" if $opt_v or $opt_n;
+ unless ($opt_n) {
+ chmod 0755, $dir.INSTALL;
+ system($dir.INSTALL, $pkgname, "PRE-INSTALL") == 0 or
+ borked_script("install script");
+ }
}
}
@@ -489,12 +492,15 @@ sub really_add($$)
}
$handle->close();
- if ($plist->has(INSTALL) && !$interrupted) {
- print "Install script: $dir",INSTALL ,"$pkgname POST-INSTALL\n" if $opt_v or $opt_n;
- unless ($opt_n) {
- if (system($dir.INSTALL, $pkgname, "POST-INSTALL") != 0) {
- print STDERR "install script for $pkgname borked\n";
- $errors++ unless $forced{scripts};
+
+ unless ($opt_I) {
+ if ($plist->has(INSTALL) && !$interrupted) {
+ print "Install script: $dir",INSTALL ," $pkgname POST-INSTALL\n" if $opt_v or $opt_n;
+ unless ($opt_n) {
+ if (system($dir.INSTALL, $pkgname, "POST-INSTALL") != 0) {
+ print STDERR "install script for $pkgname borked\n";
+ $errors++ unless $forced{scripts};
+ }
}
}
}