dosbox-x/update-version-number
Robert de Rooy 694cc766a4 Cleanup Bash scripts.
This makes them pass shellcheck. Except for a few unused
export warnings.

I also wonder if the majority of these files should be
in the root of the project, or should be moved to "build-scripts"
(or should still even exist).

a few minor changes

one more minor changes
2023-04-15 15:53:08 +02:00

30 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
if [ -z "${1}" ]
then
echo "No version number specified."
exit
fi
ver=${1}
pushd "$(git rev-parse --show-toplevel)" > /dev/null || exit
find contrib/translations -type f -name '*.lng' -exec sed -b -i "s/^:DOSBOX-X:VERSION:\([0-9.]\+\)/:DOSBOX-X:VERSION:${ver}/" {} +
find . -type f -name '*.conf' -exec sed -b -i "s/^# This is the configuration file for DOSBox-X \([0-9.]\+\)/# This is the configuration file for DOSBox-X ${ver}./" {} +
sed -b -i "s/PACKAGE_STRING \"dosbox-x \([0-9.]\+\)\"/PACKAGE_STRING \"dosbox-x ${ver}\"/" vs/config_package.h
sed -b -i "s/VERSION \"\([0-9.]\+\)\"/VERSION \"${ver}\"/g" vs/config_package.h
sed -b -i "s/^AC_INIT(dosbox-x,\([0-9.]\+\)/AC_INIT(dosbox-x,${ver}/" configure.ac
sed -b -i "s/^#define MyAppVersion \"\([0-9.]\+\)\"/#define MyAppVersion \"${ver}\"/" contrib/windows/installer/DOSBox-X-setup.iss
ver=$(echo "${ver}" | tr . ,)
sed -b -i "s/^#define VERSION_NUMBER \([0-9,]\+\)/#define VERSION_NUMBER ${ver},0/" src/winres.rc
popd > /dev/null || exit