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: obsolete etc f...



details:   https://anonhg.NetBSD.org/src/rev/2485d915879a
branches:  trunk
changeset: 1005828:2485d915879a
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Dec 22 18:41:36 2019 +0000

description:
PR/54730: Izumi Tsutsui: obsolete etc files are not being cleaned up on
an upgrade build.

diffstat:

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

diffs (34 lines):

diff -r cc14a8d3d9e2 -r 2485d915879a usr.sbin/postinstall/postinstall.in
--- a/usr.sbin/postinstall/postinstall.in       Sun Dec 22 17:27:53 2019 +0000
+++ b/usr.sbin/postinstall/postinstall.in       Sun Dec 22 18:41:36 2019 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.10 2019/12/04 04:45:42 christos Exp $
+# $NetBSD: postinstall.in,v 1.11 2019/12/22 18:41:36 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1468,9 +1468,21 @@
        if $SOURCEMODE; then
                ${SED} -n -e "/obsolete/s@\.$1$2[[:space:]].*@\1@p" \
                    ${SRC_DIR}/distrib/sets/lists/$3/mi
+               return
+       fi
+
+       # On upgrade builds we don't extract the "etc" set so we
+       # try to use the source set instead. See PR/54730 for
+       # ways to better handle this.
+
+       local obsolete_dir
+
+       if [ $3 = "etc" ] ;then
+               obsolete_dir=${SRC_DIR}/var/db/obsolete
        else
-               ${SED} -n -e "s@\.$1$2\$@\1@p" "${DEST_DIR}/var/db/obsolete/$3"
+               obsolete_dir=${DEST_DIR}/var/db/obsolete
        fi
+       ${SED} -n -e "s@\.$1$2\$@\1@p" "${obsolete_dir}/$3"
 }
 
 getetcsets()



Home | Main Index | Thread Index | Old Index