]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: improve ko-release-* scripts
authorKarel Zak <kzak@redhat.com>
Thu, 19 Jan 2012 12:15:03 +0000 (13:15 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 19 Jan 2012 12:15:03 +0000 (13:15 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tools/ko-release-gen
tools/ko-release-push

index 46d140f95e647a99e15780d9c7bd36101fde28c0..b95af2ea9bd21328ffe2c897e3f71e3f328603e1 100755 (executable)
@@ -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
index 0c500ac8c0e5adb53e7fcd16fdac2855a6666921..ebeddbb632119b7420a598255f132b43c3ca521d 100755 (executable)
@@ -2,8 +2,11 @@
 #
 # Copyright (C) 2012 Karel Zak <kzak@redhat.com> 
 #
+# Usage:  ko-release-push [<directory> [<version>]]
+#
 # This script pushs files from <directory>/v<version> to kernel.org. The
-# default directory is kernel.org and <version> is the current package version.
+# default <directory> is "kernel.org" and the default <version> is the current
+# package version.
 #
 # The <directory>/v<version> 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 "
 }