wok-current rev 5158

Up: slitaz-dev-tools (1.2) Cmd relpks for new package version
author Christophe Lincoln <pankso@slitaz.org>
date Wed Mar 24 21:44:12 2010 +0100 (2010-03-24)
parents 8fd978e98cd5
children 396eeedb83be
files slitaz-dev-tools/receipt slitaz-dev-tools/stuff/tazdev slitaz-dev-tools/stuff/tazdev.conf
line diff
     1.1 --- a/slitaz-dev-tools/receipt	Wed Mar 24 21:07:52 2010 +0100
     1.2 +++ b/slitaz-dev-tools/receipt	Wed Mar 24 21:44:12 2010 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt
     1.5  
     1.6  PACKAGE="slitaz-dev-tools"
     1.7 -VERSION="1.1"
     1.8 +VERSION="1.2"
     1.9  CATEGORY="development"
    1.10  SHORT_DESC="SliTaz developers and build host tools."
    1.11  MAINTAINER="pankso@slitaz.org"
     2.1 --- a/slitaz-dev-tools/stuff/tazdev	Wed Mar 24 21:07:52 2010 +0100
     2.2 +++ b/slitaz-dev-tools/stuff/tazdev	Wed Mar 24 21:44:12 2010 +0100
     2.3 @@ -86,10 +86,10 @@
     2.4  		USER=$USER
     2.5  	fi
     2.6  	if [ "$2" = "stable" ] || [ "$3" = "stable" ]; then
     2.7 -		REMOTE_DIR=$MIRROR_DIR/stable/
     2.8 +		REMOTE_DIR=$MIRROR_PKGS/stable/
     2.9  		LOCAL_DIR=$STABLE/packages/
    2.10  	else
    2.11 -		REMOTE_DIR=$MIRROR_DIR/cooking/
    2.12 +		REMOTE_DIR=$MIRROR_PKGS/cooking/
    2.13  		LOCAL_DIR=$COOKING/packages/
    2.14  	fi
    2.15  }
    2.16 @@ -309,8 +309,36 @@
    2.17  		check_root
    2.18  		get_version $@
    2.19  		purge_packages $1
    2.20 -		purge_sources $1
    2.21 -		;;
    2.22 +		purge_sources $1 ;;
    2.23 +	relpkg)
    2.24 +		[ -z "$MIRROR_SOURCES" ] && MIRROR_SOURCES="/var/www/slitaz/mirror/sources"
    2.25 +		if [ -z $2 ] || [ -z $3 ]; then
    2.26 +			echo -e "\nUsage: $0 relpkg package version\n"
    2.27 +			exit 0
    2.28 +		fi
    2.29 +		PACKAGE=$2
    2.30 +		VERSION=$3
    2.31 +		echo ""
    2.32 +		cd $PROJECTS/$PACKAGE
    2.33 +		# Sanity check
    2.34 +		if ! grep -q $VERSION$ .hgtags; then
    2.35 +			echo "Missing Hg tag for version: $VERSION"
    2.36 +			echo -e "You may want to: hg tag $VERSION && hg push\n"
    2.37 +			exit 0
    2.38 +		fi
    2.39 +		# Archive
    2.40 +		echo -n "Creating tarball and md5sum for: $PACKAGE-$VERSION... "
    2.41 +		hg archive -t tgz $PACKAGE-$VERSION.tar.gz
    2.42 +		md5sum $PACKAGE-$VERSION.tar.gz > $PACKAGE-$VERSION.md5
    2.43 +		echo "Done"
    2.44 +		# Upload
    2.45 +		echo -n "Do you wish to upload tarball to the mirror [N/y] ? "
    2.46 +		read upload
    2.47 +		if [ "$upload" = "y" ]; then
    2.48 +			echo "Uploading to: $MIRROR/sources/${PACKAGE#slitaz-}"
    2.49 +			scp $PACKAGE-$VERSION.tar.gz $PACKAGE-$VERSION.md5 \
    2.50 +				$USER@$MIRROR:$MIRROR_SOURCES/${PACKAGE#slitaz-}
    2.51 +		fi ;;
    2.52  	usage|*)
    2.53  		usage ;;
    2.54  esac
     3.1 --- a/slitaz-dev-tools/stuff/tazdev.conf	Wed Mar 24 21:07:52 2010 +0100
     3.2 +++ b/slitaz-dev-tools/stuff/tazdev.conf	Wed Mar 24 21:44:12 2010 +0100
     3.3 @@ -15,4 +15,5 @@
     3.4  # Main mirror to push and download (ISO, rootfs. etc).
     3.5  MIRROR="mirror.slitaz.org"
     3.6  DL_URL="http://mirror.switch.ch/ftp/mirror/slitaz"
     3.7 -MIRROR_DIR="/var/www/slitaz/mirror/packages"
     3.8 +MIRROR_PKGS="/var/www/slitaz/mirror/packages"
     3.9 +MIRROR_SOURCES="/var/www/slitaz/mirror/sources"