Normalize wheel folder structure

This patch normalizes the names of the package folders based on
PEP-503. It permits the discovery of wheels with names that
contain odd characters.

Example conversion:
  'MySQL_python' => 'mysql-python'
  'MarkupSafe' => 'markupsafe'

Change-Id: Idcb540cecc7b581a24f060f636a1df034b653996
This commit is contained in:
Michael Krotscheck 2016-02-08 05:52:08 -08:00
parent dc6e08a896
commit 9183bac7ff

View File

@ -8,7 +8,12 @@ MIRROR_ROOT=$2
for f in $WHEELHOUSE_DIR/*; do
BASENAME=$(basename $f)
IFS='-' read -a parts <<< $BASENAME
DEST_DIR="${parts[0]:0:1}/${parts[0]}"
# Normalize based on PEP503
PACKAGENAME=`echo "${parts[0]}" | perl -pe 's/[-_.]+/-/g' | \
tr '[:upper:]' '[:lower:]'`
DEST_DIR="${PACKAGENAME:0:1}/$PACKAGENAME"
# Create the mirror directories in AFS /s/split style. This
# depends on the existence of a mod_rewrite script which unmunges