3 # Copyright 2021-2023 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 scriptdir=$(dirname "$0")
25 . $scriptdir/mkgitrel.gcfg
27 force= && case $1 in --force) force=$1; shift;; esac
33 . $scriptdir/mkgitrel.setprev &&
35 for up in linus stable; do
36 git rev-parse --verify -q $up/v$rup && break
39 git verify-tag $up/v$rup &&
41 { test -d scripts/v$rel ||
42 git worktree add --detach scripts/v$rel scripts/$cbr
45 case $(sed -n 's,^kver=\(.*\) extra=\(.*\),\1-gnu\2,p' \
46 scripts/v$rel/deblob-$cbr) in
47 "$cbr$(echo $rel | sed -n 's,.*\(-gnu\),\1,p')") ;;
48 *) echo $rel mismatches release implied by scripts/v$rel/deblob-$cbr >&2
49 echo "$cbr$(echo $rel | sed -n 's,.*\(-gnu\),\1,p')" vs \
50 $(sed -n 's,^kver=\(.*\) extra=\(.*\),\1-gnu\2,p' \
51 scripts/v$rel/deblob-$cbr) >&2
55 git worktree add --detach sources/v$rel $up/v$rup &&
57 git worktree add --detach logs/v$rel public/logs/v$prevn &&
59 (cd logs/v$rel && git rm -f linux-*) &&
61 if (cd sources/v$rel && ../../scripts/v$rel/deblob-$cbr $force) \
62 >& logs/v$rel/linux-libre-$rel.log; then
65 grep -i error logs/v$rel/linux-libre-$rel.log > linux-libre-$rel.check
66 success=false; continue
71 git commit -m "GNU Linux-libre v$rel incremental" -a &&
75 . $scriptdir/mkgitrel.setdate &&
79 git reset --soft -q public/sources/v$prevn &&
80 git commit --amend --reset-author -S$key \
81 -m "GNU Linux-libre $rel" &&
82 git tag -m "GNU Linux-libre $rel" -s -u $key sources/v$rel &&
84 git reset --hard incr/v$rel^ &&
85 { git merge --no-commit incr/v$prevn || :; } &&
86 git diff incr/v$rel > ../../linux-libre-$rel.patckT &&
87 mv -v ../../linux-libre-$rel.patckT ../../linux-libre-$rel.patck
90 git archive --format tar --prefix=linux-$rup/ -o linux-libre-$rel.tar sources/v$rel &&
91 gpg --armor --detach-sign linux-libre-$rel.tar &&
92 mv linux-libre-$rel.tar.asc logs/v$rel/linux-libre-$rel.tar.sign &&
94 for f in linux-libre-; do
95 if cmp logs/v$rel/$f$rel.log $reldir/$prevn/$f$prevn.log; then
96 ln -vf $reldir/$prevn/$f$prevn.log logs/v$rel/$f$rel.log &&
97 ln -vf $reldir/$prevn/$f$prevn.log.sign logs/v$rel/$f$rel.log.sign
99 gpg --armor --detach-sign logs/v$rel/$f$rel.log &&
100 mv -v logs/v$rel/$f$rel.log.asc logs/v$rel/$f$rel.log.sign
107 git commit --amend --reset-author -S$key -m "GNU Linux-libre $rel logs" &&
108 git tag -m "GNU Linux-libre $rel logs" -s -u $key logs/v$rel
111 git diff --src-prefix=linux-libre-$prev0/ --dst-prefix=linux-libre-$rel/ \
112 public/sources/v$prev0 sources/v$rel -- > patch-$prev0-$rel &&
114 if test "$prev0" != "$prevn"; then
115 git diff --src-prefix=linux-libre-$prevn/ --dst-prefix=linux-libre-$rel/ \
116 public/sources/v$prevn sources/v$rel -- > patch-$prevn-$rel
119 { scripts/v$rel/deblob-check --use-awk linux-libre-$rel.tar ||
120 scripts/v$rel/deblob-check --use-awk -C linux-libre-$rel.tar \
121 > linux-libre-$rel.check ||
122 { success=false; continue; }; } &&
124 if test -n "$force"; then
125 echo --force is for testing only >> linux-libre-$rel.check
131 echo something went wrong > linux-libre-$rel.check