chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dgit: build_source: drop call to build_prep
[dgit.git]
/
dgit
diff --git
a/dgit
b/dgit
index eca2303e86add5d5aa9677fc5cff529b97eddc81..db52f91ef04a04c4deb2179c04f006bf1cb02975 100755
(executable)
--- a/
dgit
+++ b/
dgit
@@
-166,7
+166,7
@@
our $keyid;
autoflush STDOUT 1;
our $supplementary_message = '';
autoflush STDOUT 1;
our $supplementary_message = '';
-our $need_split_build_invocation =
0
;
+our $need_split_build_invocation =
1
;
our $split_brain = 0;
END {
our $split_brain = 0;
END {
@@
-4756,8
+4756,14
@@
sub cmd_push {
dopush();
}
dopush();
}
+our $sourcechanges;
+
sub cmd_push_source {
prep_push();
sub cmd_push_source {
prep_push();
+ fail "dgit push-source: --include-dirty/--ignore-dirty does not make".
+ "sense with push-source!" if $includedirty;
+ clean_tree();
+ build_maybe_quilt_fixup();
if ($changesfile) {
my $changes = parsecontrol("$buildproductsdir/$changesfile",
"source changes file");
if ($changesfile) {
my $changes = parsecontrol("$buildproductsdir/$changesfile",
"source changes file");
@@
-4766,7
+4772,10
@@
sub cmd_push_source {
}
} else {
# Building a source package is very fast, so just do it
}
} else {
# Building a source package is very fast, so just do it
- build_source_for_push();
+ build_source();
+ die "er, patches are applied dirtily but shouldn't be.."
+ if $patches_applied_dirtily;
+ $changesfile = $sourcechanges;
}
dopush();
}
}
dopush();
}
@@
-5060,7
+5069,6
@@
sub i_want_signed_dsc_changes {
#---------- building etc. ----------
our $version;
#---------- building etc. ----------
our $version;
-our $sourcechanges;
our $dscfn;
#----- `3.0 (quilt)' handling -----
our $dscfn;
#----- `3.0 (quilt)' handling -----
@@
-6106,6
+6114,10
@@
sub cmd_clean () {
maybe_unapply_patches_again();
}
maybe_unapply_patches_again();
}
+# return values from massage_dbp_args are one or both of these flags
+sub WANTSRC_SOURCE () { 01; } # caller should build source (separately)
+sub WANTSRC_BUILDER () { 02; } # caller should run dpkg-buildpackage
+
sub build_or_push_prep_early () {
our $build_or_push_prep_early_done //= 0;
return if $build_or_push_prep_early_done++;
sub build_or_push_prep_early () {
our $build_or_push_prep_early_done //= 0;
return if $build_or_push_prep_early_done++;
@@
-6181,10
+6193,6
@@
sub changesopts () {
return (changesopts_initial(), changesopts_version());
}
return (changesopts_initial(), changesopts_version());
}
-# return values from massage_dbp_args are one or both of these flags
-sub WANTSRC_SOURCE () { 01; } # caller should build source (separately)
-sub WANTSRC_BUILDER () { 02; } # caller should run dpkg-buildpackage
-
sub massage_dbp_args ($;$) {
my ($cmd,$xargs) = @_;
# We need to:
sub massage_dbp_args ($;$) {
my ($cmd,$xargs) = @_;
# We need to:
@@
-6247,7
+6255,7
@@
sub postbuild_mergechanges ($) {
# or if that is undef, be a no-op.
# Returns the changes file to report to the user.
my $pat = changespat $version;
# or if that is undef, be a no-op.
# Returns the changes file to report to the user.
my $pat = changespat $version;
- my @changesfiles = glob $pat;
+ my @changesfiles = g
rep { !m/_multi\.changes/ } g
lob $pat;
@changesfiles = sort {
($b =~ m/_source\.changes$/ <=> $a =~ m/_source\.changes$/)
or $a cmp $b
@changesfiles = sort {
($b =~ m/_source\.changes$/ <=> $a =~ m/_source\.changes$/)
or $a cmp $b
@@
-6284,7
+6292,10
@@
sub midbuild_checkchanges () {
my $pat = changespat $version;
return if $rmchanges;
my @unwanted = map { s#.*/##; $_; } glob "$bpd_glob/$pat";
my $pat = changespat $version;
return if $rmchanges;
my @unwanted = map { s#.*/##; $_; } glob "$bpd_glob/$pat";
- @unwanted = grep { $_ ne changespat $version,'source' } @unwanted;
+ @unwanted = grep {
+ $_ ne changespat $version,'source' and
+ $_ ne changespat $version,'multi'
+ } @unwanted;
fail <<END
changes files other than source matching $pat already present; building would result in ambiguity about the intended results.
Suggest you delete @unwanted.
fail <<END
changes files other than source matching $pat already present; building would result in ambiguity about the intended results.
Suggest you delete @unwanted.
@@
-6312,11
+6323,10
@@
sub cmd_build {
build_prep_early();
my @dbp = (@dpkgbuildpackage, qw(-us -uc), changesopts_initial(), @ARGV);
my $wantsrc = massage_dbp_args \@dbp;
build_prep_early();
my @dbp = (@dpkgbuildpackage, qw(-us -uc), changesopts_initial(), @ARGV);
my $wantsrc = massage_dbp_args \@dbp;
+ build_prep();
if ($wantsrc & WANTSRC_SOURCE) {
build_source();
midbuild_checkchanges_vanilla $wantsrc;
if ($wantsrc & WANTSRC_SOURCE) {
build_source();
midbuild_checkchanges_vanilla $wantsrc;
- } else {
- build_prep();
}
if ($wantsrc & WANTSRC_BUILDER) {
push @dbp, changesopts_version();
}
if ($wantsrc & WANTSRC_BUILDER) {
push @dbp, changesopts_version();
@@
-6385,6
+6395,7
@@
sub cmd_gbp_build {
}
}
}
}
+ build_prep();
if ($wantsrc & WANTSRC_SOURCE) {
build_source();
midbuild_checkchanges_vanilla $wantsrc;
if ($wantsrc & WANTSRC_SOURCE) {
build_source();
midbuild_checkchanges_vanilla $wantsrc;
@@
-6392,7
+6403,6
@@
sub cmd_gbp_build {
if (!$clean_using_builder) {
push @cmd, '--git-cleaner=true';
}
if (!$clean_using_builder) {
push @cmd, '--git-cleaner=true';
}
- build_prep();
}
maybe_unapply_patches_again();
if ($wantsrc & WANTSRC_BUILDER) {
}
maybe_unapply_patches_again();
if ($wantsrc & WANTSRC_BUILDER) {
@@
-6403,15
+6413,7
@@
sub cmd_gbp_build {
}
sub cmd_git_build { cmd_gbp_build(); } # compatibility with <= 1.0
}
sub cmd_git_build { cmd_gbp_build(); } # compatibility with <= 1.0
-sub build_source_for_push {
- build_source();
- maybe_unapply_patches_again();
- $changesfile = $sourcechanges;
-}
-
sub build_source {
sub build_source {
- build_prep_early();
- build_prep();
$sourcechanges = changespat $version,'source';
if (act_local()) {
unlink "$buildproductsdir/$sourcechanges" or $!==ENOENT
$sourcechanges = changespat $version,'source';
if (act_local()) {
unlink "$buildproductsdir/$sourcechanges" or $!==ENOENT
@@
-6448,14
+6450,15
@@
sub build_source {
}
sub cmd_build_source {
}
sub cmd_build_source {
- build_prep_early();
badusage "build-source takes no additional arguments" if @ARGV;
badusage "build-source takes no additional arguments" if @ARGV;
+ build_prep();
build_source();
maybe_unapply_patches_again();
printdone "source built, results in $dscfn and $sourcechanges";
}
sub cmd_sbuild {
build_source();
maybe_unapply_patches_again();
printdone "source built, results in $dscfn and $sourcechanges";
}
sub cmd_sbuild {
+ build_prep(); # not BUILDER because sbuild uses the .dsc
build_source();
midbuild_checkchanges();
in_bpd {
build_source();
midbuild_checkchanges();
in_bpd {
@@
-6864,7
+6867,7
@@
sub parseopts () {
} elsif (m/^--(gbp|dpm)$/s) {
push @ropts, "--quilt=$1";
$quilt_mode = $1;
} elsif (m/^--(gbp|dpm)$/s) {
push @ropts, "--quilt=$1";
$quilt_mode = $1;
- } elsif (m/^--
ignore
-dirty$/s) {
+ } elsif (m/^--
(?:ignore|include)
-dirty$/s) {
push @ropts, $_;
$includedirty = 1;
} elsif (m/^--no-quilt-fixup$/s) {
push @ropts, $_;
$includedirty = 1;
} elsif (m/^--no-quilt-fixup$/s) {
@@
-7067,6
+7070,9
@@
sub parseopts_late_defaults () {
$need_split_build_invocation ||= quiltmode_splitbrain();
$need_split_build_invocation ||= quiltmode_splitbrain();
+ fail "dgit: --include-dirty is not supported in split view quilt mode"
+ if $split_brain && $includedirty;
+
if (!defined $cleanmode) {
local $access_forpush;
$cleanmode = access_cfg('clean-mode', 'RETURN-UNDEF');
if (!defined $cleanmode) {
local $access_forpush;
$cleanmode = access_cfg('clean-mode', 'RETURN-UNDEF');