From: Yann E. MORIN" Date: Sat, 31 Mar 2012 20:47:41 +0000 (+0200) Subject: version: Redo the version string computation X-Git-Tag: v3.4.0-0~31 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d1af9e48a392edb4c4e52d5304abace762fd9b0;p=kconfig-frontends version: Redo the version string computation 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" --- diff --git a/scripts/version.sh b/scripts/version.sh index bbfc0e7..c4f6263 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -11,23 +11,20 @@ k_cset="$( head -n 1 .version |cut -d ' ' -f 2 )" 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