In case the kconfig-frontends version is 'hg', always include
the Linux kernel changeset we last synced up with, and include
the potential '-rcX' if present.
In case the kconfig-frontends version is not 'hg', we assume
this is a digit-version, and we do not include hte kernel cset
in the version, but we keep an potential '-rcX' if present.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
k_name="$( head -n 1 .version |cut -d ' ' -f 3- )"
kf_ver="$( tail -n 1 .version )"
-k_ver_plain="$( echo "${k_ver}" |sed -r -e 's/-rc[[:digit:]]+$//;' )"
-case "${k_ver}" in
- *-rc*) k_ver_extra="_$( printf "%-7.7s" "${k_cset}" )";;
- *) k_ver_extra="";;
-esac
-k_ver_extra="$( echo "${k_ver_extra}" |tr '-' '_' )"
+k_ver_plain="$( printf "%s" "${k_ver}" \
+ |sed -r -e 's/-rc.*//;' )"
case "${kf_ver}" in
- hg) kf_ver="-hg_$( hg id -i -r . )";;
- "") kf_ver="";;
- *) kf_ver="-${kf_ver}";;
+ hg) kf_ver="hg_$( hg id -i -r . )"
+ k_ver_extra="$( printf "_%-7.7s" "${k_cset}" )"
+ ;;
+ *) k_ver_extra="";;
esac
if [ "${plain}" -eq 1 ]; then
echo "${k_ver_plain}"
else
- echo "${k_ver}${k_ver_extra}${kf_ver}"
+ echo "${k_ver}${k_ver_extra}-${kf_ver}"
fi