#! /bin/bash # Copyright 2021 Alexandre Oliva # # This program is part of GNU Linux-libre, a GNU project that # publishes scripts to clean up Linux so as to make it suitable for # use in the GNU Project and in Free System Distributions. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 # USA # This is a one-shot script that we used when transitioning to # git-based releases. IIRC it double-checked scripts and tarballs # against the preexisting git repo from Jason Self, and added our own # signatures. 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