setup: etc/profile.d/tmp-dir.csh, etc/profile.d/tmp-dir.sh - don't set TMPD...

arekm arekm at pld-linux.org
Tue Sep 9 12:51:27 CEST 2008


Author: arekm                        Date: Tue Sep  9 10:51:27 2008 GMT
Module: setup                         Tag: HEAD
---- Log message:
- don't set TMPDIR to ~/tmp if it doesn't exist

---- Files affected:
setup/etc/profile.d:
   tmp-dir.csh (1.5 -> 1.6) , tmp-dir.sh (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: setup/etc/profile.d/tmp-dir.csh
diff -u setup/etc/profile.d/tmp-dir.csh:1.5 setup/etc/profile.d/tmp-dir.csh:1.6
--- setup/etc/profile.d/tmp-dir.csh:1.5	Tue Apr  1 08:48:53 2008
+++ setup/etc/profile.d/tmp-dir.csh	Tue Sep  9 12:51:22 2008
@@ -1,5 +1,10 @@
-if ( `/bin/id -u` >= 500 && ! -d ~/tmp ) then
+# create ~/tmp for normal users
+if ( `/bin/id -u` >= 1000 && ! -d ~/tmp ) then
 	mkdir -p ~/tmp >& /dev/null
 	chmod -f og-rwx ~/tmp >& /dev/null
 endif
-setenv TMPDIR ~/tmp
+
+# if any user has ~/tmp then use it
+if ( -d ~/tmp ) then
+	setenv TMPDIR ~/tmp
+endif

================================================================
Index: setup/etc/profile.d/tmp-dir.sh
diff -u setup/etc/profile.d/tmp-dir.sh:1.6 setup/etc/profile.d/tmp-dir.sh:1.7
--- setup/etc/profile.d/tmp-dir.sh:1.6	Tue Apr  1 08:48:53 2008
+++ setup/etc/profile.d/tmp-dir.sh	Tue Sep  9 12:51:22 2008
@@ -1,6 +1,11 @@
-if [ $(/bin/id -u) -ge 500 -a ! -d ~/tmp ]; then
+# create ~/tmp for normal users
+if [ $(/bin/id -u) -ge 1000 -a ! -d ~/tmp ]; then
 	mkdir -p ~/tmp > /dev/null 2>&1
 	chmod -f og-rwx ~/tmp 2>/dev/null
 fi
-TMPDIR=~/tmp
-export TMPDIR
+
+# if any user has ~/tmp then use it
+if [ -d ~/tmp ]; then
+	TMPDIR=~/tmp
+	export TMPDIR
+fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/setup/etc/profile.d/tmp-dir.csh?r1=1.5&r2=1.6&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/setup/etc/profile.d/tmp-dir.sh?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list