summaryrefslogtreecommitdiff
path: root/tests/pretend-pbuilder
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-07-31 14:04:58 +0800
committerSean Whitton <spwhitton@spwhitton.name>2018-07-31 14:04:58 +0800
commit3c5614c2292cb2fa1c50915d18510f5c2c915b76 (patch)
tree37703aa7eda0ad83849308db586566c1f23d6fae /tests/pretend-pbuilder
parente21dbf9b02e32aec335262b2999686c37f01ba00 (diff)
parentf052e1326357a6365a5eddbb985a5b1ef9b4fdb2 (diff)
Merge tag 'debian/6.2' into stretch-bpo
dgit release 6.2 for unstable (sid) [dgit] [dgit distro=debian] # gpg: Signature made Sun 29 Jul 2018 08:02:30 PM CST # gpg: using RSA key 559AE46C2D6B6D3265E7CBA1E3E3392348B50D39 # gpg: Can't check signature: No public key
Diffstat (limited to 'tests/pretend-pbuilder')
-rwxr-xr-xtests/pretend-pbuilder26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/pretend-pbuilder b/tests/pretend-pbuilder
new file mode 100755
index 0000000..8495a2f
--- /dev/null
+++ b/tests/pretend-pbuilder
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+
+my $operation = shift;
+die "pbuilder: you should use me only to build, dgit"
+ unless ($operation eq "build" || $operation eq "b");
+
+my $debbuildopts = undef;
+my $distribution = undef;
+GetOptions('debbuildopts=s' => \$debbuildopts,
+ 'distribution=s' => \$distribution);
+
+# ignore user args; last argument has to be the .dsc filename
+my $dsc = $ARGV[-1];
+die "pbuilder: last argument has wrong file extension"
+ unless ($dsc =~ m/^(.*)_.*\.dsc$/);
+
+system "dpkg-source -x $dsc pbuilder";
+chdir 'pbuilder';
+system <<END
+dpkg-buildpackage --changes-option=-DDistribution=$distribution $debbuildopts
+END