Author: waldi Date: Sat Oct 14 13:53:38 2006 New Revision: 361 Modified: trunk/scripts/hg2dist-common.sh Log: /scripts/hg2dist-common.sh: Update. Modified: trunk/scripts/hg2dist-common.sh =============================================================================--- trunk/scripts/hg2dist-common.sh (original) +++ trunk/scripts/hg2dist-common.sh Sat Oct 14 13:53:38 2006 @@ -2,6 +2,7 @@ HG=$(which hg) HGDIR=$1 +OVERRIDE_VERSION=$2 if [ ! -x $HG ]; then echo "hg must be installed" @@ -9,25 +10,43 @@ fi if [ ! -d "$HGDIR" ] && [ ! -d "$HGDIR/.hg" ]; then - echo "Usage: $0 <xen-hg-dir>" + echo "Usage: $0 <xen-hg-dir> [overwrite-major overwrite-version]" exit 1 fi - - -eval $(env -i -- make -f - version <<EOF +if [ "$OVERRIDE_VERSION" ]; then + VERSION=$OVERRIDE_VERSION +else + eval $(env -i -- make -f - version <<EOF include $HGDIR/xen/Makefile +ifeq (\$(XEN_EXTRAVERSION),-unstable) +MAJOR = unstable +else +MAJOR = \$(XEN_VERSION).\$(XEN_SUBVERSION) +endif + HASH = \$(shell cd $HGDIR; $HG id | awk ''{ print \$\$1}'') CHANGESET = \$(shell cd $HGDIR; $HG log -r \$(HASH) | head -n 1 | sed -e ''s/ //g;'' | cut -d: -f2) -VERSION = \$(XEN_VERSION).\$(XEN_SUBVERSION)+hg\$(CHANGESET) +ifneq (\$(MAJOR),unstable) +RELEASE_CHG = \$(shell cd $HGDIR; $HG tags | perl -ne ''BEGIN { \$\$done = 0; } /RELEASE-([-0-9.]+) +(\d+):/; if (\$\$1 and \$\$2 <= ''\$(CHANGESET)'' and not \$\$done) { print "\$\$2\n"; \$\$done = 1; }'') +endif + +ifeq (\$(RELEASE_CHG),\$(CHANGESET)) +VERSION = \$(XEN_FULLVERSION) +else +VERSION = \$(XEN_FULLVERSION)+hg\$(CHANGESET) +endif PHONY: version version: - @echo DESTDIR="xen-common-\$(VERSION)" - @echo DESTTAR="xen-common_\$(VERSION).orig.tar.gz" + @echo VERSION="\$(VERSION)" EOF) +fi + +DESTDIR="xen-common-${VERSION}" +DESTTAR="xen-common_${VERSION}.orig.tar.gz" if [ -d $DESTDIR ]; then echo "Destination directory $DESTDIR already exists"