[dpkg] 101/200: Dpkg::Arch: Add new import tags
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:17:24 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository dpkg.
commit 21699eb533b7ab655f89dd8df4a772ceae7fd946
Author: Guillem Jover <guillem at debian.org>
Date: Sun Jan 15 03:47:30 2017 +0100
Dpkg::Arch: Add new import tags
This makes using the module a bit easier.
---
debian/changelog | 1 +
scripts/Dpkg/Arch.pm | 43 ++++++++++++++++++++++++++++++++++++++++++-
scripts/Dpkg/Shlibs.pm | 3 +--
scripts/dpkg-architecture.pl | 6 +-----
scripts/dpkg-source.pl | 2 +-
t/pod-spell.t | 1 +
6 files changed, 47 insertions(+), 9 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index d9605e3..9cd5641 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ dpkg (1.18.19) UNRELEASED; urgency=medium
- Fix Debian architecture wildcard parsing so that matching four-tuple
matchings work. Missed in dpkg 1.18.11.
Reported by Julian Andres Klode <jak at debian.org>.
+ - Add new import tags for Dpkg::Arch.
* Documentation:
- Cleanup software requirements in README.
- Move control member file references from dpkg(1) to deb(5).
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index 77f87b2..1720847 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -26,13 +26,17 @@ Dpkg::Arch - handle architectures
The Dpkg::Arch module provides functions to handle Debian architectures,
wildcards, and mapping from and to GNU triplets.
+No symbols are exported by default. The :all tag can be used to import all
+symbols. The :getters, :parsers, :mappers and :operators tags can be used
+to import specific symbol subsets.
+
=cut
use strict;
use warnings;
use feature qw(state);
-our $VERSION = '1.01';
+our $VERSION = '1.02';
our @EXPORT_OK = qw(
get_raw_build_arch
get_raw_host_arch
@@ -56,6 +60,39 @@ our @EXPORT_OK = qw(
gnutriplet_to_debtuple
gnutriplet_to_multiarch
);
+our %EXPORT_TAGS = (
+ all => [ @EXPORT_OK ],
+ getters => [ qw(
+ get_raw_build_arch
+ get_raw_host_arch
+ get_build_arch
+ get_host_arch
+ get_host_gnu_type
+ get_valid_arches
+ ) ],
+ parsers => [ qw(
+ debarch_list_parse
+ ) ],
+ mappers => [ qw(
+ debarch_to_cpuattrs
+ debarch_to_gnutriplet
+ debarch_to_debtuple
+ debarch_to_multiarch
+ debtuple_to_debarch
+ debtuple_to_gnutriplet
+ gnutriplet_to_debarch
+ gnutriplet_to_debtuple
+ gnutriplet_to_multiarch
+ ) ],
+ operators => [ qw(
+ debarch_eq
+ debarch_is
+ debarch_is_wildcard
+ debarch_is_illegal
+ debarch_is_concerned
+ ) ],
+);
+
use Exporter qw(import);
use POSIX qw(:errno_h);
@@ -623,6 +660,10 @@ __END__
=head1 CHANGES
+=head2 Version 1.02 (dpkg 1.18.19)
+
+New import tags: ":all", ":getters", ":parsers", ":mappers", ":operators".
+
=head2 Version 1.01 (dpkg 1.18.5)
New functions: debarch_is_illegal(), debarch_list_parse().
diff --git a/scripts/Dpkg/Shlibs.pm b/scripts/Dpkg/Shlibs.pm
index 3bb3c7b..69b1baf 100644
--- a/scripts/Dpkg/Shlibs.pm
+++ b/scripts/Dpkg/Shlibs.pm
@@ -37,8 +37,7 @@ use Dpkg::ErrorHandling;
use Dpkg::Shlibs::Objdump;
use Dpkg::Util qw(:list);
use Dpkg::Path qw(resolve_symlink canonpath);
-use Dpkg::Arch qw(debarch_to_gnutriplet get_build_arch get_host_arch
- gnutriplet_to_multiarch debarch_to_multiarch);
+use Dpkg::Arch qw(get_build_arch get_host_arch :mappers);
use constant DEFAULT_LIBRARY_PATH =>
qw(/lib /usr/lib);
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index fc0a4b7..aa77ea4 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -26,11 +26,7 @@ use Dpkg ();
use Dpkg::Gettext;
use Dpkg::Getopt;
use Dpkg::ErrorHandling;
-use Dpkg::Arch qw(get_raw_build_arch get_raw_host_arch get_host_gnu_type
- debarch_to_cpuattrs
- get_valid_arches debarch_eq debarch_is debarch_to_debtuple
- debarch_to_gnutriplet gnutriplet_to_debarch
- debarch_to_multiarch);
+use Dpkg::Arch qw(:getters :mappers debarch_eq debarch_is);
textdomain('dpkg-dev');
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index bf2c5be..b7776a7 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -36,7 +36,7 @@ use Dpkg ();
use Dpkg::Gettext;
use Dpkg::ErrorHandling;
use Dpkg::Util qw(:list);
-use Dpkg::Arch qw(debarch_eq debarch_is debarch_is_wildcard debarch_is_illegal);
+use Dpkg::Arch qw(:operators);
use Dpkg::Deps;
use Dpkg::Compression;
use Dpkg::Conf;
diff --git a/t/pod-spell.t b/t/pod-spell.t
index e2a7190..864bf54 100644
--- a/t/pod-spell.t
+++ b/t/pod-spell.t
@@ -73,6 +73,7 @@ envvar
fieldnames
ge
gettext
+getters
hurd
keyrings
le
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list