From d16ca92b5ab4229e210ca9a6a94c2599f55a7266 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Tue, 20 Jul 2010 05:35:29 +0000 Subject: [PATCH] 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@ --- usr.sbin/sysmerge/sysmerge.sh | 12 +++++------- 1 file 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 # Copyright (c) 2008, 2009, 2010 Antoine Jacoutot @@ -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 -- 2.20.1