Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/postinstall make the script MI again (same across a...



details:   https://anonhg.NetBSD.org/src/rev/d199ff5f6526
branches:  trunk
changeset: 451994:d199ff5f6526
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jun 14 01:54:16 2019 +0000

description:
make the script MI again (same across all archs)

diffstat:

 usr.sbin/postinstall/Makefile       |   6 +++---
 usr.sbin/postinstall/postinstall.in |  23 ++++++++++++++++++-----
 2 files changed, 21 insertions(+), 8 deletions(-)

diffs (80 lines):

diff -r 073164b48cbe -r d199ff5f6526 usr.sbin/postinstall/Makefile
--- a/usr.sbin/postinstall/Makefile     Fri Jun 14 01:06:33 2019 +0000
+++ b/usr.sbin/postinstall/Makefile     Fri Jun 14 01:54:16 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2019/06/14 01:06:33 christos Exp $
+# $NetBSD: Makefile,v 1.3 2019/06/14 01:54:16 christos Exp $
 
 .include <bsd.own.mk>
 
@@ -9,8 +9,8 @@
 FILESMODE=     ${BINMODE}
 FILESBUILD=    yes
 
-ARCHSUBDIRS    != ${MAKE} -f ${NETBSDSRCDIR}/compat/archdirs.mk \
-       ACTIVE_CC=clang -V ARCHDIR_SUBDIR | ${TOOL_SED} -e 's@[a-z0-9_]*/@@g'
+ARCHSUBDIRS    != ${TOOL_SED} -n '/ARCHDIR_SUBDIR/s/[[:space:]]//gp' \
+       ${NETBSDSRCDIR}/compat/archdirs.mk
 
 .SUFFIXES: .in
 .in:
diff -r 073164b48cbe -r d199ff5f6526 usr.sbin/postinstall/postinstall.in
--- a/usr.sbin/postinstall/postinstall.in       Fri Jun 14 01:06:33 2019 +0000
+++ b/usr.sbin/postinstall/postinstall.in       Fri Jun 14 01:54:16 2019 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.1 2019/06/14 01:06:33 christos Exp $
+# $NetBSD: postinstall.in,v 1.2 2019/06/14 01:54:16 christos Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -2187,11 +2187,17 @@
        return ${failed}
 }
 
-getarchsubdirs() {
+listarchsubdirs() {
        if ! $SOURCEMODE; then
                echo "@ARCHSUBDIRS@"
-               return
+       else
+               ${SED} -n -e '/ARCHDIR_SUBDIR/s/[[:space:]]//gp' \
+                   ${SRC_DIR}/compat/archdirs.mk 
        fi
+}
+
+
+getarchsubdirs() {
        local m
        case ${MACHINE_ARCH} in
        *arm*|*aarch64*)        m=arm;;
@@ -2199,12 +2205,14 @@
        *)                      m=${MACHINE_ARCH};;
        esac
 
-       ${SED} -n -e "/[=[:space:]]${m}/s@.*[=[:space:]]${m}/\(.*\)@\1@p" \
-           ${SRC_DIR}/compat/archdirs.mk | ${SORT} -u
+       for i in $(listarchsubdirs); do
+               echo $i
+       done | ${SORT} -u | ${SED} -n -e "/=${m}/s@.*=${m}/\(.*\)@\1@p"
 }
 
 getcompatlibdirs() {
        for i in $(getarchsubdirs); do
+               echo $i 1>&2
                if [ -d /usr/lib/$i ]; then
                        echo /usr/lib/$i
                fi
@@ -2539,6 +2547,11 @@
        esac
 }
 
+if [ -n "$POSTINSTALL_FUNCTION" ]; then
+       eval "$POSTINSTALL_FUNCTION"
+       exit 0
+fi
+
 # defaults
 #
 PROGNAME="${0##*/}"



Home | Main Index | Thread Index | Old Index