git-r3.eclass: Fix var names for packages starting with digits, #596912
authorMichał Górny <mgorny@gentoo.org>
Sat, 22 Oct 2016 21:03:08 +0000 (23:03 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sat, 22 Oct 2016 21:05:08 +0000 (23:05 +0200)
Fix live variable names for packages whose names start with digits.
Since variable names can not start with digits in bash, just prepend
an underscore to them.

eclass/git-r3.eclass

index 817638dc0de471cd7e54fb70142a08d3ea943e74..f76f1a7ea5966636efe2c07c5689384b1f7fedcf 100644 (file)
@@ -253,6 +253,7 @@ _git-r3_env_setup() {
 
        local esc_pn livevar
        esc_pn=${PN//[-+]/_}
+       [[ ${esc_pn} == [0-9]* ]] && esc_pn=_${esc_pn}
 
        livevar=${esc_pn}_LIVE_REPO
        EGIT_REPO_URI=${!livevar-${EGIT_REPO_URI}}