- $isuite = $clogp->{Distribution};
- $package = $clogp->{Source};
- canonicalise_suite() unless grep { m/^--git-debian-branch/ } @ARGV;
- runcmd_ordryrun
- qw(git-buildpackage -us -uc --git-no-sign-tags),
- '--git-builder=dpkg-buildpackage -i\.git/ -I.git',
- "--git-debian-branch=".lbranch(),
- @ARGV;
+ $isuite = getfield $clogp, 'Distribution';
+ $package = getfield $clogp, 'Source';
+ $version = getfield $clogp, 'Version';
+ build_maybe_quilt_fixup();
+ my @cmd =
+ (qw(git-buildpackage -us -uc --git-no-sign-tags),
+ "--git-builder=@dpkgbuildpackage");
+ unless (grep { m/^--git-debian-branch/ } @ARGV) {
+ canonicalise_suite();
+ push @cmd, "--git-debian-branch=".lbranch();
+ }
+ push @cmd, changesopts();
+ runcmd_ordryrun @cmd, @ARGV;
+ printdone "build successful\n";
+}
+
+sub build_source {
+ badusage "-p is not allowed with this action" if defined $package;
+ check_not_dirty();
+ my $clogp = parsechangelog();
+ $package = getfield $clogp, 'Source';
+ $isuite = getfield $clogp, 'Distribution';
+ $version = getfield $clogp, 'Version';
+ $sourcechanges = "${package}_${version}_source.changes";
+ $dscfn = dscfn($version);
+ build_maybe_quilt_fixup();
+ if ($cleanmode eq 'dpkg-source') {
+ runcmd_ordryrun (@dpkgbuildpackage, qw(-us -uc -S)), changesopts();
+ } else {
+ if ($cleanmode eq 'git') {
+ runcmd_ordryrun @git, qw(clean -xdf);
+ } elsif ($cleanmode eq 'none') {
+ } else {
+ die "$cleanmode ?";
+ }
+ my $pwd = cmdoutput qw(env - pwd);
+ my $leafdir = basename $pwd;
+ chdir ".." or die $!;
+ runcmd_ordryrun @dpkgsource, qw(-b --), $leafdir;
+ chdir $pwd or die $!;
+ runcmd_ordryrun qw(sh -ec),
+ 'exec >$1; shift; exec "$@"','x',
+ "../$sourcechanges",
+ @dpkggenchanges, qw(-S), changesopts();
+ }