GitHub

Original file line numberDiff line numberDiff line change

@@ -78,12 +78,15 @@ foreach my $package (@{$dh{DOPACKAGES}}) {

7878

if (! -e $substvars || system("grep -q '^misc:Pre-Depends=' $substvars") != 0) {

7979

complex_doit("echo misc:Pre-Depends= >> $substvars");

8080

}

81-
81+
82+

my $build_ids = undef;

83+

if ( -d $ddeb_info_dir ) {

84+

$build_ids = read_ddeb_build_ids($ddeb_info_dir);

85+

}

8286
8387

if ( -d $ddeb_tmp) {

8488

my $multiarch = package_multiarch($package);

8589

my $replaces = read_ddeb_migration($ddeb_info_dir);

86-

my $build_ids = read_ddeb_build_ids($ddeb_info_dir);

8790
8891

# Remove and override more or less every standard field.

8992

my @ddeb_options = (qw(

@@ -120,9 +123,14 @@ foreach my $package (@{$dh{DOPACKAGES}}) {

120123

doit("chown","0:0","${ddeb_tmp}/DEBIAN/control");

121124

}

122125
126+

my @debug_info_params = ();

127+

if ($build_ids) {

128+

push(@debug_info_params, "-DX-Build-Ids=${build_ids}");

129+

}

130+
123131

# Generate and install control file.

124132

doit("dpkg-gencontrol", "-p$package", "-l$changelog", "-T$substvars",

125-

"-P$tmp",@{$dh{U_PARAMS}});

133+

"-P$tmp", @debug_info_params, @{$dh{U_PARAMS}});

126134
127135

# This chmod is only necessary if the user sets the umask to

128136

# something odd.

Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ dh_strip - strip executables, shared libraries, and some static libraries

99

use strict;

1010

use warnings;

1111

use File::Find;

12+

use File::Path 'make_path';

1213

use Debian::Debhelper::Dh_Lib;

1314
1415

=head1 SYNOPSIS

@@ -254,8 +255,15 @@ sub make_debug {

254255

doit($objcopy, "--only-keep-debug", "--compress-debug-sections", $file, $debug_path);

255256

}

256257
257-

if ($use_build_id > 1) {

258-

my $path = "debian/.debhelper/${package}/ddeb-build-ids";

258+

if ($use_build_id) {

259+

my $debugpackagename=$package;

260+

if (ref $dh{DEBUGPACKAGES}) {

261+

$debugpackagename=@{$dh{DEBUGPACKAGES}}[0];

262+

}

263+
264+

my $internal_path = "debian/.debhelper/${debugpackagename}";

265+

make_path($internal_path) if ! -d $internal_path;

266+

my $path = "${internal_path}/ddeb-build-ids";

259267

open(my $fd, '>>', $path) or error("open $path failed: $!");

260268

print {$fd} "$debug_build_id ";

261269

close($fd) or error("close $path failed: $!");

Read the original on github.com ↗