Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall PR/54730: Izumi Tsutsui: Use /var/db/ob...



details:   https://anonhg.NetBSD.org/src/rev/f20f6b58a181
branches:  trunk
changeset: 465789:f20f6b58a181
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Dec 04 04:45:42 2019 +0000

description:
PR/54730: Izumi Tsutsui: Use /var/db/obsolete/<set> to remove obsolete rc.d
files when not in $SOURCEMODE.

diffstat:

 usr.sbin/postinstall/postinstall.in |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r 303411d82266 -r f20f6b58a181 usr.sbin/postinstall/postinstall.in
--- a/usr.sbin/postinstall/postinstall.in       Wed Dec 04 03:04:52 2019 +0000
+++ b/usr.sbin/postinstall/postinstall.in       Wed Dec 04 04:45:42 2019 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.9 2019/11/12 23:54:34 christos Exp $
+# $NetBSD: postinstall.in,v 1.10 2019/12/04 04:45:42 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1462,13 +1462,17 @@
 # select obsolete files in a sets file
 # $1: directory pattern
 # $2: file pattern
-# $3: filename
+# $3: setname
 select_obsolete_files()
 {
-       ${SED} -n -e "/obsolete/s@\.$1$2[[:space:]].*@\1@p" $3
+       if $SOURCEMODE; then
+               ${SED} -n -e "/obsolete/s@\.$1$2[[:space:]].*@\1@p" \
+                   ${SRC_DIR}/distrib/sets/lists/$3/mi
+       else
+               ${SED} -n -e "s@\.$1$2\$@\1@p" "${DEST_DIR}/var/db/obsolete/$3"
+       fi
 }
 
-
 getetcsets()
 {
        if $SOURCEMODE; then
@@ -1504,7 +1508,7 @@
 
        # obsolete rc file in /etc/rc.d
        local rc_obsolete_files="$(select_obsolete_files /etc/rc.d/ \
-           "\([^[:space:]]*\)" ${etcsets})"
+           "\([^[:space:]]*\)" etc)"
 
        compare_dir "${op}" "${SRC_DIR}/etc" "${DEST_DIR}/etc" 644 \
                ${rc_644_files}



Home | Main Index | Thread Index | Old Index