summaryrefslogtreecommitdiff
path: root/app-portage/cfg-update/files/cfg-update-1.8.2-bashrc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-portage/cfg-update/files/cfg-update-1.8.2-bashrc.patch')
-rw-r--r--app-portage/cfg-update/files/cfg-update-1.8.2-bashrc.patch51
1 files changed, 51 insertions, 0 deletions
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 00000000000..73fe9b83103
--- /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 {