#! /bin/bash # Copyright 2021-2023 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 scriptdir=$(dirname "$0") . $scriptdir/mkgitrel.gcfg success=: for rel do . $scriptdir/mkgitrel.setprev && if test -f linux-libre-$rel.check; then success=false git worktree remove logs/v$rel git worktree remove --force sources/v$rel continue fi && . $scriptdir/mkgitrel.setdate && plist="patch-$prev0-$rel" && if test "$prev0" != "$prevn"; then plist="$plist patch-$prevn-$rel" fi && list="linux-libre-$rel.tar $plist" && bzip2 -k9 $list && xz -k9 $list && lzip -k9s64MiB $list && mkdir -v $rel && for f in $(ls scripts/v$rel); do if cmp scripts/v$rel/$f $reldir/$prevn/$f; then gpg --verify $reldir/$prevn/$f.sign && ln -v $reldir/$prevn/$f $reldir/$prevn/$f.sign $rel/ else ln -v scripts/v$rel/$f $rel/ && gpg --armor --detach-sign $rel/$f && mv -v $rel/$f.asc $rel/$f.sign fi done && ln -v logs/v$rel/linux-libre-$rel.* $rel/ && for f in $plist; do gpg --armor --detach-sign $f && mv -v $f.asc $rel/$f.sign done && for ext in .bz2 .xz .lz; do for f in $list; do mv -v $f$ext $rel/ && gpg --armor --detach-sign $rel/$f$ext && mv -v $rel/$f$ext.asc $rel/$f$ext.sign done done && rm -vf $list && mv -v $rel $reldir/$rel && ln -snfv $rel $reldir/LATEST-$cbr.N && if test "$rup" = "$cbr"; then ln -nfv $reldir/LATEST-$cbr.N $reldir/LATEST-$cbr.0 && ln -nfv $reldir/LATEST-$cbr.N $reldir/LATEST-${cbr%.*}.N elif test -n "$prevbase" && test ! -h $reldir/LATEST-$cbr.0; then ln -nfv $reldir/LATEST-$prevbase.N $reldir/LATEST-$cbr.0 fi && git worktree remove logs/v$rel && git worktree remove scripts/v$rel && continue success=false done && $success