1 |
commit: 2f1a81c1873ba4b465fcacb9853368bca1e9f431 |
2 |
Author: Sven Eden <sven.eden <AT> gmx <DOT> de> |
3 |
AuthorDate: Fri Feb 1 16:05:14 2013 +0000 |
4 |
Commit: Sven Eden <sven.eden <AT> gmx <DOT> de> |
5 |
CommitDate: Fri Feb 1 16:05:14 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=2f1a81c1 |
7 |
|
8 |
Fixed the (deprecated) usage of ::eprefix - it is now ::EPREFIX. |
9 |
|
10 |
--- |
11 |
Portage.pm | 40 ++++++++++++++++++++-------------------- |
12 |
ufed.pl.in | 4 ++-- |
13 |
2 files changed, 22 insertions(+), 22 deletions(-) |
14 |
|
15 |
diff --git a/Portage.pm b/Portage.pm |
16 |
index 1d7a800..cd32f8b 100644 |
17 |
--- a/Portage.pm |
18 |
+++ b/Portage.pm |
19 |
@@ -44,10 +44,10 @@ our $use_flags; |
20 |
|
21 |
# $used_make_conf - path of the used make.conf |
22 |
our $used_make_conf = ""; |
23 |
+our $EPREFIX = ""; |
24 |
|
25 |
# --- private members --- |
26 |
my %_environment = (); |
27 |
-my $_EPREFIX = ""; |
28 |
my @_profiles = (); |
29 |
# $_use_temp - hashref that represents the current state of |
30 |
# all known flags. This is for data gathering, the public |
31 |
@@ -208,13 +208,13 @@ sub _add_temp |
32 |
|
33 |
|
34 |
# Determine the value for EPREFIX and save it |
35 |
-# in $_EPREFIX. This is done using 'portageq'. |
36 |
+# in $EPREFIX. This is done using 'portageq'. |
37 |
# Other output from portageq is printed on |
38 |
# STDERR. |
39 |
# No parameters accepted. |
40 |
sub _determine_eprefix { |
41 |
my $tmp = "/tmp/ufed_$$.tmp"; |
42 |
- $_EPREFIX = qx{portageq envvar EPREFIX 2>$tmp}; |
43 |
+ $EPREFIX = qx{portageq envvar EPREFIX 2>$tmp}; |
44 |
die "Couldn't determine EPREFIX from Portage" if $? != 0; |
45 |
|
46 |
if ( -s $tmp ) { |
47 |
@@ -225,7 +225,7 @@ sub _determine_eprefix { |
48 |
} |
49 |
-e $tmp and unlink $tmp; |
50 |
|
51 |
- chomp($_EPREFIX); |
52 |
+ chomp($EPREFIX); |
53 |
return; |
54 |
} |
55 |
|
56 |
@@ -234,9 +234,9 @@ sub _determine_eprefix { |
57 |
# and save the result in $used_make_conf |
58 |
sub _determine_make_conf |
59 |
{ |
60 |
- $used_make_conf = "${_EPREFIX}/etc/portage/make.conf"; |
61 |
+ $used_make_conf = "${EPREFIX}/etc/portage/make.conf"; |
62 |
(! -r $used_make_conf) |
63 |
- and $used_make_conf = "${_EPREFIX}/etc/make.conf"; |
64 |
+ and $used_make_conf = "${EPREFIX}/etc/make.conf"; |
65 |
return; |
66 |
} |
67 |
|
68 |
@@ -247,13 +247,13 @@ sub _determine_make_conf |
69 |
# No parameters accepted. |
70 |
sub _determine_profiles |
71 |
{ |
72 |
- my $mp = readlink "${_EPREFIX}/etc/portage/make.profile"; |
73 |
+ my $mp = readlink "${EPREFIX}/etc/portage/make.profile"; |
74 |
defined($mp) |
75 |
- or $mp = readlink "${_EPREFIX}/etc/make.profile"; |
76 |
+ or $mp = readlink "${EPREFIX}/etc/make.profile"; |
77 |
|
78 |
# make.profile is mandatory and must be a link |
79 |
defined($mp) |
80 |
- or die "${_EPREFIX}/etc\{,/portage\}/make.profile is not a symlink\n"; |
81 |
+ or die "${EPREFIX}/etc\{,/portage\}/make.profile is not a symlink\n"; |
82 |
|
83 |
# Start with the linked path, it is the deepest profile child. |
84 |
@_profiles = _norm_path('/etc', $mp); |
85 |
@@ -306,7 +306,7 @@ sub _gen_use_flags |
86 |
my %descCons = (); |
87 |
my $flagRef = $_use_temp->{$flag}; ## Shortcut |
88 |
my $hasGlobal= defined($flagRef->{global}) ? 1 : 0; |
89 |
- my $lCount = ($hasGlobal && length($flagRef->{global}{desc})) ? 1 : 0; |
90 |
+ my $lCount = ($hasGlobal && length($flagRef->{global}{descr})) ? 1 : 0; |
91 |
my $gDesc = ""; |
92 |
my $gKey = ""; |
93 |
my $gRef = $flagRef->{global}; |
94 |
@@ -518,8 +518,8 @@ sub _read_descriptions |
95 |
# overrides. |
96 |
# No parameters accepted. |
97 |
sub _read_make_conf { |
98 |
- my %oldEnv = _read_sh("${_EPREFIX}/etc/make.conf"); |
99 |
- my %newEnv = _read_sh("${_EPREFIX}/etc/portage/make.conf"); |
100 |
+ my %oldEnv = _read_sh("${EPREFIX}/etc/make.conf"); |
101 |
+ my %newEnv = _read_sh("${EPREFIX}/etc/portage/make.conf"); |
102 |
_merge (\%oldEnv, \%newEnv); |
103 |
|
104 |
# Note the conf state of the read flags: |
105 |
@@ -539,8 +539,8 @@ sub _read_make_conf { |
106 |
and push @_profiles, |
107 |
map { my $x=$_; $x =~ s/^\s*(\S+)\s*$/$1\/profiles/mg ; $x } |
108 |
split('\n', $_environment{PORTDIR_OVERLAY}); |
109 |
- -e "${_EPREFIX}/etc/portage/profile" |
110 |
- and push @_profiles, "${_EPREFIX}/etc/portage/profile"; |
111 |
+ -e "${EPREFIX}/etc/portage/profile" |
112 |
+ and push @_profiles, "${EPREFIX}/etc/portage/profile"; |
113 |
return; |
114 |
} |
115 |
|
116 |
@@ -575,7 +575,7 @@ sub _read_make_defaults { |
117 |
# get the final "PORTDIR" and "USE_ORDER" |
118 |
# No parameters accepted |
119 |
sub _read_make_globals { |
120 |
- for my $dir(@_profiles, "${_EPREFIX}/usr/share/portage/config") { |
121 |
+ for my $dir(@_profiles, "${EPREFIX}/usr/share/portage/config") { |
122 |
_read_sh("$dir/make.globals"); |
123 |
} |
124 |
return; |
125 |
@@ -588,14 +588,14 @@ sub _read_make_globals { |
126 |
# No parameters accepted. |
127 |
sub _read_packages { |
128 |
my $pkgdir = undef; |
129 |
- opendir($pkgdir, "${_EPREFIX}/var/db/pkg") |
130 |
- or die "Couldn't read ${_EPREFIX}/var/db/pkg\n"; |
131 |
+ opendir($pkgdir, "${EPREFIX}/var/db/pkg") |
132 |
+ or die "Couldn't read ${EPREFIX}/var/db/pkg\n"; |
133 |
|
134 |
# loop through all categories in pkgdir |
135 |
while(my $cat = readdir $pkgdir) { |
136 |
next if $cat eq '.' or $cat eq '..'; |
137 |
my $catdir = undef; |
138 |
- opendir($catdir, "${_EPREFIX}/var/db/pkg/$cat") |
139 |
+ opendir($catdir, "${EPREFIX}/var/db/pkg/$cat") |
140 |
or next; |
141 |
|
142 |
# loop through all openable directories in cat |
143 |
@@ -621,7 +621,7 @@ sub _read_packages { |
144 |
#} |
145 |
|
146 |
# Load IUSE to learn which use flags the package in this version knows |
147 |
- my $fiuse = "${_EPREFIX}/var/db/pkg/$cat/$pkg/IUSE"; |
148 |
+ my $fiuse = "${EPREFIX}/var/db/pkg/$cat/$pkg/IUSE"; |
149 |
if(open my $use, '<', $fiuse) { |
150 |
local $/; |
151 |
@iuse = split ' ', <$use>; |
152 |
@@ -629,7 +629,7 @@ sub _read_packages { |
153 |
} |
154 |
|
155 |
# Load PKGUSE to learn which use flags have been set when this package was emerged |
156 |
- my $fpuse = "${_EPREFIX}/var/db/pkg/$cat/$pkg/PKGUSE"; |
157 |
+ my $fpuse = "${EPREFIX}/var/db/pkg/$cat/$pkg/PKGUSE"; |
158 |
if(open my $use, '<', $fpuse) { |
159 |
local $/; |
160 |
@puse = split ' ', <$use>; |
161 |
|
162 |
diff --git a/ufed.pl.in b/ufed.pl.in |
163 |
index d31b1b1..e9f4f27 100644 |
164 |
--- a/ufed.pl.in |
165 |
+++ b/ufed.pl.in |
166 |
@@ -167,8 +167,8 @@ sub save_flags { |
167 |
|
168 |
my $contents; |
169 |
|
170 |
- my $makeconf_name = "$Portage::eprefix/etc/portage/make.conf"; |
171 |
- $makeconf_name = "$Portage::eprefix/etc/make.conf" unless(-r $makeconf_name); |
172 |
+ my $makeconf_name = "$Portage::EPREFIX/etc/portage/make.conf"; |
173 |
+ $makeconf_name = "$Portage::EPREFIX/etc/make.conf" unless(-r $makeconf_name); |
174 |
{ |
175 |
open my $makeconf, '<', $makeconf_name or die "Couldn't open $makeconf_name\n"; |
176 |
open my $makeconfold, '>', $makeconf_name . '.old' or die "Couldn't open $makeconf_name.old\n"; |