From 9b871ad249f4333b1cbc02345dc288f9e92dadcb Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 26 Apr 2022 13:42:38 -0300 Subject: [PATCH] Bump version to 3.5 and add version bumping script --- CMakeLists.txt | 3 +- bumpversion.sh | 72 ++++++++++++++++++++ src/include/86box/version.h.in | 2 +- src/include_make/86box/version.h | 10 +-- src/unix/assets/86Box.spec | 4 +- src/unix/assets/net.86box.86Box.metainfo.xml | 2 +- 6 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 bumpversion.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 85920bc10..145f92c34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ if(MUNT_EXTERNAL) endif() project(86Box - VERSION 3.4.1 + VERSION 3.5 DESCRIPTION "Emulator of x86-based systems" HOMEPAGE_URL "https://86box.net" LANGUAGES C CXX) @@ -188,6 +188,7 @@ endif() if(NOT CMAKE_PROJECT_VERSION_PATCH) set(CMAKE_PROJECT_VERSION_PATCH 0) endif() +set(EMU_VERSION_EX "3.50") if(NOT EMU_BUILD_NUM) set(EMU_BUILD_NUM 0) endif() diff --git a/bumpversion.sh b/bumpversion.sh new file mode 100644 index 000000000..dc4cd1624 --- /dev/null +++ b/bumpversion.sh @@ -0,0 +1,72 @@ +#!/bin/sh +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# Convenience script for changing the emulator's version. +# +# +# Authors: RichardG, +# +# Copyright 2022 RichardG. +# + +# Parse arguments. +newversion="$1" +if [ -z "$(echo $newversion | grep '\.')" ] +then + echo '[!] Usage: bumpversion.sh x.y[.z]' + exit 1 +fi +shift + +# Extract version components. +newversion_maj=$(echo $newversion | cut -d. -f1) +newversion_min=$(echo $newversion | cut -d. -f2) +newversion_patch=$(echo $newversion | cut -d. -f3) +[ -z "$newversion_patch" ] && newversion_patch=0 + +base36() { + if [ $1 -lt 10 ] + then + echo $1 + else + printf '%b' $(printf '\\%03o' $((55 + $1))) + fi +} +newversion_maj_base36=$(base36 $newversion_maj) +newversion_min_base36=$(base36 $newversion_min) +newversion_patch_base36=$(base36 $newversion_patch) + +# Switch to the repository root directory. +cd "$(dirname "$0")" + +# Patch files. +patch_file() { + # Stop if the file doesn't exist. + [ ! -e "$1" ] && return + + # Patch file. + if sed -i -r -e "$3" "$1" + then + echo "[-] Patched $2 on $1" + else + echo "[!] Patching $2 on $1 failed" + fi +} +patch_file CMakeLists.txt VERSION 's/^(\s*VERSION ).+/\1'"$newversion"'/' +patch_file CMakeLists.txt EMU_VERSION_EX 's/(\s*set\(EMU_VERSION_EX\s+")[^"]+/\1'"$newversion_maj_base36.$newversion_min_base36$newversion_patch_base36"'/' +patch_file src/include_make/*/version.h EMU_VERSION 's/(#\s*define\s+EMU_VERSION\s+")[^"]+/\1'"$newversion"'/' +patch_file src/include_make/*/version.h EMU_VERSION_EX 's/(#\s*define\s+EMU_VERSION_EX\s+")[^"]+/\1'"$newversion_maj_base36.$newversion_min_base36$newversion_patch_base36"'/' +patch_file src/include_make/*/version.h EMU_VERSION_MAJ 's/(#\s*define\s+EMU_VERSION_MAJ\s+)[0-9]+/\1'"$newversion_maj"'/' +patch_file src/include_make/*/version.h EMU_VERSION_MIN 's/(#\s*define\s+EMU_VERSION_MIN\s+)[0-9]+/\1'"$newversion_min"'/' +patch_file src/include_make/*/version.h EMU_VERSION_PATCH 's/(#\s*define\s+EMU_VERSION_PATCH\s+)[0-9]+/\1'"$newversion_patch"'/' +patch_file src/include_make/*/version.h COPYRIGHT_YEAR 's/(#\s*define\s+COPYRIGHT_YEAR\s+)[0-9]+/\1'"$(date +%Y)"'/' +patch_file src/include_make/*/version.h EMU_DOCS_URL 's/(#\s*define\s+EMU_DOCS_URL\s+"https:\/\/[^\/]+\/en\/v)[^\/]+/\1'"$newversion_maj.$newversion_min"'/' +patch_file src/unix/assets/*.spec date 's/(%global\s+date\s+).+/\1'"$(date +%Y-%m-%d)"'/' +patch_file src/unix/assets/*.spec Version 's/(Version:\s+)[0-9].+/\1'"$newversion"'/' +patch_file src/unix/assets/*.metainfo.xml release 's/( net.86box.86Box.desktop - +