summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-10-30 00:05:25 +0000
committerMike Frysinger <vapier@gentoo.org>2009-10-30 00:05:25 +0000
commit9bcfd74ec93db4bfcc1d171e584bd80cd1320874 (patch)
tree76286b74de28356586a89eaf46d022a16817226c
parentUpdate the gtk patch to exclude docs too. (diff)
downloadhistorical-9bcfd74ec93db4bfcc1d171e584bd80cd1320874.tar.gz
historical-9bcfd74ec93db4bfcc1d171e584bd80cd1320874.tar.bz2
historical-9bcfd74ec93db4bfcc1d171e584bd80cd1320874.zip
declare some vars local and check the path is readable #289168
-rw-r--r--eclass/savedconfig.eclass11
1 files changed, 8 insertions, 3 deletions
diff --git a/eclass/savedconfig.eclass b/eclass/savedconfig.eclass
index b347b8c861f2..c2a66a0740d2 100644
--- a/eclass/savedconfig.eclass
+++ b/eclass/savedconfig.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/savedconfig.eclass,v 1.10 2009/04/11 15:19:50 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/savedconfig.eclass,v 1.11 2009/10/30 00:05:25 vapier Exp $
# @ECLASS: savedconfig.eclass
# @MAINTAINER:
@@ -85,7 +85,7 @@ restore_config() {
*) die "Bad package! restore_config only for use in src_{unpack,compile,prepare} functions!"
;;
esac
- local found;
+ local found check configfile
local base=${PORTAGE_CONFIGROOT}/etc/portage/savedconfig
for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do
configfile=${base}/${CTARGET}/${check}
@@ -107,13 +107,18 @@ restore_config() {
fi
elif [[ -d ${found} ]]; then
elog "Building using saved config directory ${found}"
- dest=${PWD}
+ local dest=${PWD}
pushd "${found}" > /dev/null
treecopy . "${dest}" || die "Failed to restore ${found} to $1"
popd > /dev/null
elif [[ -a {found} ]]; then
die "do not know how to handle non-file/directory ${found}"
else
+ # maybe the user is screwing around with perms they shouldnt #289168
+ if [[ -r ${base} ]] ; then
+ eerror "Unable to read ${base} -- perms are screwed ?"
+ die "fix your system"
+ fi
eerror "No saved config to restore - please remove USE=savedconfig or"
eerror "provide a configuration file in ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PN}"
die "config file needed when USE=savedconfig is specified"