Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/postinstall Add a function to remove the debug bits...



details:   https://anonhg.NetBSD.org/src/rev/81b6fc5b8200
branches:  trunk
changeset: 972091:81b6fc5b8200
user:      christos <christos%NetBSD.org@localhost>
date:      Fri May 15 16:33:38 2020 +0000

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

diffstat:

 usr.sbin/postinstall/postinstall.in |  37 ++++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 deletions(-)

diffs (63 lines):

diff -r 72d993edac17 -r 81b6fc5b8200 usr.sbin/postinstall/postinstall.in
--- a/usr.sbin/postinstall/postinstall.in       Fri May 15 15:20:40 2020 +0000
+++ b/usr.sbin/postinstall/postinstall.in       Fri May 15 16:33:38 2020 +0000
@@ -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 @@
 #
 #      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 @@
        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@"



Home | Main Index | Thread Index | Old Index