Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall correct blocklist script



details:   https://anonhg.NetBSD.org/src/rev/984bced92080
branches:  trunk
changeset: 934673:984bced92080
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jun 15 21:51:13 2020 +0000

description:
correct blocklist script
- removal of rc file is handled by obsolete
- use grep to find if we need more changes
- fix rc population

diffstat:

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

diffs (43 lines):

diff -r 9f7bd8fdbe7a -r 984bced92080 usr.sbin/postinstall/postinstall.in
--- a/usr.sbin/postinstall/postinstall.in       Mon Jun 15 21:27:57 2020 +0000
+++ b/usr.sbin/postinstall/postinstall.in       Mon Jun 15 21:51:13 2020 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.25 2020/06/15 14:32:07 christos Exp $
+# $NetBSD: postinstall.in,v 1.26 2020/06/15 21:51:13 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -862,18 +862,19 @@
 additem blocklist "rename old files to blocklist"
 do_blocklist()
 {
+       local rcfiles="/etc/rc.conf /etc/npf.conf /etc/defaults/rc.conf"
+       
        # if we are actually using blocklistd
        if [ -f /var/db/blacklist.db ]; then
                mv /var/db/blacklist.db /var/db/blocklist.db
        fi
 
        # if we have fixed the rc files we are done
-       if [ ! -f /etc/rc.d/blacklist ]; then
+       if ! grep -qs $rcfiles; then
                return
        fi
 
-       fixblock /etc/rc.conf /etc/npf.conf /etc/defaults/rc.conf
-       rm -f /etc/rc.d/blacklist
+       fixblock $rcfiles
 }
 
 #
@@ -1618,7 +1619,7 @@
        fi
 
        # Directories of external programs that have rc files (in bsd)
-       local rc_external_files="blacklist nsd unbound"
+       local rc_external_files="blocklist nsd unbound"
 
        # rc* files in /etc/
        # XXX: at least rc.conf and rc.local shouldn't be updated. PR/54741



Home | Main Index | Thread Index | Old Index