From: Michael Howe Date: Tue, 26 Dec 2023 00:00:20 +0000 (+0000) Subject: assorted build-package improvements X-Git-Tag: 1.6~3 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=caaf7cdf0afb975783997e0938ba28d4dfa29e22;p=packages%2Fm%2Fmh-sysadmin-tools.git assorted build-package improvements Mostly adapted from the uncommitted version I've had for a while --- diff --git a/bin/build-package b/bin/build-package index e6a7ffc..c8af901 100755 --- a/bin/build-package +++ b/bin/build-package @@ -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: $!"; } diff --git a/debian/changelog b/debian/changelog index 4b19ecb..ca2670d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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