From: Alexandre Oliva Date: Wed, 11 May 2022 02:59:40 +0000 (-0400) Subject: Create LATEST-X.[0N] links when running the first X-rc X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=3f0619138956aaeda44b26e2bf6c338fe7eac8d1;p=releases.git Create LATEST-X.[0N] links when running the first X-rc --- 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 &&