]> git.michaelhowe.org Git - packages/m/mh-sysadmin-tools.git/commitdiff
assorted build-package improvements
authorMichael Howe <michael@michaelhowe.org>
Tue, 26 Dec 2023 00:00:20 +0000 (00:00 +0000)
committerMichael Howe <michael@michaelhowe.org>
Tue, 26 Dec 2023 00:00:20 +0000 (00:00 +0000)
Mostly adapted from the uncommitted version I've had for a while

bin/build-package
debian/changelog

index e6a7ffc0ca53bfcf40a14b46c328136fd1f2a1b0..c8af9013aa6cf78ea3ffde8b9f332f6fef64eca2 100755 (executable)
@@ -14,13 +14,13 @@ use File::Basename;
 use Data::Dumper;
 
 my $svn = "/usr/bin/svn";
-my $cp = "/bin/cp";
+my $cp = "/usr/bin/rsync";
 my $dpkgsource = "/usr/bin/dpkg-source";
 my $cowpoke = "/usr/bin/cowpoke";
 my $rsync = "/usr/bin/rsync";
 my $debsign = "/usr/bin/debsign";
 my @debsign_opts = ();
-my @cowpoke_opts = qw(--dpkg-opts='-sa');
+my @cowpoke_opts = ();
 my @orig_compression_types = qw(bz2 gz lzma xz);
 
 my $buildhost = "wowbagger.internal.michaelhowe.org";
@@ -77,7 +77,7 @@ if( $dsc ){
     if ( -d ".svn" ){ 
         @exportcmd = ( $svn, 'export', $path, "$exportdir/export" );
     } else {
-        @exportcmd = ( $cp, "-a", $path, "$exportdir/export" );
+        @exportcmd = ( $cp, "--exclude=.git", "-a", $path, "$exportdir/export" );
     }
 }
 
@@ -96,7 +96,7 @@ if( $format =~ m{quilt} ){
     }
     foreach my $file ( @origfiles ){
         # should only copy one?
-        my @cpcmd = ( $cp, "-a", $file, $exportdir );
+        my @cpcmd = ( $cp, "-a", "-L", $file, $exportdir );
         print "Running `@cpcmd`\n";
         system( @cpcmd ) == 0
             or die "Could not run copy command: $!";
@@ -150,8 +150,11 @@ if( $binary_only ){
 
 my @cowpokecmd = ( $cowpoke, $archcmds, $distcmds, @cowpoke_opts, $dscfile );
 print "Running @cowpokecmd";
-system( @cowpokecmd ) == 0
-    or die "Could not run cowpoke: $!";
+unless ( system( @cowpokecmd ) == 0 ){
+    warn "Cowpoke failed: $!\n";
+    unlink("cowssh_it");
+    exit 1;
+}
 
 if( $local_outputdir ){
     if( ! -d $local_outputdir ){
@@ -161,7 +164,7 @@ if( $local_outputdir ){
     $local_outputdir = tempdir( DIR => $workingdir );
 }
 
-my @rsynccmd = ( $rsync, "-az", "$buildhost:$remote_outputdir/", "$local_outputdir/" );
+my @rsynccmd = ( $rsync, "--copy-links", "-az", "$buildhost:$remote_outputdir/", "$local_outputdir/" );
 print "Running @rsynccmd\n";
 system( @rsynccmd ) == 0 
     or die "Could not run rsync: $!";
@@ -174,6 +177,7 @@ my @changefiles = glob( "$local_outputdir/*.changes" );
 
 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: $!";
 }
index 4b19ecbfe22f0e16590e2e6dca5105d96e87480f..ca2670d683133c27df6014b0e4865008eba33071 100644 (file)
@@ -1,4 +1,4 @@
-mh-sysadmin-tools (1.6~test.3) UNRELEASED; urgency=low
+mh-sysadmin-tools (1.6~test.4) UNRELEASED; urgency=low
 
   * build-package: new script for package building via cowbuilder/pbuilder
   * with-creds: add with-creds-run-aklog script to make `-a` work correctly