remove obsolete library files for all the "compat" subdirs not just amd64

and sparc64.
This commit is contained in:
christos 2019-06-13 21:20:05 +00:00
parent f55ccae981
commit add5ce28c0
1 changed files with 27 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: postinstall,v 1.231 2019/06/13 20:53:33 christos Exp $
# $NetBSD: postinstall,v 1.232 2019/06/13 21:20:05 christos Exp $
#
# Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
# All rights reserved.
@ -2187,6 +2187,29 @@ do_obsolete_stand()
return ${failed}
}
getarchsubdirs() {
if ! $SOURCEMODE; then
return
fi
local m
case ${MACHINE_ARCH} in
*arm*|*aarch64*) m=arm;;
x86_64) m=amd64;;
*) m=${MACHINE_ARCH};;
esac
${SED} -n -e "/[=[:space:]]${m}/s@.*[=[:space:]]${m}/\(.*\)@\1@p" \
${SRC_DIR}/compat/archdirs.mk | ${SORT} -u
}
getcompatlibdirs() {
for i in $(getarchsubdirs); do
if [ -d /usr/lib/$i ]; then
echo /usr/lib/$i
fi
done
}
#
# obsolete
# (this item is last to allow other items to move obsolete files)
@ -2207,8 +2230,9 @@ do_obsolete()
obsolete_libs /usr/lib/i18n
obsolete_libs /usr/X11R6/lib
obsolete_libs /usr/X11R7/lib
[ "$MACHINE" = "amd64" ] && obsolete_libs /usr/lib/i386
[ "$MACHINE" = "sparc64" ] && obsolete_libs /usr/lib/sparc
for i in $(getcompatlibdirs); do
obsolete_libs $i
done
) | obsolete_paths "${op}"
failed=$(( ${failed} + $? ))