-sub build_source_for_push {
- build_source();
- maybe_unapply_patches_again();
- $changesfile = $sourcechanges;
+sub move_dsc_to_bpd ($) {
+ my ($dscfn) = @_;
+ printdebug "moving $dscfn and all referenced files to ".bpd_abs()."\n";
+ $dsc = parsecontrol($dscfn, "source package");
+ foreach my $l (split /\n/, getfield $dsc, 'Files') {
+ $l =~ m/\S+$/ or next;
+ $l =~ s/.* //;
+ printdebug "found $l - renaming\n";
+ rename "$l", bpd_abs()."/$l"
+ or fail "put in place new source file ($l): $!";
+ }
+ printdebug "moving $dscfn to ".bpd_abs()."/$dscfn\n";
+ rename "$dscfn", bpd_abs()."/$dscfn"
+ or fail "put in place new source file ($dscfn): $!";
+}
+
+sub building_source_in_playtree {
+ # If $includedirty, we have to build the source package from the
+ # working tree, not a playtree, so that uncommitted changes are
+ # included (copying or hardlinking them into the playtree could
+ # cause trouble).
+ #
+ # Note that if we are building a source package in split brain
+ # mode we do not support including uncommitted changes, because
+ # that makes quilt fixup too hard. I.e. ($split_brain && (dgit is
+ # building a source package)) => !$includedirty
+ return !$includedirty;