first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[ira/wip.git] / packaging / SGI / sambalp
index fd0cef8f93308512a059209daae2843caebbe60b..61e62215c91b4463234fbc2876bd36fb421aea8e 100644 (file)
@@ -146,5 +146,12 @@ if ($PSFIX) {                      # are we running a "psfix"?
     system("$lpcommand $file");
 }
 
-# Remove the file only if it lives in /usr/tmp, /tmp, or /var/tmp.
-unlink($file) if $file =~ m=^(/(usr|var))?/tmp=;
+if ($file =~ m(^/)) {
+       # $file is a fully specified path
+       # Remove the file only if it lives in a directory ending in /tmp.
+       unlink($file) if ($file =~ m(/tmp/[^/]+$));
+} else {
+       # $file is NOT a fully specified path
+       # Remove the file only if current directory ends in /tmp.
+       unlink($file) if (`pwd` =~ m(/tmp$));
+}