Gentoo Archives: gentoo-commits

From: "Mikle Kolyada (zlogene)" <zlogene@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-perl/PortageXS/files/0.02.12: PortageXS-0.02.12-prefix.patch
Date: Fri, 27 Jun 2014 09:22:43
Message-Id: 20140627092239.35A372004E@flycatcher.gentoo.org
1 zlogene 14/06/27 09:22:39
2
3 Added: PortageXS-0.02.12-prefix.patch
4 Log:
5 Fix a typo
6
7 Revision Changes Path
8 1.1 dev-perl/PortageXS/files/0.02.12/PortageXS-0.02.12-prefix.patch
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-perl/PortageXS/files/0.02.12/PortageXS-0.02.12-prefix.patch?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-perl/PortageXS/files/0.02.12/PortageXS-0.02.12-prefix.patch?rev=1.1&content-type=text/plain
12
13 Index: PortageXS-0.02.12-prefix.patch
14 ===================================================================
15 lib/PortageXS.pm | 16 ++++++++--------
16 lib/PortageXS/Core.pm | 8 ++++----
17 lib/PortageXS/examples/getParamFromFile.pl | 2 +-
18 t/01_Core.t | 12 ++++++------
19 usr/bin/portagexs_client | 8 ++++----
20 usr/sbin/portagexsd | 12 ++++++------
21 6 files changed, 29 insertions(+), 29 deletions(-)
22
23 diff --git a/lib/PortageXS.pm b/lib/PortageXS.pm
24 index db57a25..6cec46e 100644
25 --- a/lib/PortageXS.pm
26 +++ b/lib/PortageXS.pm
27 @@ -71,8 +71,8 @@ sub new {
28 $pxs->{'VERSION'} = $PortageXS::VERSION;
29
30 $pxs->{'PORTDIR'} = $pxs->getPortdir();
31 - $pxs->{'PKG_DB_DIR'} = '/var/db/pkg/';
32 - $pxs->{'PATH_TO_WORLDFILE'} = '/var/lib/portage/world';
33 + $pxs->{'PKG_DB_DIR'} = '@GENTOO_PORTAGE_EPREFIX@/var/db/pkg/';
34 + $pxs->{'PATH_TO_WORLDFILE'} = '@GENTOO_PORTAGE_EPREFIX@/var/lib/portage/world';
35 $pxs->{'IS_INITIALIZED'} = 1;
36
37 $pxs->{'EXCLUDE_DIRS'}{'.'} = 1;
38 @@ -85,17 +85,17 @@ sub new {
39 $pxs->{'EXCLUDE_DIRS'}{'CVS'} = 1;
40 $pxs->{'EXCLUDE_DIRS'}{'.cache'} = 1;
41
42 - $pxs->{'PORTAGEXS_ETC_DIR'} = '/etc/pxs/';
43 - $pxs->{'ETC_DIR'} = '/etc/';
44 + $pxs->{'PORTAGEXS_ETC_DIR'} = '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/';
45 + $pxs->{'ETC_DIR'} = '@GENTOO_PORTAGE_EPREFIX@/etc/';
46
47 $pxs->{'MAKE_PROFILE_PATHS'} = [
48 - '/etc/make.profile',
49 - '/etc/portage/make.profile'
50 + '@GENTOO_PORTAGE_EPREFIX@/etc/make.profile',
51 + '@GENTOO_PORTAGE_EPREFIX@/etc/portage/make.profile'
52 ];
53
54 $pxs->{'MAKE_CONF_PATHS'} = [
55 - '/etc/make.conf',
56 - '/etc/portage/make.conf'
57 + '@GENTOO_PORTAGE_EPREFIX@/etc/make.conf',
58 + '@GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf'
59 ];
60
61 for my $path ( @{ $pxs->{'MAKE_PROFILE_PATHS'} } ) {
62 diff --git a/lib/PortageXS/Core.pm b/lib/PortageXS/Core.pm
63 index 5d51023..3dd0b84 100644
64 --- a/lib/PortageXS/Core.pm
65 +++ b/lib/PortageXS/Core.pm
66 @@ -122,7 +122,7 @@ sub getPortageMakeParam {
67 my $self = shift;
68 my $param = shift;
69 my @files = ();
70 - my @etcfiles = qw(/usr/share/portage/config/make.globals /etc/make.conf);
71 + my @etcfiles = qw(@GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals @GENTOO_PORTAGE_EPREFIX@/etc/make.conf);
72 my $v = '';
73 my $parent = '';
74 my $curPath;
75 @@ -166,7 +166,7 @@ sub getPortageMakeParam {
76
77 # - Defaults >
78 if ($param eq 'PORTDIR' && !$v) {
79 - $v='/usr/portage';
80 + $v='@GENTOO_PORTAGE_EPREFIX@/usr/portage';
81 }
82
83 return $v;
84 @@ -193,7 +193,7 @@ sub getPortdir {
85 return $self->{'PORTDIR'};
86 }
87 else {
88 - $self->{'PORTDIR'}=$self->getParamFromFile($self->getFileContents('/usr/share/portage/config/make.globals').$self->getFileContents('/etc/portage/make.conf'),'PORTDIR','lastseen');
89 + $self->{'PORTDIR'}=$self->getParamFromFile($self->getFileContents('@GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals').$self->getFileContents('@GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf'),'PORTDIR','lastseen');
90 return $self->{'PORTDIR'};
91 }
92 }
93 @@ -210,7 +210,7 @@ sub getPortdirOverlay {
94 my $self = shift;
95 my $forcereload = shift;
96
97 - return split(/ /,$self->getParamFromFile($self->getFileContents('/usr/share/portage/config/make.globals').$self->getFileContents('/etc/make.conf'),'PORTDIR_OVERLAY','lastseen'));
98 + return split(/ /,$self->getParamFromFile($self->getFileContents('@GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals').$self->getFileContents('@GENTOO_PORTAGE_EPREFIX@/etc/make.conf'),'PORTDIR_OVERLAY','lastseen'));
99 }
100
101 # Description:
102 diff --git a/lib/PortageXS/examples/getParamFromFile.pl b/lib/PortageXS/examples/getParamFromFile.pl
103 index 416b1be..9ea88bb 100755
104 --- a/lib/PortageXS/examples/getParamFromFile.pl
105 +++ b/lib/PortageXS/examples/getParamFromFile.pl
106 @@ -8,4 +8,4 @@ use PortageXS;
107
108 my $pxs=PortageXS->new();
109 print "CFLAGS are set to: ";
110 -print join(' ',$pxs->getParamFromFile($pxs->getFileContents('/etc/make.globals').$pxs->getFileContents('/etc/make.conf'),'CFLAGS','lastseen'))."\n";
111 +print join(' ',$pxs->getParamFromFile($pxs->getFileContents('@GENTOO_PORTAGE_EPREFIX@/etc/make.globals').$pxs->getFileContents('@GENTOO_PORTAGE_EPREFIX@/etc/make.conf'),'CFLAGS','lastseen'))."\n";
112 diff --git a/t/01_Core.t b/t/01_Core.t
113 index d01dc31..6daba99 100644
114 --- a/t/01_Core.t
115 +++ b/t/01_Core.t
116 @@ -14,8 +14,8 @@ ok(-d $pxs->getPortdir(),'getPortdir: '.$pxs->getPortdir());
117
118 # - getFileContents >
119 {
120 - my $content = $pxs->getFileContents('/etc/portage/make.conf');
121 - ok($content ne '','getFileContents of /etc/portage/make.conf');
122 + my $content = $pxs->getFileContents('@GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf');
123 + ok($content ne '','getFileContents of @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf');
124 }
125
126 # - searchInstalledPackage >
127 @@ -26,8 +26,8 @@ ok(-d $pxs->getPortdir(),'getPortdir: '.$pxs->getPortdir());
128
129 # - getParamFromFile >
130 {
131 - my $param = $pxs->getParamFromFile($pxs->getFileContents('/etc/portage/make.conf'),'CFLAGS','lastseen');
132 - ok($param ne '','getParamFromFile /etc/portage/make.conf - CFLAGS: '.$param);
133 + my $param = $pxs->getParamFromFile($pxs->getFileContents('@GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf'),'CFLAGS','lastseen');
134 + ok($param ne '','getParamFromFile @GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf - CFLAGS: '.$param);
135 }
136
137 # - getUseSettingsOfInstalledPackage >
138 @@ -65,8 +65,8 @@ ok(-d $pxs->getPortdir(),'getPortdir: '.$pxs->getPortdir());
139
140 # - fileBelongsToPackage >
141 {
142 - my @packages = $pxs->fileBelongsToPackage('/etc/gentoo-release');
143 - ok($#packages==0,'fileBelongsToPackage - /etc/gentoo-release: '.$packages[0]);
144 + my @packages = $pxs->fileBelongsToPackage('@GENTOO_PORTAGE_EPREFIX@/etc/gentoo-release');
145 + ok($#packages==0,'fileBelongsToPackage - @GENTOO_PORTAGE_EPREFIX@/etc/gentoo-release: '.$packages[0]);
146 }
147 ok(!$pxs->fileBelongsToPackage('/this/path/most/likely/does/not/exist'),'fileBelongsToPackage bogus test');
148
149 diff --git a/usr/bin/portagexs_client b/usr/bin/portagexs_client
150 index 598d05a..688cb97 100755
151 --- a/usr/bin/portagexs_client
152 +++ b/usr/bin/portagexs_client
153 @@ -1,4 +1,4 @@
154 -#!/usr/bin/perl
155 +#!@GENTOO_PORTAGE_EPREFIX@/usr/bin/perl
156
157 # -----------------------------------------------------------------------------
158 #
159 @@ -54,9 +54,9 @@ if(!($sock = IO::Socket::SSL->new( PeerAddr => $remote_addr,
160 SSL_use_cert => 1,
161 SSL_verify_mode => 0x01,
162 SSL_passwd_cb => sub { return "" },
163 - SSL_key_file => '/etc/pxs/certs/client-key.pem',
164 - SSL_cert_file => '/etc/pxs/certs/client-cert.pem',
165 - SSL_ca_file => '/etc/pxs/certs/my-ca.pem'
166 + SSL_key_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/client-key.pem',
167 + SSL_cert_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/client-cert.pem',
168 + SSL_ca_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/my-ca.pem'
169 ))) {
170 $pxs->print_err("unable to create socket: ".&IO::Socket::SSL::errstr."\n");
171 $pxs->print_err("Server down?\n");
172 diff --git a/usr/sbin/portagexsd b/usr/sbin/portagexsd
173 index 638f662..e93bdfa 100755
174 --- a/usr/sbin/portagexsd
175 +++ b/usr/sbin/portagexsd
176 @@ -1,4 +1,4 @@
177 -#!/usr/bin/perl -t
178 +#!@GENTOO_PORTAGE_EPREFIX@/usr/bin/perl -t
179
180 # -----------------------------------------------------------------------------
181 #
182 @@ -50,7 +50,7 @@ else {
183 sub main {
184 # - Parse config >
185 my %config = ();
186 - $config{'cfgfiledata'} = $pxs->getFileContents("/etc/pxs/portagexsd.conf");
187 + $config{'cfgfiledata'} = $pxs->getFileContents("@GENTOO_PORTAGE_EPREFIX@/etc/pxs/portagexsd.conf");
188 $config{'Port'} = $pxs->getParamFromFile($config{'cfgfiledata'},"Port","lastseen");
189 $config{'SSLpasswd'} = $pxs->getParamFromFile($config{'cfgfiledata'},"SSLpasswd","lastseen");
190 $config{'PidFile'} = $pxs->getParamFromFile($config{'cfgfiledata'},"PidFile","lastseen");
191 @@ -60,7 +60,7 @@ sub main {
192 $config{'cfgfiledata'} = undef;
193
194 if (!$config{'I_AM_ROOT_AND_I_KNOW_WHAT_I_AM_DOING'}) {
195 - syslog("info", 'Not starting server as it seems that you did not have a look at the configs yet! (/etc/pxs/portagexsd.conf)');
196 + syslog("info", 'Not starting server as it seems that you did not have a look at the configs yet! (@GENTOO_PORTAGE_EPREFIX@/etc/pxs/portagexsd.conf)');
197 exit(0);
198 }
199
200 @@ -70,9 +70,9 @@ sub main {
201 Reuse => 1,
202 SSL_verify_mode => 0x01,
203 SSL_passwd_cb => sub {return $config{'SSLpasswd'}},
204 - SSL_key_file => '/etc/pxs/certs/server-key.pem',
205 - SSL_cert_file => '/etc/pxs/certs/server-cert.pem',
206 - SSL_ca_file => '/etc/pxs/certs/my-ca.pem'
207 + SSL_key_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/server-key.pem',
208 + SSL_cert_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/server-cert.pem',
209 + SSL_ca_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/my-ca.pem'
210 )) ) {
211 syslog("info", "Unable to create socket: ", &IO::Socket::SSL::errstr);
212 exit(0);