summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/install.sub17
1 files changed, 8 insertions, 9 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index a2add06a7ee..3914a496046 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.1138 2019/08/13 07:47:40 kn Exp $
+# $OpenBSD: install.sub,v 1.1139 2019/08/14 19:32:41 naddy Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -2860,14 +2860,13 @@ __EOT
}
clean_old() {
- if [[ -f /mnt/usr/bin/gcc ]]; then
- rm -rf -- `ls -d /mnt/usr/lib/gcc-lib/* | grep -v ${VNAME}$`
- fi
- if [[ -f /mnt/usr/bin/clang ]]; then
- CVER=$(cd /mnt/usr/lib/clang && ls -r | sed -e 1q)
- rm -rf -- `ls -d /mnt/usr/lib/clang/* | grep -v "${CVER}$"`
- fi
- rm -rf /var/syspatch/*
+ local _cver
+
+ rm -rf /mnt/usr/lib/gcc-lib/!(*$VNAME)
+ set -A _cver -- /mnt/usr/lib/clang/* &&
+ unset _cver[${#_cver[@]}-1] &&
+ rm -rf "${_cver[@]}"
+ rm -rf /mnt/var/syspatch/*
}
do_autoinstall() {