aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ Pipkin <j@dawnrazor.net>2013-03-02 02:19:59 -0600
committerJ Pipkin <j@dawnrazor.net>2013-03-02 02:19:59 -0600
commit2483cc672c72ef8182035d65de1593dca8b94267 (patch)
tree37f23ee1e7579e839d61fc7786986edd5dfbcd3c
parenta703387bceaa58be91ade36f1cf3473cb3939f3e (diff)
downloadsbotools2-2483cc672c72ef8182035d65de1593dca8b94267.tar.xz
warn anything TMP is set, not just when TMP == /tmp
-rwxr-xr-xsboclean7
1 files changed, 4 insertions, 3 deletions
diff --git a/sboclean b/sboclean
index 61c47fc..4a2c131 100755
--- a/sboclean
+++ b/sboclean
@@ -89,9 +89,10 @@ sub clean_c32() {
remove_stuff $config{SBO_HOME} .'/distfiles' if $clean_dist;
if ($clean_work) {
- my $tsbo = $SBO::Lib::env_tmp ? $SBO::Lib::env_tmp : "$SBO::Lib::tmpd/SBo";
- if ($tsbo =~ qr#^/tmp(|/)$# && !$interactive) {
- warn "This will remove the entire contents of /tmp\n";
+ my $env_tmp = $SBO::Lib::env_tmp;
+ my $tsbo = $env_tmp ? $env_tmp : "$SBO::Lib::tmpd/SBo";
+ if ($env_tmp && !$interactive) {
+ warn "This will remove the entire contents of $env_tmp\n";
print "Proceed? [y] ";
remove_stuff $tsbo if <STDIN> =~ /^[yY\n]/;
} else {