summaryrefslogtreecommitdiff
path: root/eclass
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
commite1303010e29fc995d4e8531adfed519d9aa45f4e (patch)
treeafa148089fa89279967e906834febe016848df39 /eclass
parentUpdate the gtk patch to exclude docs too. (diff)
downloadgentoo-2-e1303010e29fc995d4e8531adfed519d9aa45f4e.tar.gz
gentoo-2-e1303010e29fc995d4e8531adfed519d9aa45f4e.tar.bz2
gentoo-2-e1303010e29fc995d4e8531adfed519d9aa45f4e.zip
declare some vars local and check the path is readable #289168
Diffstat (limited to 'eclass')
-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"