summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2004-06-21 15:19:33 +0000
committermiod <miod@openbsd.org>2004-06-21 15:19:33 +0000
commit417b188450b86b0846eb67c2cb41d8e695611d3e (patch)
treec8125effe43ec9b1abfe6d7d179f883a26dad9d6
parentTell the kernel to enable ESP-in-UDP encapsulation when we have (diff)
downloadwireguard-openbsd-417b188450b86b0846eb67c2cb41d8e695611d3e.tar.xz
wireguard-openbsd-417b188450b86b0846eb67c2cb41d8e695611d3e.zip
Implement pkg_add -I for real; ok espie@
-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};
+ }
}
}
}