#!/usr/bin/env bash # # $Id: fmd-setversion,v 1.4 2025/05/02 16:25:46 snw Exp $ # Set version in FreeM repository # # # Author: Serena Willis # Copyright (C) 2025 Coherent Logic Development LLC # # # This file is part of FreeM. # # FreeM is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # FreeM 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 Affero Public License for more details. # # You should have received a copy of the GNU Affero Public License # along with FreeM. If not, see . # # $Log: fmd-setversion,v $ # Revision 1.4 2025/05/02 16:25:46 snw # -m # # Revision 1.3 2025/04/06 03:38:05 snw # Prepare for adding packaging functionality to fmd # # Revision 1.2 2025/04/04 19:43:18 snw # Switch to using environment catalog to determine user and group for environment, and remove -u and -g flags from freem # # Revision 1.1 2025/04/04 18:00:01 snw # *** empty log message *** # # # SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC # SPDX-License-Identifier: AGPL-3.0-or-later # function usage() { echo echo "Sets the FreeM version in this repository" echo echo "usage:" echo echo " fmd setversion " echo " - Sets the FreeM version in this repository to " echo echo " fmd setversion --revert" echo " - Reverts to the previous FreeM version" echo exit 0 } if [[ $1 == "help" ]] then usage fi if [[ $# == 0 ]] then echo "setversion: must be run from 'fmd setversion'" exit 1 fi CURVER=$(cat sem.ver) OLDVER=$(cat ver.old) FMD=$1 NEWVER=$2 if [[ $# == 1 ]] then echo "setversion: assuming new version is \"cvs-current\"" NEWVER="cvs-current" fi if [[ "${NEWVER}" == "--revert" ]] then NEWVER="${OLDVER}" echo "setversion: reverting to previous version ${NEWVER}" fi if [[ "${CURVER}" == "${NEWVER}" ]] then echo "setversion: no change" exit 1 fi echo "setversion: version change ${CURVER} => ${NEWVER}" echo "setversion: backing up old version" cp sem.ver ver.old echo "${NEWVER}" > sem.ver sed -i.orig "s/${CURVER}/${NEWVER}/g" doc/freem.texi sed -i.orig "s/${CURVER}/${NEWVER}/g" configure.ac sed -i.orig "s/${CURVER}/${NEWVER}/g" doc/freem_conformance.1 VERSTR="VERSION ${NEWVER}" echo "" >> ChangeLog echo '********************************************************************************' >> ChangeLog echo "${VERSTR}" >> ChangeLog echo "" >> ChangeLog ${FMD} log "Change version from ${CURVER} to ${NEWVER}" ${FMD} changelog ${NEWVER}