Module Name:    src
Committed By:   christos
Date:           Fri Jun 14 01:54:16 UTC 2019

Modified Files:
        src/usr.sbin/postinstall: Makefile postinstall.in

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


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/postinstall/Makefile
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/postinstall/postinstall.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/postinstall/Makefile
diff -u src/usr.sbin/postinstall/Makefile:1.2 src/usr.sbin/postinstall/Makefile:1.3
--- src/usr.sbin/postinstall/Makefile:1.2	Thu Jun 13 21:06:33 2019
+++ src/usr.sbin/postinstall/Makefile	Thu Jun 13 21:54:16 2019
@@ -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 @@ FILESDIR=	/usr/sbin
 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:

Index: src/usr.sbin/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.1 src/usr.sbin/postinstall/postinstall.in:1.2
--- src/usr.sbin/postinstall/postinstall.in:1.1	Thu Jun 13 21:06:33 2019
+++ src/usr.sbin/postinstall/postinstall.in	Thu Jun 13 21:54:16 2019
@@ -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 @@ do_obsolete_stand()
 	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 @@ getarchsubdirs() {
 	*)			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 @@ _Fix_me_
 	esac
 }
 
+if [ -n "$POSTINSTALL_FUNCTION" ]; then
+	eval "$POSTINSTALL_FUNCTION"
+	exit 0
+fi
+
 # defaults
 #
 PROGNAME="${0##*/}"

Reply via email to