Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: third_party/dpkg-dev/scripts/Dpkg/BuildEnv.pm

Issue 2411423002: Linux build: Use sysroot when calculating dependencies (Closed)
Patch Set: Update expected_deps Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright © 2012 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
16 package Dpkg::BuildEnv;
17
18 use strict;
19 use warnings;
20
21 our $VERSION = '0.01';
22
23 my %env_modified = ();
24 my %env_accessed = ();
25
26 =encoding utf8
27
28 =head1 NAME
29
30 Dpkg::BuildEnv - track build environment
31
32 =head1 DESCRIPTION
33
34 The Dpkg::BuildEnv module is used by dpkg-buildflags to track the build
35 environment variables being used and modified.
36
37 =head1 FUNCTIONS
38
39 =over 4
40
41 =item $bf->set($varname, $value)
42
43 Update the build environment variable $varname with value $value. Record
44 it as being accessed and modified.
45
46 =cut
47
48 sub set {
49 my ($varname, $value) = @_;
50 $env_modified{$varname} = 1;
51 $env_accessed{$varname} = 1;
52 $ENV{$varname} = $value;
53 }
54
55 =item $bf->get($varname)
56
57 Get the build environment variable $varname value. Record it as being
58 accessed.
59
60 =cut
61
62 sub get {
63 my ($varname) = @_;
64 $env_accessed{$varname} = 1;
65 return $ENV{$varname};
66 }
67
68 =item $bf->has($varname)
69
70 Return a boolean indicating whether the environment variable exists.
71 Record it as being accessed.
72
73 =cut
74
75 sub has {
76 my ($varname) = @_;
77 $env_accessed{$varname} = 1;
78 return exists $ENV{$varname};
79 }
80
81 =item my @list = $bf->list_accessed()
82
83 Returns a list of all environment variables that have been accessed.
84
85 =cut
86
87 sub list_accessed {
88 my @list = sort keys %env_accessed;
89 return @list;
90 }
91
92 =item my @list = $bf->list_modified()
93
94 Returns a list of all environment variables that have been modified.
95
96 =cut
97
98 sub list_modified {
99 my @list = sort keys %env_modified;
100 return @list;
101 }
102
103 =back
104
105 =cut
106
107 1;
OLDNEW
« no previous file with comments | « third_party/dpkg-dev/scripts/Dpkg/Arch.pm ('k') | third_party/dpkg-dev/scripts/Dpkg/BuildFlags.pm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698