From 366211a6b095438ecc16ffc859fe4db014ac8a56 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Thu, 14 Jan 2016 19:35:14 +0000 Subject: dh_*: Replace ddeb with dbgsym Signed-off-by: Niels Thykier --- dh_gencontrol | 72 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) (limited to 'dh_gencontrol') diff --git a/dh_gencontrol b/dh_gencontrol index 1d35f893..0b92fd54 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -21,14 +21,15 @@ control files, and installing them into the I directory with the proper permissions. This program is merely a wrapper around L, which -calls it once for each package being acted on (plus related ddebs), -and passes in some additional useful flags. +calls it once for each package being acted on (plus related dbgsym +packages), and passes in some additional useful flags. B that if you use B, you must also use L to build the packages. Otherwise, your build may fail to build as B (via L) declares -which packages are built. As debhelper automatically generates ddebs, -it some times adds additional packages, which will be built by L. +which packages are built. As debhelper automatically generates dbgsym +packages, it some times adds additional packages, which will be built +by L. =head1 OPTIONS @@ -56,8 +57,8 @@ init(options => { foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $ext=pkgext($package); - my $ddeb_info_dir = "debian/.debhelper/${package}"; - my $ddeb_tmp = "${ddeb_info_dir}/ddeb-root"; + my $dbgsym_info_dir = "debian/.debhelper/${package}"; + my $dbgsym_tmp = "${dbgsym_info_dir}/dbgsym-root"; my $substvars="debian/${ext}substvars"; @@ -80,17 +81,17 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } my (@debug_info_params, $build_ids); - if ( -d $ddeb_info_dir ) { - $build_ids = read_ddeb_build_ids($ddeb_info_dir); + if ( -d $dbgsym_info_dir ) { + $build_ids = read_dbgsym_build_ids($dbgsym_info_dir); } - # Temporary workaround: Do not build ddebs for udebs as + # Temporary workaround: Do not build dbgsym packages for udebs as # dpkg-gencontrol and dpkg-deb does not agree on the file # extension. - if ( -d $ddeb_tmp and not is_udeb($package)) { + if ( -d $dbgsym_tmp and not is_udeb($package)) { my $multiarch = package_multiarch($package); my $section = package_section($package); - my $replaces = read_ddeb_migration($ddeb_info_dir); + my $replaces = read_dbgsym_migration($dbgsym_info_dir); my $component = ''; if ($section =~ m{^(.*)/[^/]+$}) { $component = "${1}/"; @@ -100,7 +101,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } # Remove and override more or less every standard field. - my @ddeb_options = (qw( + my @dbgsym_options = (qw( -UPre-Depends -URecommends -USuggests -UEnhances -UProvides -UEssential -UConflicts -DPriority=extra -DAuto-Built-Package=debug-symbols @@ -115,28 +116,29 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # multi-arch: same package. In all other cases, we do not # need a multi-arch value. if ($multiarch ne 'same') { - push(@ddeb_options, '-UMulti-Arch'); + push(@dbgsym_options, '-UMulti-Arch'); } - # If the ddeb is replacing an existing -dbg package, then - # declare the necessary Breaks + Replaces. Otherwise, clear - # the fields. + # If the dbgsym package is replacing an existing -dbg package, + # then declare the necessary Breaks + Replaces. Otherwise, + # clear the fields. if ($replaces) { - push(@ddeb_options, "-DReplaces=${replaces}", + push(@dbgsym_options, "-DReplaces=${replaces}", "-DBreaks=${replaces}"); } else { - push(@ddeb_options, '-UReplaces', '-UBreaks'); + push(@dbgsym_options, '-UReplaces', '-UBreaks'); } - if ( ! -d "${ddeb_tmp}/DEBIAN" ) { - install_dir("${ddeb_tmp}/DEBIAN"); + if ( ! -d "${dbgsym_tmp}/DEBIAN" ) { + install_dir("${dbgsym_tmp}/DEBIAN"); } doit("dpkg-gencontrol", "-p${package}", "-l$changelog", "-T$substvars", - "-P${ddeb_tmp}",@{$dh{U_PARAMS}}, @ddeb_options); + "-P${dbgsym_tmp}",@{$dh{U_PARAMS}}, @dbgsym_options); - doit("chmod","0644","${ddeb_tmp}/DEBIAN/control"); - doit("chown","0:0","${ddeb_tmp}/DEBIAN/control"); + doit("chmod","0644","${dbgsym_tmp}/DEBIAN/control"); + doit("chown","0:0","${dbgsym_tmp}/DEBIAN/control"); } elsif ($build_ids) { - # Only include the build-id if there is no ddeb (if there is a - # ddeb, the build-ids into the ddeb's control file) + # Only include the build-id if there is no dbgsym package (if + # there is a dbgsym package, the build-ids into the control + # file of the dbgsym package) push(@debug_info_params, "-DBuild-Ids=${build_ids}"); } @@ -151,25 +153,25 @@ foreach my $package (@{$dh{DOPACKAGES}}) { doit("chown","0:0","$tmp/DEBIAN/control"); } -sub read_ddeb_file { - my ($ddeb_info_file, $ddeb_info_dir) = @_; - my $ddeb_path = "${ddeb_info_dir}/${ddeb_info_file}"; +sub read_dbgsym_file { + my ($dbgsym_info_file, $dbgsym_info_dir) = @_; + my $dbgsym_path = "${dbgsym_info_dir}/${dbgsym_info_file}"; my $result; - if (-f $ddeb_path) { - open(my $fd, '<', $ddeb_path) - or error("open $ddeb_path failed: $!"); + if (-f $dbgsym_path) { + open(my $fd, '<', $dbgsym_path) + or error("open $dbgsym_path failed: $!"); chomp($result = <$fd>); close($fd); } return $result; } -sub read_ddeb_migration { - return read_ddeb_file('ddeb-migration', @_); +sub read_dbgsym_migration { + return read_dbgsym_file('dbgsym-migration', @_); } -sub read_ddeb_build_ids { - return read_ddeb_file('ddeb-build-ids', @_); +sub read_dbgsym_build_ids { + return read_dbgsym_file('dbgsym-build-ids', @_); } =head1 SEE ALSO -- cgit v1.2.3