From e86ad3801e49216419ca1b67e04c4e2a7b570676 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 21 Feb 2014 08:00:37 +1100 Subject: [PATCH] update kit.sh from master --- util/kit.sh | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/util/kit.sh b/util/kit.sh index 5c4cd91886..ac139a4e65 100644 --- a/util/kit.sh +++ b/util/kit.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2004, 2007-2010, 2012, 2013 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2007-2010, 2012-2014 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2000-2003 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any @@ -92,21 +92,19 @@ test -f $verdir/version || { rm $verdir/version rmdir $verdir +shorthash=`git ls-remote $repo refs/heads/$tag | cut -c1-8` +if [ -z "$shorthash" ]; then + shorthash=`git ls-remote $repo refs/tags/$tag | cut -c1-8` +fi +if [ -z "$shorthash" ]; then + echo "Unable to determine hash for $tag, aborting." + exit 1 +fi + if $snapshot then - set `date -u +'%Y%m%d%H%M%S %Y/%m/%d %H:%M:%S UTC'` - dstamp=$1 RELEASETYPE=s - RELEASEVER=${dstamp}${releasetag} - shift - case $tag in - master) - tag="$@" - ;; - *) - tag="$@" - ;; - esac + RELEASEVER=${shorthash} fi version=${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS} @@ -123,14 +121,6 @@ test ! -d $topdir || { mkdir $topdir || exit 1 git archive --format=tar $remote $tag | ( cd $topdir; tar xf -) -shorthash=`git ls-remote $repo refs/heads/$tag | cut -c1-8` -if [ -z "$shorthash" ]; then - shorthash=`git ls-remote $repo refs/tags/$tag | cut -c1-8` -fi -if [ -z "$shorthash" ]; then - echo "Unable to determine hash for $tag, aborting." - exit 1 -fi cd $topdir || exit 1 @@ -159,8 +149,8 @@ rm -rf TODO EXCLUDED conftools doc/design doc/dev doc/draft doc/expired \ lib/lwres/man/resolver.5 contrib/zkt/doc/rfc5011.txt \ bin/tests/system/relay lib/cfg -# Remove everything but mksymtbl.pl from util -find util -name mksymtbl.pl -prune -o -type f -print | xargs rm -f +# Remove everything but mksymtbl.pl and bindkeys.pl from util +find util -name bindkeys.pl -o -name mksymtbl.pl -prune -o -type f -print | xargs rm -f find util -depth -type d -print | xargs rmdir 2>/dev/null # Remove all .gitignore files