diff options
-rwxr-xr-x | bin/sbuild-deb-package | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/sbuild-deb-package b/bin/sbuild-deb-package index 6519c4b..84f43ad 100755 --- a/bin/sbuild-deb-package +++ b/bin/sbuild-deb-package @@ -233,7 +233,11 @@ build_packages() { } # for Ubuntu version is the codename of the distribution release - typeset -l codename="${l_CODENAME}" + if [ -n "${BASH_VERSINFO[0]}" ] && [ "${BASH_VERSINFO[0]}" -gt 3 ]; then + typeset -l codename="${l_CODENAME}" + else + typeset codename="$(tr '[:upper:]' '[:lower:]' <<< "${l_CODENAME}")" + fi # translate the version name for Debian releases [ "x${l_CODENAME}" = "xsid" ] && codename="unstable" @@ -241,9 +245,9 @@ build_packages() { #[ "x$l_CODENAME" = "xwheezy" ] && codename=stable #[ "x$l_CODENAME" = "xoldstable" ] && codename=oldstable - typeset -l numerical_version="" - typeset -l -i tmp_ret="1" - typeset -l pretty_dist="" + typeset numerical_version="" + typeset -i tmp_ret="1" + typeset pretty_dist="" if [ -n "${l_DIST}" ] && [ "${l_DIST}" = "debian" ]; then pretty_dist="Debian" @@ -257,7 +261,7 @@ build_packages() { tmp_ret="${?}" fi - if [ "${tmp_ret}" -ne "0" ]; then + if [ "${tmp_ret}" -ne "0" ] || [ -z "${numerical_version}" ]; then echo "Error: unable to map code name \"${codename}\" to Debian or Ubuntu numerical versions. Unknown code name or not applicable to distribution \"${dist_pretty}\"? Aborting." >&2 exit 1 fi |