]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_clean
r421: use strict
[debhelper.git] / dh_clean
index 4b98a6a0430beb72279d59bc1f21bf4f0808b2ab..fb4e3a886ed89021c2589ec00cbd909eda888fdb 100755 (executable)
--- a/dh_clean
+++ b/dh_clean
@@ -1,24 +1,25 @@
 #!/usr/bin/perl -w
 #
-# Clean up $TMP and other tepmorary files generated by the
+# Clean up $tmp and other tepmorary files generated by the
 # build process.
 
+use strict;
 use Debian::Debhelper::Dh_Lib;
 init();
 
-foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
-       $TMP=tmpdir($PACKAGE);
-       $EXT=pkgext($PACKAGE);
+foreach my $package (@{$dh{DOPACKAGES}}) {
+       my $tmp=tmpdir($package);
+       my $ext=pkgext($package);
 
        if (! $dh{D_FLAG}) {
-               doit("rm","-f","debian/${EXT}substvars",
-                       "debian/${EXT}postinst.debhelper",
-                       "debian/${EXT}postrm.debhelper",
-                       "debian/${EXT}preinst.debhelper",
-                       "debian/${EXT}prerm.debhelper");
+               doit("rm","-f","debian/${ext}substvars",
+                       "debian/${ext}postinst.debhelper",
+                       "debian/${ext}postrm.debhelper",
+                       "debian/${ext}preinst.debhelper",
+                       "debian/${ext}prerm.debhelper");
        }
        
-       doit ("rm","-rf",$TMP);
+       doit ("rm","-rf",$tmp);
 }
 
 if (! $dh{D_FLAG}) {
@@ -31,10 +32,8 @@ if (! $dh{D_FLAG}) {
        }
 
        # See if some files that would normally be deleted are excluded.
-       if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') {
-               $find_options="";
-       }
-       else {
+       my $find_options='';
+       if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
                $find_options="-a ! ( $dh{EXCLUDE_FIND} )";
        }
 
@@ -50,6 +49,5 @@ if (! $dh{D_FLAG}) {
                ) $find_options -exec rm -f {} ;"));
 }
 
-doit('rm', '-rf', 'debian/tmp')
-       if -x 'debian/tmp' && ! Debian::Debhelper::Dh_Lib::compat(1);
+doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! compat(1);