summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald van Dijk <truedfx@gentoo.org>2010-07-10 22:30:03 +0000
committerHarald van Dijk <truedfx@gentoo.org>2010-07-10 22:30:03 +0000
commit0c7ca3ead1396716d4209e87d80a49a04bd3c3af (patch)
tree132bd81550046db5e7f45ec3340e79bc5dc44c16 /app-portage
parentRespect CC wrt bug #244140 (diff)
downloadgentoo-2-0c7ca3ead1396716d4209e87d80a49a04bd3c3af.tar.gz
gentoo-2-0c7ca3ead1396716d4209e87d80a49a04bd3c3af.tar.bz2
gentoo-2-0c7ca3ead1396716d4209e87d80a49a04bd3c3af.zip
Use bashrc hook function instead of EBUILD_PHASE; check ROOT (#327563 by ferringb)
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'app-portage')
-rw-r--r--app-portage/cfg-update/ChangeLog7
-rw-r--r--app-portage/cfg-update/cfg-update-1.8.2-r2.ebuild3
-rw-r--r--app-portage/cfg-update/files/cfg-update-1.8.2-bashrc.patch51
3 files changed, 59 insertions, 2 deletions
diff --git a/app-portage/cfg-update/ChangeLog b/app-portage/cfg-update/ChangeLog
index 84706b01cc93..800911783a14 100644
--- a/app-portage/cfg-update/ChangeLog
+++ b/app-portage/cfg-update/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for app-portage/cfg-update
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-portage/cfg-update/ChangeLog,v 1.23 2010/02/15 07:55:49 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/cfg-update/ChangeLog,v 1.24 2010/07/10 22:30:03 truedfx Exp $
+
+ 10 Jul 2010; Harald van Dijk <truedfx@gentoo.org>
+ cfg-update-1.8.2-r2.ebuild, +files/cfg-update-1.8.2-bashrc.patch:
+ Use bashrc hook function instead of EBUILD_PHASE; check ROOT (#327563 by
+ ferringb)
*cfg-update-1.8.2-r2 (15 Feb 2010)
diff --git a/app-portage/cfg-update/cfg-update-1.8.2-r2.ebuild b/app-portage/cfg-update/cfg-update-1.8.2-r2.ebuild
index 0f052f105e0a..6971093b13a0 100644
--- a/app-portage/cfg-update/cfg-update-1.8.2-r2.ebuild
+++ b/app-portage/cfg-update/cfg-update-1.8.2-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-portage/cfg-update/cfg-update-1.8.2-r2.ebuild,v 1.1 2010/02/15 07:55:49 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/cfg-update/cfg-update-1.8.2-r2.ebuild,v 1.2 2010/07/10 22:30:03 truedfx Exp $
inherit eutils
@@ -22,6 +22,7 @@ src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}"/${P}-xxdiff-to-beediff.patch
+ epatch "${FILESDIR}"/${P}-bashrc.patch
}
pkg_prerm() {
diff --git a/app-portage/cfg-update/files/cfg-update-1.8.2-bashrc.patch b/app-portage/cfg-update/files/cfg-update-1.8.2-bashrc.patch
new file mode 100644
index 000000000000..73fe9b83103a
--- /dev/null
+++ b/app-portage/cfg-update/files/cfg-update-1.8.2-bashrc.patch
@@ -0,0 +1,51 @@
+--- cfg-update-1.8.2-r1/cfg-update
++++ cfg-update-1.8.2-r1/cfg-update
+@@ -538,9 +538,9 @@
+ local $ENV{LC_ALL}="C";
+ if (`grep '^.*cfg-update.*--index' $portage_hook` =~ /cfg-update/) {
+ local $ENV{LC_ALL}="C";
+- if (`grep '^#.*cfg-update.*--index' $portage_hook` =~ /cfg-update/) {
++ if (`grep ': cfg-update.*--index' $portage_hook` =~ /cfg-update/) {
+ &root_only("Can't enable the Portage hook if you're not root...");
+- `perl -p -i -e 's/#if \\[ \\"\\\$EBUILD_PHASE\\" = \\"setup\\" \\] && \\[ -e \\"\\/usr\\/bin\\/cfg-update\\" \\]; then cfg-update --index; fi/if \\[ \\"\\\$EBUILD_PHASE\\" = \\"setup\\" \\] && \\[ -e \\"\\/usr\\/bin\\/cfg-update\\" \\]; then cfg-update --index; fi/;' $portage_hook`;
++ `perl -p -i -e 's/: (cfg-update.*--index)/\$1/;' $portage_hook`;
+ if ($opt_d >= 1) { print "$tab"."Enabled Portage hook in $portage_hook...\n"; }
+ } else {
+ if ($opt_d >= 1) { print "$tab"."Portage hook is already enabled...\n"; }
+@@ -549,16 +549,17 @@
+ &root_only("Can't add the Portage hook if you're not root...");
+ `echo >> $portage_hook`;
+ `echo "# This hook is neccesary for automatic updating of the cfg-update index, please do not modify it!" >> $portage_hook`;
+- `echo "if [ \\"\\\$EBUILD_PHASE\\" = \\"setup\\" ] && [ -e \\"/usr/bin/cfg-update\\" ]; then cfg-update --index; fi" >> $portage_hook`;
+- `echo >> $portage_hook`;
++ `echo "pre_pkg_setup() {" >> $portage_hook`;
++ `echo " [[ \\\$ROOT = / ]] && cfg-update --index" >> $portage_hook`;
++ `echo "}" >> $portage_hook`;
+ if ($opt_d >= 1) { print "$tab"."Added Portage hook in $portage_hook...\n"; }
+ }
+ } else {
+ &root_only("Can't create the Portage hook if you're not root...");
+- `echo >> $portage_hook`;
+ `echo "# This hook is neccesary for automatic updating of the cfg-update index, please do not modify it!" >> $portage_hook`;
+- `echo "if [ \\"\\\$EBUILD_PHASE\\" = \\"setup\\" ] && [ -e \\"/usr/bin/cfg-update\\" ]; then cfg-update --index; fi" >> $portage_hook`;
+- `echo >> $portage_hook`;
++ `echo "pre_pkg_setup() {" >> $portage_hook`;
++ `echo " [[ \\\$ROOT = / ]] && cfg-update --index" >> $portage_hook`;
++ `echo "}" >> $portage_hook`;
+ if ($opt_d >= 1) { print "$tab"."Created Portage hook in $portage_hook...\n"; }
+ }
+ }
+@@ -2209,11 +2210,11 @@
+ local $ENV{LC_ALL}="C";
+ if (`grep '^.*cfg-update.*--index' $portage_hook` =~ /cfg-update/) {
+ local $ENV{LC_ALL}="C";
+- if (`grep '^#.*cfg-update.*--index' $portage_hook` =~ /cfg-update/) {
++ if (`grep ': cfg-update.*--index' $portage_hook` =~ /cfg-update/) {
+ if ($opt_ebuild == 0) { print "$tab"." Portage hook is already disabled...\n"; }
+ } else {
+ &root_only("Can't disable the Portage hook if you're not root...");
+- `perl -p -i -e 's/^if \\[ \\"\\\$EBUILD_PHASE\\" = \\"setup\\" \\] && \\[ -e \\"\\/usr\\/bin\\/cfg-update\\" \\]; then cfg-update --index; fi/#if \\[ \\"\\\$EBUILD_PHASE\\" = \\"setup\\" \\] && \\[ -e \\"\\/usr\\/bin\\/cfg-update\\" \\]; then cfg-update --index; fi/;' $portage_hook`;
++ `perl -p -i -e 's/cfg-update.*--index/: \$&/;' $portage_hook`;
+ if ($opt_ebuild == 0) { print "$tab"." Disabled Portage hook in $portage_hook...\n"; }
+ }
+ } else {