From abbc7b4a14287746253d47218576410879839597 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 19 Jan 2012 13:15:03 +0100 Subject: build-sys: improve ko-release-* scripts Signed-off-by: Karel Zak --- tools/ko-release-gen | 8 ++++++++ tools/ko-release-push | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/ko-release-gen b/tools/ko-release-gen index 46d140f95..b95af2ea9 100755 --- a/tools/ko-release-gen +++ b/tools/ko-release-gen @@ -49,6 +49,14 @@ function add_file { local sig=$(echo "$name" | sed 's/\.tar\.xz/.tar.sign/') xz -d -c $subdir/$name | $GPG_CMD --output $subdir/$sig ;; + *.tar.gz) + local sig=$(echo "$name" | sed 's/\.tar\.gz/.tar.sign/') + gzip -d -c $subdir/$name | $GPG_CMD --output $subdir/$sig + ;; + *.tar.bz2) + local sig=$(echo "$name" | sed 's/\.tar\.bz2/.tar.sign/') + bzip2 -d -c $subdir/$name | $GPG_CMD --output $subdir/$sig + ;; *) local sig="${name}.sign" cat $subdir/$name | $GPG_CMD --output $subdir/$sig diff --git a/tools/ko-release-push b/tools/ko-release-push index 0c500ac8c..ebeddbb63 100755 --- a/tools/ko-release-push +++ b/tools/ko-release-push @@ -2,8 +2,11 @@ # # Copyright (C) 2012 Karel Zak # +# Usage: ko-release-push [ []] +# # This script pushs files from /v to kernel.org. The -# default directory is kernel.org and is the current package version. +# default is "kernel.org" and the default is the current +# package version. # # The /v files should be generated by ko-release-gen script. # @@ -16,7 +19,7 @@ cd "$(git rev-parse --show-toplevel)" || { [ -f ".version" ] || \ echo "error: cannot found version file (call make distcheck)" -VERSION=$(cat .version) +VERSION=${2:-$(cat .version)} VERSION_MAJOR=$(echo $VERSION | sed 's/-rc[0-9]//') BASEDIR=${1:-"kernel.org"} DISTDIR="${BASEDIR}/v${VERSION_MAJOR}" @@ -33,14 +36,19 @@ function push_file { case "$sig" in *.tar.sign) - fl=$(echo "$sig" | sed 's/\.tar\.sign/.tar.xz/') + fl=${sig%%.sign} + if [ -f ${fl}.xz ]; then fl=${fl}.xz + elif [ -f ${fl}.gz ]; then fl=${fl}.gz + elif [ -f ${fl}.bz2 ]; then fl=${fl}.bz2 + else die "cannot found original file for $sig" + fi ;; *) fl=$(echo "$sig" | sed 's/\.sign//') ;; esac - echo -n " PUSH $sig ..." + echo -n " PUSH $fl ..." kup put $fl $sig ${KO_DIR}/${fl##${DISTDIR}/} echo " OK " } -- cgit v1.2.3-55-g7522