From: Alexandre Oliva Date: Wed, 29 Jul 2020 13:53:26 +0000 (-0400) Subject: Start git-tracking the release packaging and checking scripts X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=4e16db2c9f045d00b9c93115a13a3ea22398bdb8;p=releases.git Start git-tracking the release packaging and checking scripts --- 4e16db2c9f045d00b9c93115a13a3ea22398bdb8 diff --git a/check-release b/check-release new file mode 100755 index 00000000000..0ee38f7d6f5 --- /dev/null +++ b/check-release @@ -0,0 +1,87 @@ +#! /bin/bash +archive=$HOME/linux-libre/releases # $(ls -d /media/p0?/linux-libre-releases) +key=474402C8C582DAFBE389C427BCB7CF877E7D47A7 +pubase=public/logs/v5.6-gnu +tmp=. # /tmp/prep + +success=: + +for tag +do + rel=${tag##jxself/v} + rup=${rel%%-[gl][ni][ub]*} + + git rev-parse --verify -q incr/v$rel && + git rev-parse --verify -q public/sources/v$rel && + git rev-parse --verify -q public/logs/v$rel && + continue + + (if test ! -d $archive/$rel; then + echo $archive/$rel/ does not exist >& 2 + exit 1 + fi && + + tb=$archive/$rel/linux-libre-$rel && + tar=$tb.tar.bz2 && + trd=linux-$rup && + + tagid=$(git rev-parse $tag) && + noteid=$(echo $tagid | sed 's,^..,&/,') && + git rev-parse --verify -q stable/v$rup && + + DATE=$(git cat-file -p $tagid | + gawk '/^(author|tagger)/ { + print strftime(PROCINFO["strftime"], $(NF-1)) + }') && + export GIT_COMMITTER_DATE=$DATE GIT_AUTHOR_DATE=$DATE && + + test -f $tb.log && + test -f notes/logs/$noteid && + test -f notes/tars/$noteid && + diff -b $tb.log notes/logs/$noteid && + + git archive --format tar --prefix=linux-libre-$rel/ $tag | + gpg -q --verify notes/tars/$noteid - && + + git worktree add --detach log-$rel $pubase && + + cd log-$rel && + git rm -f linux* && + cp -p $tb.log $tb.tar.sign . && + cp ../notes/tars/$noteid $(basename $tb).git.tar.sign && + git add linux* && + git commit --amend --reset-author -S$key -m "GNU Linux-libre $rel logs" && + cd .. && + + gpg -q --verify $tar.sign && + + git worktree add --detach $tmp/$trd master && + rm -f $tmp/$trd/* && + + (cd $tmp/$trd && + git reset -q $tag && + tar -xf $tar -C .. && + + if git status -su | grep .; then + exit 1 + fi && + + git reset --soft stable/v$rup && + git commit -m "GNU Linux-libre $rel incremental" && + + git tag -f incr/v$rel && + + git fetch file://$(pwd) refs/tags/$tag:refs/tags/public/sources/v$rel + ) && + + git worktree remove $tmp/$trd && + + cd log-$rel && + git tag -f -m "GNU Linux-libre $rel logs" -s -u $key public/logs/v$rel && + cd .. && + git worktree remove log-$rel + + ) || { echo $tag failed >&2; success=false; } +done + +$success diff --git a/mkgitrel b/mkgitrel new file mode 100755 index 00000000000..9ce9c054dcb --- /dev/null +++ b/mkgitrel @@ -0,0 +1,194 @@ +#! /bin/bash + +reldir=$HOME/linux-libre/releases + +key=474402C8C582DAFBE389C427BCB7CF877E7D47A7 + +success=: +for rel +do + +rup=$(echo "$rel" | sed 's,-gnu[0-9]*$,,') +cbr=$(echo "$rup" | sed 's,\(\.\|-rc\)[0-9]*$,,') + +if test -d $reldir/$rel; then + echo $reldir/$rel exists >&2 + continue +fi + +if test -h $reldir/LATEST-$cbr.0; then + prev0=$(readlink $reldir/LATEST-$cbr.0) + prevn=$(readlink $reldir/LATEST-$cbr.N) +else + cbr=$rup + prev0=$(readlink $reldir/LATEST-$cbr.0) + prevn=$(readlink $reldir/LATEST-$cbr.N) +fi + +for up in linus stable; do + git rev-parse --verify -q $up/v$rup && break +done + +git verify-tag $up/v$rup && + +{ test -d scripts/v$rel || + git worktree add --detach scripts/v$rel scripts/$cbr +} && + +git worktree add --detach sources/v$rel $up/v$rup && + +git worktree add --detach logs/v$rel public/logs/v$prevn && + +(cd logs/v$rel && git rm -f linux-*) && + +( + cd sources/v$rel && + ../../scripts/v$rel/deblob-$cbr >& ../../logs/v$rel/linux-libre-$rel.log && + git commit -m "GNU Linux-libre v$rel incremental" -a && + git tag incr/v$rel +) && + +DATE=$(git cat-file -p incr/v$rel | + gawk '/^(author|tagger)/ { + print strftime(PROCINFO["strftime"], $(NF-1)) + }') && +export GIT_COMMITTER_DATE=$DATE GIT_AUTHOR_DATE=$DATE && + +( + cd sources/v$rel && + git reset --soft -q public/sources/v$prevn && + git commit --amend --reset-author -S$key \ + -m "GNU Linux-libre $rel" && + git tag -m "GNU Linux-libre $rel" -s -u $key sources/v$rel && + + git reset --hard incr/v$rel^ && + { git merge --no-commit incr/v$prevn || :; } && + git diff incr/v$rel > ../../linux-libre-$rel.patckT && + mv -v ../../linux-libre-$rel.patckT ../../linux-libre-$rel.patck + ) && + +git archive --format tar --prefix=linux-$rup/ -o linux-libre-$rel.tar sources/v$rel && +gpg --armor --detach-sign linux-libre-$rel.tar && +mv linux-libre-$rel.tar.asc logs/v$rel/linux-libre-$rel.tar.sign && + +for f in linux-libre-; do + if cmp logs/v$rel/$f$rel.log $reldir/$prevn/$f$prevn.log; then + ln -vf $reldir/$prevn/$f$prevn.log logs/v$rel/$f$rel.log && + ln -vf $reldir/$prevn/$f$prevn.log.sign logs/v$rel/$f$rel.log.sign + else + gpg --armor --detach-sign logs/v$rel/$f$rel.log && + mv -v logs/v$rel/$f$rel.log.asc logs/v$rel/$f$rel.log.sign + fi +done && + +( + cd logs/v$rel && + git add linux* && + git commit --amend --reset-author -S$key -m "GNU Linux-libre $rel logs" && + git tag -m "GNU Linux-libre $rel logs" -s -u $key logs/v$rel +) && + +git diff --src-prefix=linux-libre-$prev0/ --dst-prefix=linux-libre-$rel/ \ + public/sources/v$prev0 sources/v$rel -- > patch-$prev0-$rel && + +if test "$prev0" != "$prevn"; then + git diff --src-prefix=linux-libre-$prevn/ --dst-prefix=linux-libre-$rel/ \ + public/sources/v$prevn sources/v$rel -- > patch-$prevn-$rel +fi && + +{ scripts/v$rel/deblob-check --use-awk linux-libre-$rel.tar || + scripts/v$rel/deblob-check --use-awk -C linux-libre-$rel.tar \ + > linux-libre-$rel.check || + { success=false; continue; }; } && + +while test -f linux-libre-$rel.patck; do + echo please verify linux-libre-$rel.patck and move it away to complete the release + sleep 30 +done && + +( + cd scripts/v$rel && + git reset --soft -q scripts/$cbr && + otop=$(git rev-parse --verify -q HEAD) && + { git commit -a -S$key -m "GNU Linux-libre $rel scripts" || + if git status -su | grep .; then + success=false + continue + fi; } && + case $rup:$(git rev-parse --verify -q HEAD) in + *-rc*:* | "$cbr":*) forcetag=: ;; + *:"$otop") forcetag=false ;; + *) forcetag=: ;; + esac && + if $forcetag; then + git tag -m "GNU Linux-libre $rel scripts" -s -u $key \ + -f \ + scripts/v$rel && + git checkout scripts/$cbr && + git reset --hard scripts/v$rel && + git checkout HEAD + fi +) && + +for x in scripts sources logs; do + if git rev-parse --verify -q $x/v$rel > /dev/null ; then + git tag public/$x/v$rel $x/v$rel && + git tag -d $x/v$rel + fi +done && + +plist="patch-$prev0-$rel" && +if test "$prev0" != "$prevn"; then + plist="$plist patch-$prevn-$rel" +fi && + +list="linux-libre-$rel.tar $plist" && + +bzip2 -k9 $list && +xz -k9 $list && +lzip -k9s64MiB $list && + +mkdir -v $rel && + +for f in $(ls scripts/v$rel); do + if cmp scripts/v$rel/$f $reldir/$prevn/$f; then + ln -v $reldir/$prevn/$f $reldir/$prevn/$f.sign $rel/ + else + ln -v scripts/v$rel/$f $rel/ && + gpg --armor --detach-sign $rel/$f && + mv -v $rel/$f.asc $rel/$f.sign + fi +done && + +ln -v logs/v$rel/linux-libre-$rel.* $rel/ && + +for f in $plist; do + gpg --armor --detach-sign $f && + mv -v $f.asc $rel/$f.sign +done && + +for ext in .bz2 .xz .lz; do + for f in $list; do + mv -v $f$ext $rel/ && + gpg --armor --detach-sign $rel/$f$ext && + mv -v $rel/$f$ext.asc $rel/$f$ext.sign + done +done && + +rm -vf $list && + +mv -v $rel $reldir/$rel && +ln -snfv $rel $reldir/LATEST-$cbr.N && +if test "$rup" = "$cbr"; then + ln -nfv $reldir/LATEST-$cbr.N $reldir/LATEST-$cbr.0 && + ln -nfv $reldir/LATEST-$cbr.N $reldir/LATEST-${cbr%.*}.N +fi && + +git worktree remove logs/v$rel && +git worktree remove scripts/v$rel && +git worktree remove --force sources/v$rel + +done + +$success +exit