Module Name:    src
Committed By:   christos
Date:           Fri May 15 16:33:38 UTC 2020

Modified Files:
        src/usr.sbin/postinstall: postinstall.in

Log Message:
Add a function to remove the debug bits of the stand files.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/postinstall/postinstall.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.20 src/usr.sbin/postinstall/postinstall.in:1.21
--- src/usr.sbin/postinstall/postinstall.in:1.20	Sun Apr 19 18:10:24 2020
+++ src/usr.sbin/postinstall/postinstall.in	Fri May 15 12:33:38 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.20 2020/04/19 22:10:24 roy Exp $
+# $NetBSD: postinstall.in,v 1.21 2020/05/15 16:33:38 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -2295,19 +2295,20 @@ do_varshm()
 #
 #	obsolete_stand
 #
-adddisableditem obsolete_stand "remove obsolete files from /stand"
-do_obsolete_stand()
+obsolete_stand_internal()
 {
-	[ -n "$1" ] || err 3 "USAGE: do_obsolete_stnd  fix|check"
-	op="$1"
-	failed=0
+	local prefix="$1"
+	shift
+	[ -n "$1" ] || err 3 "USAGE: do_obsolete_stand  fix|check"
+	local op="$1"
+	local failed=0
 
 	for dir in \
-	    /stand/${MACHINE} \
-	    /stand/${MACHINE}-4xx \
-	    /stand/${MACHINE}-booke \
-	    /stand/${MACHINE}-xen \
-	    /stand/${MACHINE}pae-xen
+	    ${prefix}/stand/${MACHINE} \
+	    ${prefix}/stand/${MACHINE}-4xx \
+	    ${prefix}/stand/${MACHINE}-booke \
+	    ${prefix}/stand/${MACHINE}-xen \
+	    ${prefix}/stand/${MACHINE}pae-xen
 	do
 		[ -d "${DESTDIR}${dir}" ] && obsolete_stand "${dir}"
 	done | obsolete_paths "${op}"
@@ -2316,6 +2317,20 @@ do_obsolete_stand()
 	return ${failed}
 }
 
+adddisableditem obsolete_stand "remove obsolete files from /stand"
+do_obsolete_stand()
+{
+	obsolete_stand_internal "" "$@"
+	return $?
+}
+
+adddisableditem obsolete_stand_debug "remove obsolete files from /usr/libdata/debug/stand"
+do_obsolete_stand_debug()
+{
+	obsolete_stand_internal "/usr/libdata/debug" "$@"
+	return $?
+}
+
 listarchsubdirs() {
 	if ! $SOURCEMODE; then
 		echo "@ARCHSUBDIRS@"

Reply via email to