Make emerge-webrsync use renice for cleaner PORTAGE_NICENESS handling (bug #124621).
authorZac Medico <zmedico@gentoo.org>
Thu, 2 Mar 2006 19:10:47 +0000 (19:10 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 2 Mar 2006 19:10:47 +0000 (19:10 -0000)
svn path=/main/trunk/; revision=2806

bin/emerge-webrsync

index 5f8aa67f01cc9c751f208d59ee45351e4528f388..ec4e59231a66fc9fc6c2807112fa7463dcb4e3b1 100755 (executable)
@@ -5,13 +5,11 @@
 # Author: Karl Trygve Kalleberg <karltk@gentoo.org>
 # Rewritten from the old, Perl-based emerge-webrsync script
 
-if [ -z "$PORTAGE_NICENESS" ]; then
-       PORTAGE_NICENESS="$(/usr/lib/portage/bin/portageq envvar PORTAGE_NICENESS)"
-       if [ -n "$PORTAGE_NICENESS" ]; then
-               export PORTAGE_NICENESS
-               exec nice -n $PORTAGE_NICENESS "$0" "$@"
-               echo "failed pulling PORTAGE_NICENESS, disabling"
-       fi
+# If PORTAGE_NICENESS is overriden via the env then it will
+# still pass through the portageq call and override properly.
+PORTAGE_NICENESS="$(/usr/lib/portage/bin/portageq envvar PORTAGE_NICENESS)"
+if [ -n "${PORTAGE_NICENESS}" ]; then
+       renice $PORTAGE_NICENESS $$ > /dev/null
 fi
 
 GENTOO_MIRRORS="${GENTOO_MIRRORS} $(/usr/lib/portage/bin/portageq gentoo_mirrors)"