File: pretend-pbuilder

package info (click to toggle)
dgit 12.16
  • links: PTS, VCS
  • area: main
  • in suites: trixie-proposed-updates
  • size: 3,368 kB
  • sloc: perl: 13,443; sh: 6,466; python: 334; makefile: 324; tcl: 69
file content (27 lines) | stat: -rwxr-xr-x 684 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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)
    or die;

# 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