our $suite_re = '[-+.0-9a-z]+';
our $cleanmode_re = qr{(?: dpkg-source (?: -d )? (?: ,no-check | ,all-check )?
- | (?: git | git-ff )
+ | (?: git | git-ff ) (?: ,always )?
| check (?: ,ignores )?
| none
)}x;
"tree contains uncommitted files (NB dgit didn't run rules clean)";
} elsif ($cleanmode =~ m{^git}) {
clean_tree_check_git 1, __
- "tree contains uncommited, untracked, unignored files", '';
+ "tree contains uncommited, untracked, unignored files\n".
+ "You can use --clean=git[-ff],always (-wga/-wgfa) to delete them.", '';
} elsif ($cleanmode eq 'none') {
} else {
confess "$cleanmode ?";
my ($wantsrc) = @_;
build_prep_early();
check_bpd_exists();
- if (!building_source_in_playtree() || ($wantsrc & WANTSRC_BUILDER)) {
+ if (!building_source_in_playtree() || ($wantsrc & WANTSRC_BUILDER)
# Clean the tree because we're going to use the contents of
# $maindir. (We trying to include dirty changes in the source
# package, or we are running the builder in $maindir.)
+ || $cleanmode =~ m{always}) {
+ # Or because the user asked us to.
clean_tree();
} else {
# We don't actually need to do anything in $maindir, but we