summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-09-06 01:59:22 +0000
committerMike Frysinger <vapier@gentoo.org>2005-09-06 01:59:22 +0000
commitefbeaddfd7ee699f6d46fbdf905bbddab6bc914e (patch)
treee3555b823e1021d82afab81d1503275c2c648cf3 /eclass/eutils.eclass
parentAdded x11-libs/libXv as a RDEPEND per bug #104833. Thanks to Søren F. (diff)
downloadgentoo-2-efbeaddfd7ee699f6d46fbdf905bbddab6bc914e.tar.gz
gentoo-2-efbeaddfd7ee699f6d46fbdf905bbddab6bc914e.tar.bz2
gentoo-2-efbeaddfd7ee699f6d46fbdf905bbddab6bc914e.zip
check the return value of find_unpackable_file in case it failed
Diffstat (limited to 'eclass/eutils.eclass')
-rw-r--r--eclass/eutils.eclass43
1 files changed, 21 insertions, 22 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 597f4980a664..347a3c9bcc46 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.195 2005/09/01 05:56:35 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.196 2005/09/06 01:59:22 vapier Exp $
#
# Author: Martin Schlemmer <azarah@gentoo.org>
#
@@ -933,23 +933,19 @@ newicon() {
# for internal use only (unpack_pdv and unpack_makeself)
find_unpackable_file() {
- local src="$1"
- if [ -z "${src}" ]
- then
- src="${DISTDIR}/${A}"
+ local src=$1
+ if [[ -z ${src} ]] ; then
+ src=${DISTDIR}/${A}
else
- if [ -e "${DISTDIR}/${src}" ]
- then
- src="${DISTDIR}/${src}"
- elif [ -e "${PWD}/${src}" ]
- then
- src="${PWD}/${src}"
- elif [ -e "${src}" ]
- then
- src="${src}"
+ if [[ -e ${DISTDIR}/${src} ]] ; then
+ src=${DISTDIR}/${src}
+ elif [[ -e ${PWD}/${src} ]] ; then
+ src=${PWD}/${src}
+ elif [[ -e ${src} ]] ; then
+ src=${src}
fi
fi
- [ ! -e "${src}" ] && die "Could not find requested archive ${src}"
+ [[ ! -e ${src} ]] && return 1
echo "${src}"
}
@@ -974,10 +970,11 @@ find_unpackable_file() {
# lseek(3, -4, SEEK_END) = 2981250
# thus we would pass in the value of '4' as the second parameter.
unpack_pdv() {
- local src="`find_unpackable_file $1`"
- local sizeoff_t="$2"
+ local src=$(find_unpackable_file $1)
+ local sizeoff_t=$2
- [ -z "${sizeoff_t}" ] && die "No idea what off_t size was used for this pdv :("
+ [[ -z ${src} ]] && die "Could not locate source for '$1'"
+ [[ -z ${sizeoff_t} ]] && die "No idea what off_t size was used for this pdv :("
local shrtsrc="`basename ${src}`"
echo ">>> Unpacking ${shrtsrc} to ${PWD}"
@@ -1053,11 +1050,13 @@ unpack_pdv() {
# - If the offset is not specified then we will attempt to extract
# the proper offset from the script itself.
unpack_makeself() {
- local src="$(find_unpackable_file "$1")"
- local skip="$2"
- local exe="$3"
+ local src=$(find_unpackable_file "$1")
+ local skip=$2
+ local exe=$3
+
+ [[ -z ${src} ]] && die "Could not locate source for '$1'"
- local shrtsrc="$(basename "${src}")"
+ local shrtsrc=$(basename "${src}")
echo ">>> Unpacking ${shrtsrc} to ${PWD}"
if [ -z "${skip}" ]
then