diff options
author | joey <joey> | 1999-08-17 04:58:27 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 04:58:27 +0000 |
commit | 031868f3f6f1e1ff042f6c01d350d6bd260e4c9f (patch) | |
tree | 11b7a73bf4f427da1c10c3d95866fcff33ed6783 /dh_clean | |
parent | 2de581368c8b8d4edd57210dc54eade8c15f0354 (diff) | |
download | debhelper-031868f3f6f1e1ff042f6c01d350d6bd260e4c9f.tar.gz |
r113: Initial Import
Diffstat (limited to 'dh_clean')
-rwxr-xr-x | dh_clean | 51 |
1 files changed, 30 insertions, 21 deletions
@@ -1,28 +1,37 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Clean up $TMP and other tepmorary files generated by the # build process. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - substvars=`pkgfile $PACKAGE substvars` - if [ "$substvars" ]; then - doit "rm -f $substvars" - fi - doit "rm -rf $TMP" -done -doit "rm -f debian/*.debhelper $*" -if [ ! "$DH_K_FLAG" ]; then - doit "rm -f debian/files*" -fi +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $EXT=pkgext($PACKAGE); + + 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); +} + +if (@ARGV) { + doit("rm","-f","--",@ARGV); +} + +if (! $dh{K_FLAG}) { + doit("rm","-f","debian/files*"); +} # Remove other temp files. -# Use complex_doit so we can properly escape things. -complex_doit "find . \( -name '#*#' -o -name '*~' -o -name DEADJOE \ - -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \ - -o -name '.*.orig' -o -name '.*.rej' -o -name .SUMS \ - -o -name TAGS -o -name core \ - \) -exec rm -f {} \;" +# (The \s+ is important, \s won't work because find would get null parameters). +doit(split(/\s+/,"find . ( -name #*# -o -name *~ -o -name DEADJOE + -o -name *.orig -o -name *.rej -o -name *.bak + -o -name .*.orig -o -name .*.rej -o -name .SUMS + -o -name TAGS -o -name core + ) -exec rm -f {} ;")); |