From 11c06d4110e835f86725c04af79b365b8f4625c1 Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Sat, 10 Jul 2010 22:30:03 +0000 Subject: [PATCH] Use bashrc hook function instead of EBUILD_PHASE; check ROOT (#327563 by ferringb) Package-Manager: portage-2.2_rc67/cvs/Linux x86_64 --- app-portage/cfg-update/ChangeLog | 7 ++- app-portage/cfg-update/Manifest | 15 +++++- .../cfg-update/cfg-update-1.8.2-r2.ebuild | 3 +- .../files/cfg-update-1.8.2-bashrc.patch | 51 +++++++++++++++++++ 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 app-portage/cfg-update/files/cfg-update-1.8.2-bashrc.patch 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 + 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/Manifest b/app-portage/cfg-update/Manifest index 963c99a815bc..9fc17ac7c0a2 100644 --- a/app-portage/cfg-update/Manifest +++ b/app-portage/cfg-update/Manifest @@ -1,8 +1,19 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX cfg-update-1.8.2-bashrc.patch 3725 RMD160 00c8e2688df202454503407782b7d3f8b48f9c87 SHA1 457ed08ebaa1901d14adfb0b6e30d39e2dacae79 SHA256 9f56c60ffa58a12ad5e1bdda9356e7e46ac823c9b22189ef6ee95d0fecd6ceae AUX cfg-update-1.8.2-xxdiff-to-beediff.patch 2644 RMD160 47258fb6bd82abcd741dd39e220fb8b0d3fa6c1c SHA1 b1bdf09f49b086a18801f7fa9f8da38f429e9bbf SHA256 e588a3ac4223f3f4f94deb0819076e21ed61691fc6c3fc7a61ef44160b746c2e DIST cfg-update-1.8.0-r6.tar.gz 36273 RMD160 32d2ff4c78ac296b1fe671c899210ff339cfd356 SHA1 9b0ae2829cd78965d0d089d8c03505a76ad1a236 SHA256 3ddf61c9720f201422747f7d19b709f115cc39ad9ca2672fe52d9eb0abc83c0e DIST cfg-update-1.8.2-r1.tar.gz 164899 RMD160 d1271c5803460894246fecf0d067d819372c29f1 SHA1 61f3667a310d423b8343ecb37fd3c666adb233bd SHA256 8798a6009f7459e3c6cc3e71282389b16054f208ab8de0dd65eb4e853631a094 EBUILD cfg-update-1.8.0-r6.ebuild 2294 RMD160 6348670bb741ab6bee40003c935b8203070677d1 SHA1 7777c7f24eafb25c6ef13128418d94251f1b0f21 SHA256 fb809155b2a08797fc19baf16e531dcf19988cd53a9947a6be15767d88cad585 EBUILD cfg-update-1.8.2-r1.ebuild 3507 RMD160 31a2e71bd16c2ee6a4b0bd1a2ab46f29e47a4a97 SHA1 293c84eda0b4adef3e57f70ec61202f59f92b655 SHA256 9b780f6944c2a62ffdc7fe07cbdaa28766e4c0846d73bccad6aa86157caf4ed6 -EBUILD cfg-update-1.8.2-r2.ebuild 3596 RMD160 000cb142b2683609b8dc15af11ae32f552b8ed06 SHA1 dd1af9253d1f5dbd16ba29d450f73d9dedf8d93a SHA256 a7c0018e19b4fcc4804b66865508fed105abe3bd8488f82ac2172398b3c61758 -MISC ChangeLog 3445 RMD160 5c61c4c77abf449b7c6b6f4a28df0e9041936c8a SHA1 a7925ef52cd62f7201cd7f6549c8f986dca255c1 SHA256 10153dcde99a98b06178ae5f8810ce66d6d27b8694647cc9986962193d9cd51c +EBUILD cfg-update-1.8.2-r2.ebuild 3634 RMD160 4a7260620c7adccbac6724e8bf47a4910569380b SHA1 d1cf49a9019a818382068502081c4df99453b87d SHA256 9bec8aa73b9de0a79e4196c7c36b1ffc3f9c1d687382ada5a1645f033a6816c8 +MISC ChangeLog 3651 RMD160 d80d9b34444dc32b91885aed73cdebf9579e1830 SHA1 b82efec9450f5c522ba0c9b7178475253ce12790 SHA256 1139da8848a315ff0d43e2ac4b2db626d71e905e26a974a61a3fe0cf188e4986 MISC metadata.xml 250 RMD160 61af8ec7e1bf9941d107eff4cc6a639874a6f198 SHA1 7ea68a3bd071637e4a49b61b2f7e35f3277545ef SHA256 aec181c304bce77cce8f1dc110e0203bc06b7c524ab40b1aac19a6f72aefdfde +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.15 (GNU/Linux) + +iEYEARECAAYFAkw49LgACgkQwnQyISwouHz8RQCdEKQAY2oKg8vbFSZDmuG4zETb +EJ8AoJGGwymyd/F8DJdW0sjxY55EiBPz +=yKjf +-----END PGP SIGNATURE----- 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 { -- 2.26.2