3 # Copyright (C) 2012 Karel Zak <kzak@redhat.com>
5 # Usage: ko-release-gen [<directory>]
7 # This script prepares a new release for publishing on kernel.org. The
8 # hierarchy of release files is created in the <directory> (default directory
9 # is "kernel.org"). Use case:
13 # tools/ko-release-gen
14 # tools/ko-release-push
17 cd "$(git rev-parse --show-toplevel)" ||
{
18 echo "error: failed to chdir to git root"
22 [ -f ".version" ] || \
23 echo "error: cannot found version file (call make distcheck)"
25 VERSION
=$
(cat .version
)
26 VERSION_MAJOR
=$
(echo $VERSION |
sed 's/-rc[0-9]//; s/\(.*\..*\)\..*/\1/')
27 VERSION_DOCS
=$
(echo $VERSION |
sed 's/-rc[0-9]//')
28 DISTDIR
=${1:-"kernel.org"}/v
${VERSION_MAJOR}
30 GPG_PROG
=${GPG_PROG:-"gpg"}
31 GPG_CMD
="$GPG_PROG --use-agent --armor --detach-sign --quiet"
40 local name
=$
(basename $1)
41 local subdir
=$DISTDIR/${2:-""}
44 cp $src $subdir || die
"$src: copy failed"
46 [ -f $subdir/$name ] || die
"$name not found"
47 echo -n " $subdir/$name ..."
51 local sig
=$
(echo "$name" |
sed 's/\.tar\.xz/.tar.sign/')
52 xz
-d -c $subdir/$name |
$GPG_CMD --output $subdir/$sig
55 local sig
=$
(echo "$name" |
sed 's/\.tar\.gz/.tar.sign/')
56 gzip -d -c $subdir/$name |
$GPG_CMD --output $subdir/$sig
59 local sig
=$
(echo "$name" |
sed 's/\.tar\.bz2/.tar.sign/')
60 bzip2 -d -c $subdir/$name |
$GPG_CMD --output $subdir/$sig
63 local sig
="${name}.sign"
64 cat $subdir/$name |
$GPG_CMD --output $subdir/$sig
71 local src
="$1" # source dir
72 local tgt
="$2" # target dir
74 for fl
in $
(ls $src/*.html
$src/*.css
$src/*.png
); do
81 eval $
(gpg-agent
--daemon)
83 add_file util-linux-
${VERSION}.
tar.xz
84 add_file v
${VERSION}-ChangeLog
85 add_file Documentation
/releases
/v
${VERSION_DOCS}-ReleaseNotes
86 add_html_dir libmount
/docs
/html libmount-docs
87 add_html_dir libblkid
/docs
/html libblkid-docs
88 add_html_dir libsmartcols
/docs
/html libsmartcols-docs
89 add_html_dir libfdisk
/docs
/html libfdisk-docs