From: fuzzyray Date: Sun, 3 Sep 2006 21:26:12 +0000 (-0000) Subject: Check for permissions to write temporary files. Bug #142308 X-Git-Tag: gentoolkit-0.2.4.3~200 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4c78536938d77a8e4802bd6006e64e8cb85f3d6c;p=gentoolkit.git Check for permissions to write temporary files. Bug #142308 svn path=/; revision=313 --- diff --git a/trunk/src/revdep-rebuild/revdep-rebuild b/trunk/src/revdep-rebuild/revdep-rebuild index 94a3f45..9093b40 100755 --- a/trunk/src/revdep-rebuild/revdep-rebuild +++ b/trunk/src/revdep-rebuild/revdep-rebuild @@ -135,7 +135,25 @@ done NOCOLOR=$(portageq envvar NOCOLOR) # Base of temporary files names. -LIST=~/.revdep-rebuild +touch ${HOME}/.revdep-rebuild_0.test 2>/dev/null +if [ $? -eq 0 ] +then + LIST="${HOME}/.revdep-rebuild" + rm ~/.revdep-rebuild_0.test +else + # Try to use /var/tmp since $HOME is not available + touch /var/tmp/.revdep-rebuild_0.test 2>/dev/null + if [ $? -eq 0 ] + then + LIST="/var/tmp/.revdep-rebuild" + rm /var/tmp/.revdep-rebuild_0.test + else + echo + echo "!!! Unable to write temporary files to either $HOME or /var/tmp !!!" + echo + exit 1 + fi +fi shopt -s nullglob shopt -s expand_aliases