File Coverage

File:Dpkg/Build/Info.pm
Coverage:84.2%

linestmtbrancondsubpodtimecode
1# Copyright © 2016 Guillem Jover <guillem@debian.org>
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 <https://www.gnu.org/licenses/>.
15
16package Dpkg::Build::Info;
17
18
1
1
1
3
1
12
use strict;
19
1
1
1
1
0
32
use warnings;
20
21our $VERSION = '1.01';
22our @EXPORT_OK = qw(
23    get_build_env_whitelist
24    get_build_env_allowed
25);
26
27
1
1
1
2
0
80
use Exporter qw(import);
28
29=encoding utf8
30
31 - 49
=head1 NAME

Dpkg::Build::Info - handle build information

=head1 DESCRIPTION

The Dpkg::Build::Info module provides functions to handle the build
information.

=head1 FUNCTIONS

=over 4

=item @envvars = get_build_env_allowed()

Get an array with the allowed list of environment variables that can affect
the build, but are still not privacy revealing.

=cut
50
51my @env_allowed = (
52    # Toolchain.
53    qw(
54        CC
55        CPP
56        CXX
57        OBJC
58        OBJCXX
59        PC
60        FC
61        M2C
62        AS
63        LD
64        AR
65        RANLIB
66        MAKE
67        AWK
68        LEX
69        YACC
70    ),
71    # Toolchain flags.
72    qw(
73        ASFLAGS
74        CFLAGS
75        CPPFLAGS
76        CXXFLAGS
77        OBJCFLAGS
78        OBJCXXFLAGS
79        GCJFLAGS
80        DFLAGS
81        FFLAGS
82        LDFLAGS
83        ARFLAGS
84        MAKEFLAGS
85    ),
86    # Dynamic linker, see ld(1).
87    qw(
88        LD_LIBRARY_PATH
89    ),
90    # Locale, see locale(1).
91    qw(
92        LANG
93        LC_ALL
94        LC_CTYPE
95        LC_NUMERIC
96        LC_TIME
97        LC_COLLATE
98        LC_MONETARY
99        LC_MESSAGES
100        LC_PAPER
101        LC_NAME
102        LC_ADDRESS
103        LC_TELEPHONE
104        LC_MEASUREMENT
105        LC_IDENTIFICATION
106    ),
107    # Build flags, see dpkg-buildpackage(1).
108    qw(
109        DEB_BUILD_OPTIONS
110        DEB_BUILD_PROFILES
111    ),
112    # DEB_flag_{SET,STRIP,APPEND,PREPEND} will be recorded after being merged
113    # with system config and user config.
114    # See deb-vendor(1).
115    qw(
116        DEB_VENDOR
117    ),
118    # See dpkg(1).
119    qw(
120        DPKG_ROOT
121        DPKG_ADMINDIR
122    ),
123    # See dpkg-architecture(1).
124    qw(
125        DPKG_DATADIR
126    ),
127    # See Dpkg::Vendor(3).
128    qw(
129        DPKG_ORIGINS_DIR
130    ),
131    # See dpkg-gensymbols(1).
132    qw(
133        DPKG_GENSYMBOLS_CHECK_LEVEL
134    ),
135    # See <https://reproducible-builds.org/specs/source-date-epoch>.
136    qw(
137        SOURCE_DATE_EPOCH
138    ),
139);
140
141sub get_build_env_allowed {
142
1
1
1
    return @env_allowed;
143}
144
145 - 149
=item @envvars = get_build_env_whitelist()

This is a deprecated alias for get_build_env_allowed().

=cut
150
151sub get_build_env_whitelist {
152
0
1
    warnings::warnif('deprecated',
153        'Dpkg::Build::Info::get_build_env_whitelist() is deprecated, ' .
154        'use get_build_env_allowed() instead');
155
0
    return get_build_env_allowed();
156}
157
158=back
159
160 - 172
=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)

Mark the module as public.

=cut
173
1741;