]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tools/ko-release-push
3 # Copyright (C) 2012 Karel Zak <kzak@redhat.com>
5 # Usage: ko-release-push [<directory> [<version>]]
7 # This script pushs files from <directory>/v<version> to kernel.org. The
8 # default <directory> is "kernel.org" and the default <version> is the current
11 # The <directory>/v<version> files should be generated by ko-release-gen script.
14 cd "$(git rev-parse --show-toplevel)" ||
{
15 echo "error: failed to chdir to git root"
19 [ -f ".version" ] || \
20 echo "error: cannot found version file (call make distcheck)"
22 VERSION
=${2:-$(cat .version)}
23 VERSION_MAJOR
=$
(echo $VERSION |
sed 's/-rc[0-9]//; s/\(.*\..*\)\..*/\1/')
24 BASEDIR
=${1:-"kernel.org"}
25 DISTDIR
="${BASEDIR}/v${VERSION_MAJOR}"
27 KO_DIR
="/pub/linux/utils/util-linux/v${VERSION_MAJOR}"
40 if [ -f ${fl}.xz
]; then fl
=${fl}.xz
41 elif [ -f ${fl}.gz
]; then fl
=${fl}.gz
42 elif [ -f ${fl}.bz2
]; then fl
=${fl}.bz2
43 else die
"cannot found original file for $sig"
47 fl
=$
(echo "$sig" |
sed 's/\.sign//')
51 echo -n " PUSH $fl ..."
52 kup put
$fl $sig ${KO_DIR}/${fl##${DISTDIR}/}
56 [ -d "$DISTDIR" ] || die
"$DISTDIR: Not such directory"
58 FILES
=$
(find $DISTDIR -name "*.sign" |
sort)
59 DIRS
=$
(for f
in $FILES; do echo $
(dirname ${KO_DIR}/${f##${DISTDIR}/}); done |
sort -u)
62 echo -n " MKDIR $d ..."