diff options
author | Gaƫl Bonithon <gael@xfce.org> | 2022-01-07 13:06:39 +0100 |
---|---|---|
committer | Romain Bouvier <skunnyk@alteroot.org> | 2022-02-01 14:35:41 +0000 |
commit | 7651c19ef009a99ac8367e88720231e58458d3af (patch) | |
tree | a5005e25da48ec5d91f46bf316adb78e5c9bdc97 /helpers | |
parent | 9a71068cf03f565d93812d1d79194129bf48cb99 (diff) | |
download | xfce4-dev-tools-7651c19ef009a99ac8367e88720231e58458d3af.tar.gz |
xfce-do-release: Extend `configure.ac.in` update to `configure.ac`
The use of `m4_define` is also found in `configure.ac` files, with or
without a version tag, which is not a problem. The use of
`XDT_VERSION_INIT` is probably always exclusive of the use of
`m4_define`, but the filter by grep does not bother.
Diffstat (limited to 'helpers')
-rwxr-xr-x | helpers/xfce-do-release | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/helpers/xfce-do-release b/helpers/xfce-do-release index edd6f5d..9bc3822 100755 --- a/helpers/xfce-do-release +++ b/helpers/xfce-do-release @@ -186,25 +186,37 @@ edit () { } update_configure_ac_in () { + local configure_file + if [ -f "configure.ac.in" ]; then + configure_file="configure.ac.in" + elif [ -f "configure.ac" ]; then + configure_file="configure.ac" + else + echo "There is no 'configure.ac.in' or 'configure.ac' file." + return 1 + fi + + if grep -q 'XDT_VERSION_INIT' "$configure_file"; then if [ "$1" = "pre" ]; then - sed -i "s/^\(m4_define(\[.*_version_major\].* \[\)\(.*\)\(\])\)/\1$version_major\3/g" configure.ac.in - sed -i "s/^\(m4_define(\[.*_version_minor\].* \[\)\(.*\)\(\])\)/\1$version_minor\3/g" configure.ac.in - sed -i "s/^\(m4_define(\[.*_version_micro\].* \[\)\(.*\)\(\])\)/\1$version_patch\3/g" configure.ac.in - sed -i 's/^\(m4_define(\[.*_version_tag\], \[\)\(git\)\(\])\)/\1\3/g' configure.ac.in + sed -i "s/^\(XDT_VERSION_INIT\s*\)(.*/\1([$version])/" "$configure_file" elif [ "$1" = "post" ]; then - sed -i 's/\(m4_define(\[.*_version_tag\], \[\)\(.*\)\(\])\)/\1git\3/g' configure.ac.in + sed -i "s/^\(XDT_VERSION_INIT\s*\)(.*/\1([$version], [git])/" "$configure_file" fi - git diff configure.ac.in - elif [ -f "configure.ac" ]; then + else if [ "$1" = "pre" ]; then - sed -i "s/^\(XDT_VERSION_INIT\s*\)(.*/\1([$version])/" configure.ac + sed -i \ + -e "s/^\(m4_define(\[.*_version_major\].* \[\)\(.*\)\(\])\)/\1$version_major\3/g" \ + -e "s/^\(m4_define(\[.*_version_minor\].* \[\)\(.*\)\(\])\)/\1$version_minor\3/g" \ + -e "s/^\(m4_define(\[.*_version_micro\].* \[\)\(.*\)\(\])\)/\1$version_patch\3/g" \ + -e 's/^\(m4_define(\[.*_version_tag\], \[\)\(git\)\(\])\)/\1\3/g' \ + "$configure_file" elif [ "$1" = "post" ]; then - sed -i "s/^\(XDT_VERSION_INIT\s*\)(.*/\1([$version], [git])/" configure.ac + sed -i 's/\(m4_define(\[.*_version_tag\], \[\)\(.*\)\(\])\)/\1git\3/g' "$configure_file" fi - else - echo "There is no 'configure.ac.in' or 'configure.ac' file." fi + + git diff "$configure_file" } get_sha1_hash () { |