added PORTAGE_NICENESS support.
authorBrian Harring <ferringb@gentoo.org>
Thu, 2 Feb 2006 11:58:22 +0000 (11:58 -0000)
committerBrian Harring <ferringb@gentoo.org>
Thu, 2 Feb 2006 11:58:22 +0000 (11:58 -0000)
svn path=/main/trunk/; revision=2623

bin/emerge-webrsync

index ffba8801695a8a979e480a4977524d5f35a9f9ff..f68d0265b8ba2bc316c503a79d9e1dd57bd1b992 100755 (executable)
@@ -5,6 +5,15 @@
 # Author: Karl Trygve Kalleberg <karltk@gentoo.org>
 # Rewritten from the old, Perl-based emerge-webrsync script
 
+if [ -z "$PULLED_NICENESS" ]; then
+       PULLED_NICENESS="$(/usr/lib/portage/bin/portageq envvar PORTAGE_NICENESS)"
+       if [ -n "$PULLED_NICENESS" ]; then
+               export PULLED_NICENESS
+               exec nice -n $PORTAGE_NICENESS "$0" "$@"
+               echo "failed pulling PORTAGE_NICENESS, disabling"
+       fi
+fi
+
 GENTOO_MIRRORS="${GENTOO_MIRRORS} $(/usr/lib/portage/bin/portageq gentoo_mirrors)"
 PORTDIR="$(/usr/lib/portage/bin/portageq portdir)"
 FETCHCOMMAND="$(/usr/lib/portage/bin/portageq envvar FETCHCOMMAND)"