summaryrefslogtreecommitdiff
path: root/dh_clean
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-10-03 15:14:32 -0400
committerJoey Hess <joey@kitenet.net>2014-10-03 15:15:15 -0400
commit14b2527835f75935fc47ab5c6f723269a5f57286 (patch)
tree46c53241a3bdd70108677c62d59b6a83eada0971 /dh_clean
parente56fb330555a175e20c2e5cce60fe8cfe4898b5d (diff)
dh_clean: Skip over .git, .svn, .bzr, .hg, and CVS directories and avoid cleaning their contents. Closes: #760033
I don't much like debhelper needing to contain yet another copy of every bit of vcs cruft known to man; at least this only needs to be the directories and not other dotfiles.
Diffstat (limited to 'dh_clean')
-rwxr-xr-xdh_clean7
1 files changed, 6 insertions, 1 deletions
diff --git a/dh_clean b/dh_clean
index 931dd21..85f87f2 100755
--- a/dh_clean
+++ b/dh_clean
@@ -122,8 +122,13 @@ if (! $dh{D_FLAG}) {
$find_options="! \\( $dh{EXCLUDE_FIND} \\) -a";
}
+ # vcs directories that should not have their contents cleaned
+ my $vcs_dirs=join " -o ", map { "-path .\\*/" . $_ }
+ (".git", ".svn", ".bzr", ".hg", "CVS");
+
# Remove other temp files.
- complex_doit("find . $find_options \\( \\( -type f -a \\
+ complex_doit("find . $find_options \\( \\( \\
+ \\( $vcs_dirs \\) -prune -o -type f -a \\
\\( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \\
-o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \\
-o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \\