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
24 reldir=$HOME/linux-libre/releases
26 key=474402C8C582DAFBE389C427BCB7CF877E7D47A7
32 rup=$(echo "$rel" | sed 's,-gnu[0-9]*$,,')
33 cbr=$(echo "$rup" | sed 's,\(\.\|-rc\)[0-9]*$,,')
35 if test -d $reldir/$rel; then
36 echo $reldir/$rel exists >&2
40 if test -h $reldir/LATEST-$cbr.0; then
41 prev0=$(readlink $reldir/LATEST-$cbr.0)
42 prevn=$(readlink $reldir/LATEST-$cbr.N)
43 elif test -h $reldir/LATEST-$rup.N; then
45 prev0=$(readlink $reldir/LATEST-$cbr.0)
46 prevn=$(readlink $reldir/LATEST-$cbr.N)
48 echo Neither $reldir/LATEST-$cbr.0 nor $reldir/LATEST-$rup.N exist >&2
52 if test -f linux-libre-$rel.check; then
54 git worktree remove logs/v$rel
55 git worktree remove --force sources/v$rel
59 DATE=$(git cat-file -p incr/v$rel |
60 gawk '/^(author|tagger)/ {
61 print strftime(PROCINFO["strftime"], $(NF-1))
63 export GIT_COMMITTER_DATE=$DATE GIT_AUTHOR_DATE=$DATE &&
65 plist="patch-$prev0-$rel" &&
66 if test "$prev0" != "$prevn"; then
67 plist="$plist patch-$prevn-$rel"
70 list="linux-libre-$rel.tar $plist" &&
74 lzip -k9s64MiB $list &&
78 for f in $(ls scripts/v$rel); do
79 if cmp scripts/v$rel/$f $reldir/$prevn/$f; then
80 gpg --verify $reldir/$prevn/$f.sign &&
81 ln -v $reldir/$prevn/$f $reldir/$prevn/$f.sign $rel/
83 ln -v scripts/v$rel/$f $rel/ &&
84 gpg --armor --detach-sign $rel/$f &&
85 mv -v $rel/$f.asc $rel/$f.sign
89 ln -v logs/v$rel/linux-libre-$rel.* $rel/ &&
92 gpg --armor --detach-sign $f &&
93 mv -v $f.asc $rel/$f.sign
96 for ext in .bz2 .xz .lz; do
99 gpg --armor --detach-sign $rel/$f$ext &&
100 mv -v $rel/$f$ext.asc $rel/$f$ext.sign
106 mv -v $rel $reldir/$rel &&
107 ln -snfv $rel $reldir/LATEST-$cbr.N &&
108 if test "$rup" = "$cbr"; then
109 ln -nfv $reldir/LATEST-$cbr.N $reldir/LATEST-$cbr.0 &&
110 ln -nfv $reldir/LATEST-$cbr.N $reldir/LATEST-${cbr%.*}.N
113 git worktree remove logs/v$rel &&
114 git worktree remove scripts/v$rel