]> git.michaelhowe.org Git - packages/m/mh-sysadmin-tools.git/commitdiff
More build-package improvements: master
authorMichael Howe <michael@michaelhowe.org>
Tue, 26 Dec 2023 09:53:11 +0000 (09:53 +0000)
committerMichael Howe <michael@michaelhowe.org>
Tue, 26 Dec 2023 09:53:11 +0000 (09:53 +0000)
* build-package: add --no-sign option to avoid signing changes files
* 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

bin/build-package
bin/build-package-multi
debian/changelog

index c8af9013aa6cf78ea3ffde8b9f332f6fef64eca2..d3bbb44841f0b203f0f11a51ca0c0be66f4ffdda 100755 (executable)
@@ -10,6 +10,7 @@ use Cwd;
 use Dpkg::Control;
 use Dpkg::Changelog;
 use File::Basename;
+use Net::Domain qw(hostfqdn);
 
 use Data::Dumper;
 
@@ -32,6 +33,7 @@ my $dsc;     # optional; allows use of a dsc directly
 my $os = 'debian';
 my $binary_only;
 my $local_outputdir;
+my $no_sign;
 
 GetOptions(
     "arch=s"    => \@archs,
@@ -40,6 +42,7 @@ GetOptions(
     "dsc=s"     => \$dsc,
     'binary-only'   => \$binary_only,
     "output-dir=s"  => \$local_outputdir,
+    "no-sign"   => \$no_sign,
 );
 
 my $path = $ARGV[0];
@@ -173,16 +176,30 @@ system( @rsynccmd ) == 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" ){
index 355fc7eb26282cd1c5bdfe724302854929547e59..58be2665850764b9b84d0d40e064e0c97db9d699 100755 (executable)
@@ -24,7 +24,7 @@ for BUILDSTRING in "${BUILD_ARRAY[@]}"; do
     ARCH=${BUILDSTRING%:*}
     ARCH=${ARCH##*:}
     OS=${BUILDSTRING##*:}
-    $BUILDPACKAGE --dist "$DIST" --arch "$ARCH" --os "$OS" --output-dir "$OUTPUTDIR" .
+    $BUILDPACKAGE --dist "$DIST" --arch "$ARCH" --os "$OS" --output-dir "$OUTPUTDIR" --no-sign .
     CHANGELIST="${CHANGELIST} ${OUTPUTDIR}/*_${ARCH}.changes"
 done
 
index 7ad6c2532cf3000029768fb8f99fbffb06554871..c4eb007a46bdf54800b4dbf5732aacab9eda5d89 100644 (file)
@@ -1,3 +1,11 @@
+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