mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-18 09:19:24 +03:00
version.sh: output short mc git version to prevent full rebuild.
When using exact git version in AC_INIT, every git commit result in different AC_PACKAGE_VERSION and AC_PACKAGE_STRING macros at config.h Hence this will cause a full rebuild (see #2252). 4.8.26-217-ge819ed742 -> 4.8.26-git 4.8.27-pre1-1-gcbc214da8 -> 4.8.27-pre1-git TODO: tests needed for final version release workflow! Signed-off-by: Andreas Mohr <and@gmx.li>
This commit is contained in:
parent
6a4107b277
commit
fcfa089b53
10
version.sh
10
version.sh
@ -42,7 +42,7 @@ mc_print_version(){
|
|||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
echo "${CURR_MC_VERSION}"
|
echo "${SHOR_MC_VERSION}"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,11 +59,13 @@ src_top_dir="$1"
|
|||||||
VERSION_FILE="${src_top_dir}/mc-version.h"
|
VERSION_FILE="${src_top_dir}/mc-version.h"
|
||||||
PREV_MC_VERSION="unknown"
|
PREV_MC_VERSION="unknown"
|
||||||
CURR_MC_VERSION="${PREV_MC_VERSION}"
|
CURR_MC_VERSION="${PREV_MC_VERSION}"
|
||||||
|
SHOR_MC_VERSION="${PREV_MC_VERSION}"
|
||||||
|
|
||||||
if [ -r "${VERSION_FILE}" ]
|
if [ -r "${VERSION_FILE}" ]
|
||||||
then
|
then
|
||||||
PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"`
|
PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"`
|
||||||
CURR_MC_VERSION="${PREV_MC_VERSION}"
|
CURR_MC_VERSION="${PREV_MC_VERSION}"
|
||||||
|
SHOR_MC_VERSION="${PREV_MC_VERSION}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/null`
|
git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/null`
|
||||||
@ -71,10 +73,16 @@ git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/nul
|
|||||||
|
|
||||||
# try to store sha1
|
# try to store sha1
|
||||||
CURR_MC_VERSION="${git_head}"
|
CURR_MC_VERSION="${git_head}"
|
||||||
|
SHOR_MC_VERSION="${CURR_MC_VERSION}"
|
||||||
|
|
||||||
new_version=`git --git-dir "${src_top_dir}/.git" describe --always 2>/dev/null`
|
new_version=`git --git-dir "${src_top_dir}/.git" describe --always 2>/dev/null`
|
||||||
[ -z "${new_version}" ] && mc_print_version
|
[ -z "${new_version}" ] && mc_print_version
|
||||||
|
|
||||||
# store pretty tagged version
|
# store pretty tagged version
|
||||||
CURR_MC_VERSION="${new_version}"
|
CURR_MC_VERSION="${new_version}"
|
||||||
|
SHOR_MC_VERSION="${CURR_MC_VERSION}"
|
||||||
|
|
||||||
|
# stop full rebuild by using not-exact git version string in config.h, see #2252, #4266
|
||||||
|
SHOR_MC_VERSION=`git --git-dir "${src_top_dir}/.git" describe --always --abbrev=0 2>/dev/null`-git
|
||||||
|
|
||||||
mc_print_version
|
mc_print_version
|
||||||
|
Loading…
Reference in New Issue
Block a user