Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 90 lines (73 sloc) 2.053 kb
# Copyright (C) 2012 Karel Zak <>
# Usage: ko-release-gen [<directory>]
# This script prepares a new release for publishing on The
# hierarchy of release files is created in the <directory> (default directory
# is ""). Use case:
# make distcheck
# make changelog
# tools/ko-release-gen
# tools/ko-release-push
cd "$(git rev-parse --show-toplevel)" || {
echo "error: failed to chdir to git root"
exit 1
[ -f ".version" ] || \
echo "error: cannot found version file (call make distcheck)"
VERSION=$(cat .version)
VERSION_MAJOR=$(echo $VERSION | sed 's/-rc[0-9]//; s/\(.*\..*\)\..*/\1/')
VERSION_DOCS=$(echo $VERSION | sed 's/-rc[0-9]//')
GPG_CMD="gpg --use-agent --armor --detach-sign --quiet"
die() {
echo $1
exit 1
add_file() {
local src="$1"
local name=$(basename $1)
local subdir=$DISTDIR/${2:-""}
mkdir -p $subdir
cp $src $subdir || die "$src: copy failed"
[ -f $subdir/$name ] || die "$name not found"
echo -n " $subdir/$name ..."
case "$name" in
local sig=$(echo "$name" | sed 's/\.tar\.xz/.tar.sign/')
xz -d -c $subdir/$name | $GPG_CMD --output $subdir/$sig
local sig=$(echo "$name" | sed 's/\.tar\.gz/.tar.sign/')
gzip -d -c $subdir/$name | $GPG_CMD --output $subdir/$sig
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
echo " OK "
add_html_dir() {
local src="$1" # source dir
local tgt="$2" # target dir
for fl in $(ls $src/*.html $src/*.css $src/*.png); do
add_file $fl $tgt
rm -rf $DISTDIR
eval $(gpg-agent --daemon)
add_file util-linux-${VERSION}.tar.xz
add_file v${VERSION}-ChangeLog
add_file Documentation/releases/v${VERSION_DOCS}-ReleaseNotes
add_html_dir libmount/docs/html libmount-docs
add_html_dir libblkid/docs/html libblkid-docs
killall gpg-agent
Jump to Line
Something went wrong with that request. Please try again.