3 # Copyright 2021 Alexandre Oliva <lxoliva@fsfla.org>
5 # This program is part of GNU Linux-libre, a GNU project that
6 # publishes scripts to clean up Linux so as to make it suitable for
7 # use in the GNU Project and in Free System Distributions.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
25 # This is a one-shot script that we used when transitioning to
26 # git-based releases. IIRC it double-checked scripts and tarballs
27 # against the preexisting git repo from Jason Self, and added our own
31 archive=$HOME/linux-libre/releases # $(ls -d /media/p0?/linux-libre-releases)
32 key=474402C8C582DAFBE389C427BCB7CF877E7D47A7
33 pubase=public/logs/v5.6-gnu
41 rup=${rel%%-[gl][ni][ub]*}
43 git rev-parse --verify -q incr/v$rel &&
44 git rev-parse --verify -q public/sources/v$rel &&
45 git rev-parse --verify -q public/logs/v$rel &&
48 (if test ! -d $archive/$rel; then
49 echo $archive/$rel/ does not exist >& 2
53 tb=$archive/$rel/linux-libre-$rel &&
57 tagid=$(git rev-parse $tag) &&
58 noteid=$(echo $tagid | sed 's,^..,&/,') &&
59 git rev-parse --verify -q stable/v$rup &&
61 DATE=$(git cat-file -p $tagid |
62 gawk '/^(author|tagger)/ {
63 print strftime(PROCINFO["strftime"], $(NF-1))
65 export GIT_COMMITTER_DATE=$DATE GIT_AUTHOR_DATE=$DATE &&
68 test -f notes/logs/$noteid &&
69 test -f notes/tars/$noteid &&
70 diff -b $tb.log notes/logs/$noteid &&
72 git archive --format tar --prefix=linux-libre-$rel/ $tag |
73 gpg -q --verify notes/tars/$noteid - &&
75 git worktree add --detach log-$rel $pubase &&
79 cp -p $tb.log $tb.tar.sign . &&
80 cp ../notes/tars/$noteid $(basename $tb).git.tar.sign &&
82 git commit --amend --reset-author -S$key -m "GNU Linux-libre $rel logs" &&
85 gpg -q --verify $tar.sign &&
87 git worktree add --detach $tmp/$trd master &&
94 if git status -su | grep .; then
98 git reset --soft stable/v$rup &&
99 git commit -m "GNU Linux-libre $rel incremental" &&
101 git tag -f incr/v$rel &&
103 git fetch file://$(pwd) refs/tags/$tag:refs/tags/public/sources/v$rel
106 git worktree remove $tmp/$trd &&
109 git tag -f -m "GNU Linux-libre $rel logs" -s -u $key public/logs/v$rel &&
111 git worktree remove log-$rel
113 ) || { echo $tag failed >&2; success=false; }