Commit 7651c19e authored by Gaël Bonithon's avatar Gaël Bonithon Committed by Romain Bouvier
Browse files

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.
parent 9a71068c
......@@ -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 () {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment