]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - tools/ko-release-gen
Manual pages: Standardize on OPTIONS as section title
[thirdparty/util-linux.git] / tools / ko-release-gen
index 46d140f95e647a99e15780d9c7bd36101fde28c0..9f904d1b1fcd06d012e91b11d962b77e9720fbda 100755 (executable)
@@ -23,17 +23,19 @@ cd "$(git rev-parse --show-toplevel)" || {
        echo "error: cannot found version file (call make distcheck)"
 
 VERSION=$(cat .version)
-VERSION_MAJOR=$(echo $VERSION | sed 's/-rc[0-9]//')
+VERSION_MAJOR=$(echo $VERSION | sed 's/-rc[0-9]//; s/\(.*\..*\)\..*/\1/')
+VERSION_DOCS=$(echo $VERSION | sed 's/-rc[0-9]//')
 DISTDIR=${1:-"kernel.org"}/v${VERSION_MAJOR}
 
-GPG_CMD="gpg --use-agent --armor --detach-sign --quiet --batch"
+GPG_PROG=${GPG_PROG:-"gpg"}
+GPG_CMD="$GPG_PROG --use-agent --armor --detach-sign --quiet"
 
-function die {
+die() {
        echo $1
        exit 1
 }
 
-function add_file {
+add_file() {
        local src="$1"
        local name=$(basename $1)
        local subdir=$DISTDIR/${2:-""}
@@ -49,6 +51,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
@@ -57,20 +67,26 @@ function add_file {
        echo " OK "
 }
 
-function add_html_dir {
+add_html_dir() {
        local src="$1"          # source dir
        local tgt="$2"          # target dir
-       
-       for fl in $(ls $src/*.{html,css,png}); do
+
+       for fl in $(ls $src/*.html $src/*.css $src/*.png); do
                add_file $fl $tgt
        done
 }
 
 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_MAJOR}-ReleaseNotes
+add_file       Documentation/releases/v${VERSION_DOCS}-ReleaseNotes
 add_html_dir   libmount/docs/html libmount-docs
 add_html_dir   libblkid/docs/html libblkid-docs
+add_html_dir   libsmartcols/docs/html libsmartcols-docs
+add_html_dir   libfdisk/docs/html libfdisk-docs
+
+killall gpg-agent