3 # pre-check to stop early in case of typos and other mistakes
5 # Copyright 2021-2023 Alexandre Oliva <lxoliva@fsfla.org>
7 # This program is part of GNU Linux-libre, a GNU project that
8 # publishes scripts to clean up Linux so as to make it suitable for
9 # use in the GNU Project and in Free System Distributions.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 3 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
26 scriptdir=$(dirname "$0")
27 . $scriptdir/mkgitrel.gcfg
33 . $scriptdir/mkgitrel.setprev &&
37 echo $rel starts with v, that is unexpected >&2
41 if test -d scripts/v$rel &&
42 git -C scripts/v$rel status | grep -q Untracked; then
43 echo scripts/v$rel exists and contains untracked files >&2
48 echo $rel does not end with -gnu, that is unexpected >&2
53 if for up in linus stable; do
54 git rev-parse --verify -q $up/v$rup && break
56 git verify-tag $up/v$rup; then
59 echo could not find a $rup tag on which to base this release >&2
64 for d in sources/v$rel logs/v$rel; do
66 echo directory $d already exists, it needs to be cleaned up first >&2
71 for f in linux-libre-$rel.check linux-libre-$rel.patck; do
73 echo warning: file $f already exists >&2
77 { test -d scripts/v$rel ||
78 git worktree add --detach scripts/v$rel scripts/$cbr
81 case $(sed -n 's,^kver=\(.*\) extra=\(.*\),\1-gnu\2,p' \
82 scripts/v$rel/deblob-$cbr) in
83 "$cbr$(echo $rel | sed -n 's,.*\(-gnu\),\1,p')") ;;
84 *) echo $rel mismatches release implied by scripts/v$rel/deblob-$cbr >&2
85 echo "$cbr$(echo $rel | sed -n 's,.*\(-gnu\),\1,p')" vs \
86 $(sed -n 's,^kver=\(.*\) extra=\(.*\),\1-gnu\2,p' \
87 scripts/v$rel/deblob-$cbr) >&2
91 for f in scripts/v$rel/.* scripts/v$rel/*; do
94 scripts/"v$rel"/.. | \
95 scripts/"v$rel"/.gitx | \
96 scripts/"v$rel"/COPYING | \
97 scripts/"v$rel"/deblob-"$cbr" | \
98 scripts/"v$rel"/deblob-check) ;;
99 *) echo unexpected file $f exists >&2