From 3f0619138956aaeda44b26e2bf6c338fe7eac8d1 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 10 May 2022 22:59:40 -0400 Subject: [PATCH] Create LATEST-X.[0N] links when running the first X-rc --- mkgitrel.cln | 18 ++++++++++++++++-- mkgitrel.pub | 18 ++++++++++++++++-- mkgitrel.rel | 20 ++++++++++++++++++-- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/mkgitrel.cln b/mkgitrel.cln index 214fdd1128e..5098b6d845f 100755 --- a/mkgitrel.cln +++ b/mkgitrel.cln @@ -45,8 +45,22 @@ elif test -h $reldir/LATEST-$rup.N; then prev0=$(readlink $reldir/LATEST-$cbr.0) prevn=$(readlink $reldir/LATEST-$cbr.N) else - echo Neither $reldir/LATEST-$cbr.0 nor $reldir/LATEST-$rup.N exist >&2 - exit 1 + case $rup in + *-rc*) + prevbase=$(echo "$cbr" | sed 's,\.[0-9]*$,,') + if test -h $reldir/LATEST-$prevbase.N; then + prev0=$(readlink $reldir/LATEST-$prevbase.N) + prevn=$prev0 + else + echo $reldir/LATEST-$prevbase.N does not exit >&2 + exit 1 + fi + ;; + *) + echo Neither $reldir/LATEST-$cbr.0 nor $reldir/LATEST-$rup.N exist >&2 + exit 1 + ;; + esac fi for up in linus stable; do diff --git a/mkgitrel.pub b/mkgitrel.pub index c851c30beaf..6c9ac901968 100755 --- a/mkgitrel.pub +++ b/mkgitrel.pub @@ -45,8 +45,22 @@ elif test -h $reldir/LATEST-$rup.N; then prev0=$(readlink $reldir/LATEST-$cbr.0) prevn=$(readlink $reldir/LATEST-$cbr.N) else - echo Neither $reldir/LATEST-$cbr.0 nor $reldir/LATEST-$rup.N exist >&2 - exit 1 + case $rup in + *-rc*) + prevbase=$(echo "$cbr" | sed 's,\.[0-9]*$,,') + if test -h $reldir/LATEST-$prevbase.N; then + prev0=$(readlink $reldir/LATEST-$prevbase.N) + prevn=$prev0 + else + echo $reldir/LATEST-$prevbase.N does not exit >&2 + exit 1 + fi + ;; + *) + echo Neither $reldir/LATEST-$cbr.0 nor $reldir/LATEST-$rup.N exist >&2 + exit 1 + ;; + esac fi DATE=$(git cat-file -p incr/v$rel | diff --git a/mkgitrel.rel b/mkgitrel.rel index 86a8028e29f..84e3c71103e 100755 --- a/mkgitrel.rel +++ b/mkgitrel.rel @@ -45,8 +45,22 @@ elif test -h $reldir/LATEST-$rup.N; then prev0=$(readlink $reldir/LATEST-$cbr.0) prevn=$(readlink $reldir/LATEST-$cbr.N) else - echo Neither $reldir/LATEST-$cbr.0 nor $reldir/LATEST-$rup.N exist >&2 - exit 1 + case $rup in + *-rc*) + prevbase=$(echo "$cbr" | sed 's,\.[0-9]*$,,') + if test -h $reldir/LATEST-$prevbase.N; then + prev0=$(readlink $reldir/LATEST-$prevbase.N) + prevn=$prev0 + else + echo $reldir/LATEST-$prevbase.N does not exit >&2 + exit 1 + fi + ;; + *) + echo Neither $reldir/LATEST-$cbr.0 nor $reldir/LATEST-$rup.N exist >&2 + exit 1 + ;; + esac fi if test -f linux-libre-$rel.check; then @@ -108,6 +122,8 @@ 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 && -- 2.31.1