File Coverage

blib/lib/Dpkg/Build/Info.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 5 80.0
pod 2 2 100.0
total 16 19 84.2


line stmt bran cond sub pod time code
1             # Copyright © 2016 Guillem Jover
2             #
3             # This program is free software; you can redistribute it and/or modify
4             # it under the terms of the GNU General Public License as published by
5             # the Free Software Foundation; either version 2 of the License, or
6             # (at your option) any later version.
7             #
8             # This program is distributed in the hope that it will be useful,
9             # but WITHOUT ANY WARRANTY; without even the implied warranty of
10             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11             # GNU General Public License for more details.
12             #
13             # You should have received a copy of the GNU General Public License
14             # along with this program. If not, see .
15              
16             package Dpkg::Build::Info;
17              
18 1     1   70865 use strict;
  1         10  
  1         29  
19 1     1   6 use warnings;
  1         1  
  1         72  
20              
21             our $VERSION = '1.01';
22             our @EXPORT_OK = qw(
23             get_build_env_whitelist
24             get_build_env_allowed
25             );
26              
27 1     1   7 use Exporter qw(import);
  1         2  
  1         185  
28              
29             =encoding utf8
30              
31             =head1 NAME
32              
33             Dpkg::Build::Info - handle build information
34              
35             =head1 DESCRIPTION
36              
37             The Dpkg::Build::Info module provides functions to handle the build
38             information.
39              
40             =head1 FUNCTIONS
41              
42             =over 4
43              
44             =item @envvars = get_build_env_allowed()
45              
46             Get an array with the allowed list of environment variables that can affect
47             the build, but are still not privacy revealing.
48              
49             =cut
50              
51             my @env_allowed = (
52             # Toolchain.
53             qw(CC CPP CXX OBJC OBJCXX PC FC M2C AS LD AR RANLIB MAKE AWK LEX YACC),
54             # Toolchain flags.
55             qw(CFLAGS CPPFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS GCJFLAGS DFLAGS FFLAGS
56             LDFLAGS ARFLAGS MAKEFLAGS),
57             # Dynamic linker, see ld(1).
58             qw(LD_LIBRARY_PATH),
59             # Locale, see locale(1).
60             qw(LANG LC_ALL LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY
61             LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
62             LC_IDENTIFICATION),
63             # Build flags, see dpkg-buildpackage(1).
64             qw(DEB_BUILD_OPTIONS DEB_BUILD_PROFILES),
65             # DEB_flag_{SET,STRIP,APPEND,PREPEND} will be recorded after being merged
66             # with system config and user config.
67             # See deb-vendor(1).
68             qw(DEB_VENDOR),
69             # See dpkg(1).
70             qw(DPKG_ROOT DPKG_ADMINDIR),
71             # See dpkg-architecture(1).
72             qw(DPKG_DATADIR),
73             # See Dpkg::Vendor(3).
74             qw(DPKG_ORIGINS_DIR),
75             # See dpkg-gensymbols(1).
76             qw(DPKG_GENSYMBOLS_CHECK_LEVEL),
77             # See .
78             qw(SOURCE_DATE_EPOCH),
79             );
80              
81             sub get_build_env_allowed {
82 1     1 1 89 return @env_allowed;
83             }
84              
85             =item @envvars = get_build_env_whitelist()
86              
87             This is a deprecated alias for get_build_env_allowed().
88              
89             =cut
90              
91             sub get_build_env_whitelist {
92 0     0 1   warnings::warnif('deprecated',
93             'Dpkg::Build::Info::get_build_env_whitelist() is deprecated, ' .
94             'use get_build_env_allowed() instead');
95 0           return get_build_env_allowed();
96             }
97              
98             =back
99              
100             =head1 CHANGES
101              
102             =head2 Version 1.01 (dpkg 1.20.1)
103              
104             New function: get_build_env_allowed().
105              
106             Deprecated function: get_build_env_whitelist().
107              
108             =head2 Version 1.00 (dpkg 1.18.14)
109              
110             Mark the module as public.
111              
112             =cut
113              
114             1;