use Dpkg::Control;
use Dpkg::Changelog;
use File::Basename;
+use Net::Domain qw(hostfqdn);
use Data::Dumper;
my $os = 'debian';
my $binary_only;
my $local_outputdir;
+my $no_sign;
GetOptions(
"arch=s" => \@archs,
"dsc=s" => \$dsc,
'binary-only' => \$binary_only,
"output-dir=s" => \$local_outputdir,
+ "no-sign" => \$no_sign,
);
my $path = $ARGV[0];
# Note that this currently won't work
#my @sshcleanupcmd = ( $ssh, "rm", "-rf", $remote_outputdir );
-my @changefiles = glob( "$local_outputdir/*.changes" );
+my @changefiles;
+my @all_changefiles = glob( "$local_outputdir/*.changes" );
+my @nonsrc_changefiles = grep( !/_source.changes/, @all_changefiles );
+if ( @nonsrc_changefiles ){
+ @changefiles = @nonsrc_changefiles;
+} else {
+ @changefiles = @all_changefiles;
+}
-foreach my $changefile ( @changefiles ){
- my @debsigncmd = ( $debsign, @debsign_opts, $changefile );
- print "Signing $changefile\n";
- system( @debsigncmd ) == 0
- or warn "Could not sign changes file $changefile: $!";
+if( $no_sign ){
+ print "\nNot signing changes files - if needing to do so remotely, run:\n";
+ foreach my $changefile( @changefiles ){
+ print "\tdebsign -r " . hostfqdn() . " $changefile\n";
+ }
+} else {
+ foreach my $changefile ( @changefiles ){
+ my @debsigncmd = ( $debsign, @debsign_opts, $changefile );
+ print "Signing $changefile\n";
+ system( @debsigncmd ) == 0
+ or warn "Could not sign changes file $changefile: $!";
+ }
}
-print "Build complete in $local_outputdir\n";
+print "\nBuild complete in $local_outputdir\n";
sub get_source_format {
unless( -f "debian/source/format" ){
+mh-sysadmin-tools (1.7~test.0) UNRELEASED; urgency=medium
+
+ * build-package: add --no-sign option to avoid signing changes files
+ * build-package: only sign source changes files if no others available
+ * build-package-multi: use --no-sign option
+
+ -- Michael Howe <michael@michaelhowe.org> Tue, 26 Dec 2023 09:49:56 +0000
+
mh-sysadmin-tools (1.6) unstable; urgency=low
* build-package: new script for package building via cowbuilder/pbuilder