Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: savedconfig.eclass
Date: Fri, 30 Oct 2009 00:05:28
Message-Id: E1N3ezd-0004wt-NW@stork.gentoo.org
1 vapier 09/10/30 00:05:25
2
3 Modified: savedconfig.eclass
4 Log:
5 declare some vars local and check the path is readable #289168
6
7 Revision Changes Path
8 1.11 eclass/savedconfig.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/savedconfig.eclass?rev=1.11&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/savedconfig.eclass?rev=1.11&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/savedconfig.eclass?r1=1.10&r2=1.11
13
14 Index: savedconfig.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/savedconfig.eclass,v
17 retrieving revision 1.10
18 retrieving revision 1.11
19 diff -u -r1.10 -r1.11
20 --- savedconfig.eclass 11 Apr 2009 15:19:50 -0000 1.10
21 +++ savedconfig.eclass 30 Oct 2009 00:05:25 -0000 1.11
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2007 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/savedconfig.eclass,v 1.10 2009/04/11 15:19:50 vapier Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/savedconfig.eclass,v 1.11 2009/10/30 00:05:25 vapier Exp $
27
28 # @ECLASS: savedconfig.eclass
29 # @MAINTAINER:
30 @@ -85,7 +85,7 @@
31 *) die "Bad package! restore_config only for use in src_{unpack,compile,prepare} functions!"
32 ;;
33 esac
34 - local found;
35 + local found check configfile
36 local base=${PORTAGE_CONFIGROOT}/etc/portage/savedconfig
37 for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do
38 configfile=${base}/${CTARGET}/${check}
39 @@ -107,13 +107,18 @@
40 fi
41 elif [[ -d ${found} ]]; then
42 elog "Building using saved config directory ${found}"
43 - dest=${PWD}
44 + local dest=${PWD}
45 pushd "${found}" > /dev/null
46 treecopy . "${dest}" || die "Failed to restore ${found} to $1"
47 popd > /dev/null
48 elif [[ -a {found} ]]; then
49 die "do not know how to handle non-file/directory ${found}"
50 else
51 + # maybe the user is screwing around with perms they shouldnt #289168
52 + if [[ -r ${base} ]] ; then
53 + eerror "Unable to read ${base} -- perms are screwed ?"
54 + die "fix your system"
55 + fi
56 eerror "No saved config to restore - please remove USE=savedconfig or"
57 eerror "provide a configuration file in ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PN}"
58 die "config file needed when USE=savedconfig is specified"