summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2012-11-25 11:40:06 +0100
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2012-11-25 11:40:06 +0100
commit3dea53c2be83088d05c82a0c3dbbe7e6e1a6edea (patch)
tree472b8cf6c25c0434af127fba98471a2bcd6d19e7 /bin
parentddee4fef83539a5bc66b3c76086dd6ba2ab1f77c (diff)
downloadportage-3dea53c2be83088d05c82a0c3dbbe7e6e1a6edea.tar.gz
portage-3dea53c2be83088d05c82a0c3dbbe7e6e1a6edea.tar.bz2
portage-3dea53c2be83088d05c82a0c3dbbe7e6e1a6edea.zip
unpack(): Handle suffixes in case-insensitive way.
Diffstat (limited to 'bin')
-rw-r--r--bin/phase-helpers.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index bc00e44d8..8a78f372b 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -276,14 +276,18 @@ unpack() {
local srcdir
local x
local y
+ local suffix
local myfail
local eapi=${EAPI:-0}
[ -z "$*" ] && die "Nothing passed to the 'unpack' command"
for x in "$@"; do
__vecho ">>> Unpacking ${x} to ${PWD}"
+ suffix=${x##*.}
+ suffix=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
y=${x%.*}
y=${y##*.}
+ y=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
if [[ ${x} == "./"* ]] ; then
srcdir=""
@@ -308,7 +312,7 @@ unpack() {
}
myfail="failure unpacking ${x}"
- case "${x##*.}" in
+ case "${suffix}" in
tar)
tar xof "$srcdir$x" || die "$myfail"
;;
@@ -319,19 +323,19 @@ unpack() {
${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
__assert_sigpipe_ok "$myfail"
;;
- ZIP|zip|jar)
+ zip|jar)
# unzip will interactively prompt under some error conditions,
# as reported in bug #336285
( set +x ; while true ; do echo n || break ; done ) | \
unzip -qo "${srcdir}${x}" || die "$myfail"
;;
- gz|Z|z)
+ gz|z)
__unpack_tar "gzip -d"
;;
bz2|bz)
__unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
;;
- 7Z|7z)
+ 7z)
local my_output
my_output="$(7z x -y "${srcdir}${x}")"
if [ $? -ne 0 ]; then
@@ -339,10 +343,10 @@ unpack() {
die "$myfail"
fi
;;
- RAR|rar)
+ rar)
unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
;;
- LHa|LHA|lha|lzh)
+ lha|lzh)
lha xfq "${srcdir}${x}" || die "$myfail"
;;
a)