summaryrefslogtreecommitdiff
path: root/eclass/pypi.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/pypi.eclass')
-rw-r--r--eclass/pypi.eclass14
1 files changed, 6 insertions, 8 deletions
diff --git a/eclass/pypi.eclass b/eclass/pypi.eclass
index 8a842c450ebc..594216a7fd96 100644
--- a/eclass/pypi.eclass
+++ b/eclass/pypi.eclass
@@ -70,14 +70,12 @@ _PYPI_ECLASS=1
# Internal normalization function, returns the result
# via _PYPI_NORMALIZED_NAME variable.
_pypi_normalize_name() {
- local name=${1}
- if shopt -p -q extglob; then
- name=${name//+([._-])/_}
- else
- shopt -s extglob
- name=${name//+([._-])/_}
- shopt -u extglob
- fi
+ # NB: it's fine to alter it unconditionally since this function is
+ # always called from a subshell or in global scope
+ # (via _pypi_set_globals)
+ shopt -s extglob
+ local name=${1//+([._-])/_}
+ shopt -u extglob
_PYPI_NORMALIZED_NAME="${name,,}"
}