1 # Copyright © 2012 Guillem Jover <guillem@debian.org>
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.
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.
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/>.
20 Dpkg::BuildEnv - track build environment
24 The Dpkg::BuildEnv module is used by dpkg-buildflags to track the build
25 environment variables being used and modified.
27 B<Note>: This is a private module, its API can change at any time.
31 package Dpkg
::BuildEnv
0.01;
36 my %env_modified = ();
37 my %env_accessed = ();
43 =item set($varname, $value)
45 Update the build environment variable $varname with value $value. Record
46 it as being accessed and modified.
51 my ($varname, $value) = @_;
52 $env_modified{$varname} = 1;
53 $env_accessed{$varname} = 1;
54 $ENV{$varname} = $value;
59 Get the build environment variable $varname value. Record it as being
66 $env_accessed{$varname} = 1;
67 return $ENV{$varname};
72 Return a boolean indicating whether the environment variable exists.
73 Record it as being accessed.
79 $env_accessed{$varname} = 1;
80 return exists $ENV{$varname};
83 =item @list = list_accessed()
85 Returns a list of all environment variables that have been accessed.
90 my @list = sort keys %env_accessed;
94 =item @list = list_modified()
96 Returns a list of all environment variables that have been modified.
101 my @list = sort keys %env_modified;
111 This is a private module.