This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=ef00a2b8eda6343222acd150f907209450f245b4 commit ef00a2b8eda6343222acd150f907209450f245b4 (HEAD -> main) Author: Guillem Jover <[email protected]> AuthorDate: Mon Dec 26 22:08:09 2022 +0100 Dpkg::BuildInfo: New module to deprecate the Dpkg::Build::Info module The new module gets rid of the deprecated functions and follows the same naming convention as used by the other Dpkg::BuildSomething modules. Keep the old module for backwards compatibility until users have switched over. --- debian/control | 2 +- scripts/Dpkg.pm | 8 +- scripts/Dpkg/Build/Info.pm | 115 ++++------------------ scripts/Dpkg/{Build/Info.pm => BuildInfo.pm} | 32 ++---- scripts/Makefile.am | 3 +- scripts/dpkg-genbuildinfo.pl | 2 +- scripts/po/POTFILES.in | 1 + scripts/t/{Dpkg_Build_Info.t => Dpkg_BuildInfo.t} | 4 +- 8 files changed, 36 insertions(+), 131 deletions(-) diff --git a/debian/control b/debian/control index 687687ff2..78fb151f0 100644 --- a/debian/control +++ b/debian/control @@ -186,8 +186,8 @@ Description: Dpkg perl modules . - Dpkg: core variables - Dpkg::Arch: architecture handling functions - - Dpkg::Build::Info: build information functions - Dpkg::BuildFlags: set, modify and query compilation build flags + - Dpkg::BuildInfo: build information functions - Dpkg::BuildOptions: parse and manipulate DEB_BUILD_OPTIONS - Dpkg::BuildProfiles: parse and manipulate build profiles - Dpkg::Changelog: parse changelogs diff --git a/scripts/Dpkg.pm b/scripts/Dpkg.pm index 940399b46..edb0d327d 100644 --- a/scripts/Dpkg.pm +++ b/scripts/Dpkg.pm @@ -122,14 +122,14 @@ This module, core variables. Architecture handling functions. -=item L<Dpkg::Build::Info> - -Build information functions. - =item L<Dpkg::BuildFlags> Set, modify and query compilation build flags. +=item L<Dpkg::BuildInfo> + +Build information functions. + =item L<Dpkg::BuildOptions> Parse and manipulate B<DEB_BUILD_OPTIONS>. diff --git a/scripts/Dpkg/Build/Info.pm b/scripts/Dpkg/Build/Info.pm index 78915343c..ff1fdaa86 100644 --- a/scripts/Dpkg/Build/Info.pm +++ b/scripts/Dpkg/Build/Info.pm @@ -1,4 +1,4 @@ -# Copyright © 2016 Guillem Jover <[email protected]> +# Copyright © 2016-2022 Guillem Jover <[email protected]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ package Dpkg::Build::Info; use strict; use warnings; -our $VERSION = '1.01'; +our $VERSION = '1.02'; our @EXPORT_OK = qw( get_build_env_whitelist get_build_env_allowed @@ -26,6 +26,8 @@ our @EXPORT_OK = qw( use Exporter qw(import); +use Dpkg::BuildInfo; + =encoding utf8 =head1 NAME @@ -37,6 +39,8 @@ Dpkg::Build::Info - handle build information The Dpkg::Build::Info module provides functions to handle the build information. +This module is deprecated, use Dpkg::BuildInfo instead. + =head1 FUNCTIONS =over 4 @@ -46,119 +50,38 @@ information. Get an array with the allowed list of environment variables that can affect the build, but are still not privacy revealing. -=cut +This is a deprecated alias for Dpkg::BuildInfo::get_build_env_allowed(). -my @env_allowed = ( - # Toolchain. - qw( - CC - CPP - CXX - OBJC - OBJCXX - PC - FC - M2C - AS - LD - AR - RANLIB - MAKE - AWK - LEX - YACC - ), - # Toolchain flags. - qw( - ASFLAGS - CFLAGS - CPPFLAGS - CXXFLAGS - OBJCFLAGS - OBJCXXFLAGS - GCJFLAGS - DFLAGS - FFLAGS - LDFLAGS - ARFLAGS - MAKEFLAGS - ), - # Dynamic linker, see ld(1). - qw( - LD_LIBRARY_PATH - ), - # Locale, see locale(1). - qw( - LANG - LC_ALL - LC_CTYPE - LC_NUMERIC - LC_TIME - LC_COLLATE - LC_MONETARY - LC_MESSAGES - LC_PAPER - LC_NAME - LC_ADDRESS - LC_TELEPHONE - LC_MEASUREMENT - LC_IDENTIFICATION - ), - # Build flags, see dpkg-buildpackage(1). - qw( - DEB_BUILD_OPTIONS - DEB_BUILD_PROFILES - ), - # DEB_flag_{SET,STRIP,APPEND,PREPEND} will be recorded after being merged - # with system config and user config. - # See deb-vendor(1). - qw( - DEB_VENDOR - ), - # See dpkg(1). - qw( - DPKG_ROOT - DPKG_ADMINDIR - ), - # See dpkg-architecture(1). - qw( - DPKG_DATADIR - ), - # See Dpkg::Vendor(3). - qw( - DPKG_ORIGINS_DIR - ), - # See dpkg-gensymbols(1). - qw( - DPKG_GENSYMBOLS_CHECK_LEVEL - ), - # See <https://reproducible-builds.org/specs/source-date-epoch>. - qw( - SOURCE_DATE_EPOCH - ), -); +=cut sub get_build_env_allowed { - return @env_allowed; + warnings::warnif('deprecated', + 'Dpkg::Build::Info::get_build_env_allowed() is deprecated, ' . + 'use Dpkg::BuildInfo::get_build_env_allowed() instead'); + return Dpkg::BuildInfo::get_build_env_allowed(); } =item @envvars = get_build_env_whitelist() -This is a deprecated alias for get_build_env_allowed(). +This is a deprecated alias for Dpkg::BuildInfo::get_build_env_allowed(). =cut sub get_build_env_whitelist { warnings::warnif('deprecated', 'Dpkg::Build::Info::get_build_env_whitelist() is deprecated, ' . - 'use get_build_env_allowed() instead'); - return get_build_env_allowed(); + 'use Dpkg::BuildInfo::get_build_env_allowed() instead'); + return Dpkg::BuildInfo::get_build_env_allowed(); } =back =head1 CHANGES +=head2 Version 1.02 (dpkg 1.21.14) + +Deprecate module: replaced by Dpkg::BuildInfo. + =head2 Version 1.01 (dpkg 1.20.1) New function: get_build_env_allowed(). diff --git a/scripts/Dpkg/Build/Info.pm b/scripts/Dpkg/BuildInfo.pm similarity index 78% copy from scripts/Dpkg/Build/Info.pm copy to scripts/Dpkg/BuildInfo.pm index 78915343c..7be6bc750 100644 --- a/scripts/Dpkg/Build/Info.pm +++ b/scripts/Dpkg/BuildInfo.pm @@ -1,4 +1,4 @@ -# Copyright © 2016 Guillem Jover <[email protected]> +# Copyright © 2016-2022 Guillem Jover <[email protected]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -13,14 +13,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -package Dpkg::Build::Info; +package Dpkg::BuildInfo; use strict; use warnings; -our $VERSION = '1.01'; +our $VERSION = '1.00'; our @EXPORT_OK = qw( - get_build_env_whitelist get_build_env_allowed ); @@ -30,11 +29,11 @@ use Exporter qw(import); =head1 NAME -Dpkg::Build::Info - handle build information +Dpkg::BuildInfo - handle build information =head1 DESCRIPTION -The Dpkg::Build::Info module provides functions to handle the build +The Dpkg::BuildInfo module provides functions to handle the build information. =head1 FUNCTIONS @@ -142,30 +141,11 @@ sub get_build_env_allowed { return @env_allowed; } -=item @envvars = get_build_env_whitelist() - -This is a deprecated alias for get_build_env_allowed(). - -=cut - -sub get_build_env_whitelist { - warnings::warnif('deprecated', - 'Dpkg::Build::Info::get_build_env_whitelist() is deprecated, ' . - 'use get_build_env_allowed() instead'); - return get_build_env_allowed(); -} - =back =head1 CHANGES -=head2 Version 1.01 (dpkg 1.20.1) - -New function: get_build_env_allowed(). - -Deprecated function: get_build_env_whitelist(). - -=head2 Version 1.00 (dpkg 1.18.14) +=head2 Version 1.00 (dpkg 1.21.14) Mark the module as public. diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 077a6a6d0..676646189 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -64,6 +64,7 @@ nobase_dist_perllib_DATA = \ Dpkg/Arch.pm \ Dpkg/BuildEnv.pm \ Dpkg/BuildFlags.pm \ + Dpkg/BuildInfo.pm \ Dpkg/BuildOptions.pm \ Dpkg/BuildProfiles.pm \ Dpkg/BuildTypes.pm \ @@ -218,10 +219,10 @@ test_scripts = \ t/Dpkg_BuildEnv.t \ t/Dpkg_BuildFlags.t \ t/Dpkg_BuildFlags_Ubuntu.t \ + t/Dpkg_BuildInfo.t \ t/Dpkg_BuildOptions.t \ t/Dpkg_BuildProfiles.t \ t/Dpkg_BuildTypes.t \ - t/Dpkg_Build_Info.t \ t/Dpkg_Checksums.t \ t/Dpkg_ErrorHandling.t \ t/Dpkg_Exit.t \ diff --git a/scripts/dpkg-genbuildinfo.pl b/scripts/dpkg-genbuildinfo.pl index b58ae8131..73c881500 100755 --- a/scripts/dpkg-genbuildinfo.pl +++ b/scripts/dpkg-genbuildinfo.pl @@ -43,10 +43,10 @@ use Dpkg::Arch qw( debarch_eq debarch_to_gnutriplet ); use Dpkg::BuildTypes; -use Dpkg::Build::Info qw(get_build_env_allowed); use Dpkg::BuildOptions; use Dpkg::BuildFlags; use Dpkg::BuildProfiles qw(get_build_profiles); +use Dpkg::BuildInfo qw(get_build_env_allowed); use Dpkg::Control::Info; use Dpkg::Control::Fields; use Dpkg::Control; diff --git a/scripts/po/POTFILES.in b/scripts/po/POTFILES.in index 9582cdb54..e88a1cd5e 100644 --- a/scripts/po/POTFILES.in +++ b/scripts/po/POTFILES.in @@ -21,6 +21,7 @@ scripts/Dpkg.pm scripts/Dpkg/Arch.pm scripts/Dpkg/BuildEnv.pm scripts/Dpkg/BuildFlags.pm +scripts/Dpkg/BuildInfo.pm scripts/Dpkg/BuildOptions.pm scripts/Dpkg/BuildProfiles.pm scripts/Dpkg/BuildTypes.pm diff --git a/scripts/t/Dpkg_Build_Info.t b/scripts/t/Dpkg_BuildInfo.t similarity index 89% rename from scripts/t/Dpkg_Build_Info.t rename to scripts/t/Dpkg_BuildInfo.t index fe47da0de..fc2cd7137 100644 --- a/scripts/t/Dpkg_Build_Info.t +++ b/scripts/t/Dpkg_BuildInfo.t @@ -19,10 +19,10 @@ use warnings; use Test::More tests => 2; BEGIN { - use_ok('Dpkg::Build::Info'); + use_ok('Dpkg::BuildInfo'); } -is(scalar Dpkg::Build::Info::get_build_env_allowed(), 52, +is(scalar Dpkg::BuildInfo::get_build_env_allowed(), 52, 'allowed environment variables array'); 1; -- Dpkg.Org's dpkg

