Annotation of freem/scripts/fmd-setversion, revision 1.2

1.1       snw         1: #!/usr/bin/env bash
                      2: 
                      3: #
1.2     ! snw         4: #   $Id: fmd-setversion,v 1.1 2025/04/04 18:00:01 snw Exp $
1.1       snw         5: #    Set version in FreeM repository
                      6: #
                      7: #  
                      8: #   Author: Serena Willis <snw@coherent-logic.com>
                      9: #    Copyright (C) 2025 Coherent Logic Development LLC
                     10: #
                     11: #
                     12: #   This file is part of FreeM.
                     13: #
                     14: #   FreeM is free software: you can redistribute it and/or modify
                     15: #   it under the terms of the GNU Affero Public License as published by
                     16: #   the Free Software Foundation, either version 3 of the License, or
                     17: #   (at your option) any later version.
                     18: #
                     19: #   FreeM is distributed in the hope that it will be useful,
                     20: #   but WITHOUT ANY WARRANTY; without even the implied warranty of
                     21: #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     22: #   GNU Affero Public License for more details.
                     23: #
                     24: #   You should have received a copy of the GNU Affero Public License
                     25: #   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
                     26: #
1.2     ! snw        27: #   $Log: fmd-setversion,v $
        !            28: #   Revision 1.1  2025/04/04 18:00:01  snw
        !            29: #   *** empty log message ***
        !            30: #
1.1       snw        31: #
                     32: # SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
                     33: # SPDX-License-Identifier: AGPL-3.0-or-later
                     34: #
                     35: 
                     36: if [[ $# == 0 ]]
                     37: then
                     38:     echo "setversion:  must be run from 'fmd setversion'"
                     39:     exit 1
                     40: fi
                     41: 
                     42: if [[ ! -f sem.ver ]]
                     43: then
                     44:     echo "Not in the root of the FreeM repository."
                     45:     exit 1
                     46: fi
                     47: 
                     48: CURVER=$(cat sem.ver)
                     49: OLDVER=$(cat ver.old)
                     50: FMD=$1
                     51: NEWVER=$2
                     52: 
                     53: if [[ $# == 1 ]]
                     54: then
                     55:     echo "setversion:  assuming new version is \"cvs-current\""
                     56:     NEWVER="cvs-current"
                     57: fi
                     58: 
                     59: if [[ "${NEWVER}" == "--revert" ]]
                     60: then
                     61:     NEWVER="${OLDVER}"
                     62:     echo "setversion:  reverting to previous version ${NEWVER}"
                     63: fi
                     64: 
                     65: if [[ "${CURVER}" == "${NEWVER}" ]]
                     66: then
                     67:     echo "setversion:  no change"
                     68:     exit 1
                     69: fi
                     70: 
                     71: echo "setversion:  version change ${CURVER} => ${NEWVER}"
                     72: echo "setversion:  backing up old version"
                     73: cp sem.ver ver.old
                     74: 
                     75: echo "${NEWVER}" > sem.ver
                     76: 
                     77: sed -i.orig "s/${CURVER}/${NEWVER}/g" doc/freem.texi
                     78: sed -i.orig "s/${CURVER}/${NEWVER}/g" configure.ac
                     79: 
                     80: VERSTR="VERSION ${NEWVER}"
                     81: 
                     82: echo "" >> ChangeLog
                     83: echo '********************************************************************************' >> ChangeLog
                     84: echo "${VERSTR}" >> ChangeLog
                     85: echo "" >> ChangeLog
                     86: 
1.2     ! snw        87: ${FMD} log "Change version from ${CURVER} to ${NEWVER}"
1.1       snw        88: 
                     89: ${FMD} changelog ${NEWVER}
                     90: 
                     91: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>