diff options
author | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2010-07-20 05:35:30 +0000 |
---|---|---|
committer | Antoine Jacoutot <ajacoutot@cvs.openbsd.org> | 2010-07-20 05:35:30 +0000 |
commit | 488e530da000430439848d0549d5abf330b72fd5 (patch) | |
tree | 9d901ea5fc5984fa11191484909938b5ac4e77af /usr.sbin | |
parent | 858c4da6fc2a4057b97f205edeb8467296126848 (diff) |
Instead of checking for the *etcXX.tgz filename, check whether the
tarball contains ./var/db/sysmerge/etcsum or ./var/db/sysmerge/xetcsum.
First, it's more correct and second it allows people to rename the sets
without sysmerge bailing out.
feature requested and tested by oga@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sysmerge/sysmerge.sh | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/sysmerge/sysmerge.sh b/usr.sbin/sysmerge/sysmerge.sh index bca6d8775fa..54520a8133e 100644 --- a/usr.sbin/sysmerge/sysmerge.sh +++ b/usr.sbin/sysmerge/sysmerge.sh @@ -1,6 +1,6 @@ #!/bin/ksh - # -# $OpenBSD: sysmerge.sh,v 1.61 2010/07/17 06:47:13 ajacoutot Exp $ +# $OpenBSD: sysmerge.sh,v 1.62 2010/07/20 05:35:29 ajacoutot Exp $ # # Copyright (c) 1998-2003 Douglas Barton <DougB@FreeBSD.org> # Copyright (c) 2008, 2009, 2010 Antoine Jacoutot <ajacoutot@openbsd.org> @@ -651,9 +651,8 @@ while getopts bds:x: arg; do s) if [ -f "${OPTARG}/etc/Makefile" ]; then SRCDIR=${OPTARG} - elif [ -f "${OPTARG}" ] && echo -n ${OPTARG} | \ - awk -F/ '{print $NF}' | \ - grep '^etc[0-9][0-9]\.tgz$' > /dev/null 2>&1 ; then + elif [ -f "${OPTARG}" ] && \ + tar tzf ${OPTARG} ./var/db/sysmerge/etcsum > /dev/null 2>&1 ; then TGZ=${OPTARG} elif echo ${OPTARG} | \ grep -qE '^(http|ftp)://.*/etc[0-9][0-9]\.tgz$'; then @@ -669,9 +668,8 @@ while getopts bds:x: arg; do fi ;; x) - if [ -f "${OPTARG}" ] && echo -n ${OPTARG} | \ - awk -F/ '{print $NF}' | \ - grep '^xetc[0-9][0-9]\.tgz$' > /dev/null 2>&1 ; then + if [ -f "${OPTARG}" ] && \ + tar tzf ${OPTARG} ./var/db/sysmerge/xetcsum > /dev/null 2>&1 ; then \ XTGZ=${OPTARG} elif echo ${OPTARG} | \ grep -qE '^(http|ftp)://.*/xetc[0-9][0-9]\.tgz$'; then |