git://linux-libre.fsfla.org/releases.git
Raw File
Tip revision: b180bdcffab5c48ef1295443fd1a701285a36147 authored by Freedo on 23 May 2024, 12:52:33 UTC
make sure python and gawk are available
Tip revision: b180bdc
mkgitrel.pub
#! /bin/bash

# Copyright 2021-2023 Alexandre Oliva <lxoliva@fsfla.org>
#
# 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 &&

. $scriptdir/mkgitrel.setdate &&

if test -f linux-libre-$rel.check; then
    echo linux-libre-$rel.check exists, abandoning this release
    git tag -d incr/v$rel logs/v$rel sources/v$rel |&
      tee -a linux-libre-$rel.dtags
    continue
fi &&

while test -f linux-libre-$rel.patck && test ! -f linux-libre-$rel.check; do
  echo please verify linux-libre-$rel.patck and move it away to complete the release
  sleep 30
done &&

# Look for .check again, maybe it was created manually while we waited
# for .patck to be removed.  In this case, we have to duplicate the
# cleanups that .rel would have already done.
if test -f linux-libre-$rel.check; then
    echo linux-libre-$rel.check exists, abandoning this release
    git tag -d incr/v$rel logs/v$rel sources/v$rel |&
      tee -a linux-libre-$rel.dtags
    git worktree remove logs/v$rel
    git worktree remove --force sources/v$rel
    continue
fi &&

(
  cd scripts/v$rel &&
  { { git reset --soft -q scripts/$cbr &&
      otop=$(git rev-parse --verify -q HEAD); } ||
    echo $rel | grep -q -e -rc; } &&
  { git commit -a -S$key -m "GNU Linux-libre $rel scripts" ||
    if git status -su | grep .; then
      success=false
      continue
    fi; } &&
  case $rup:$(git rev-parse --verify -q HEAD) in
  *-rc*:* | "$cbr":*) forcetag=: ;;
  *:"$otop") forcetag=false ;;
  *) forcetag=: ;;
  esac &&
  if $forcetag; then
    git tag -m "GNU Linux-libre $rel scripts" -s -u $key \
	-f \
      scripts/v$rel &&
    git checkout scripts/$cbr &&
    git reset --hard scripts/v$rel &&
    git checkout HEAD
  fi
) &&

for x in scripts sources logs; do
  if git rev-parse --verify -q $x/v$rel > /dev/null ; then
    git tag public/$x/v$rel $x/v$rel &&
    git tag -d $x/v$rel
  fi
done &&

git worktree remove --force sources/v$rel &&

continue

success=false

done &&

: $success
back to top