Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 478126 | Differences between
and this patch

Collapse All | Expand All

(-)a/lib/PortageXS.pm (-8 / +8 lines)
Lines 71-78 sub new { Link Here
71
	$pxs->{'VERSION'}			= $PortageXS::VERSION;
71
	$pxs->{'VERSION'}			= $PortageXS::VERSION;
72
72
73
	$pxs->{'PORTDIR'}			= $pxs->getPortdir();
73
	$pxs->{'PORTDIR'}			= $pxs->getPortdir();
74
	$pxs->{'PKG_DB_DIR'}			= '/var/db/pkg/';
74
	$pxs->{'PKG_DB_DIR'}			= '@GENTOO_PORTAGE_EPREFIX@/var/db/pkg/';
75
	$pxs->{'PATH_TO_WORLDFILE'}		= '/var/lib/portage/world';
75
	$pxs->{'PATH_TO_WORLDFILE'}		= '@GENTOO_PORTAGE_EPREFIX@/var/lib/portage/world';
76
	$pxs->{'IS_INITIALIZED'}		= 1;
76
	$pxs->{'IS_INITIALIZED'}		= 1;
77
77
78
	$pxs->{'EXCLUDE_DIRS'}{'.'}		= 1;
78
	$pxs->{'EXCLUDE_DIRS'}{'.'}		= 1;
Lines 85-101 sub new { Link Here
85
	$pxs->{'EXCLUDE_DIRS'}{'CVS'}		= 1;
85
	$pxs->{'EXCLUDE_DIRS'}{'CVS'}		= 1;
86
	$pxs->{'EXCLUDE_DIRS'}{'.cache'}	= 1;
86
	$pxs->{'EXCLUDE_DIRS'}{'.cache'}	= 1;
87
87
88
	$pxs->{'PORTAGEXS_ETC_DIR'}		= '/etc/pxs/';
88
	$pxs->{'PORTAGEXS_ETC_DIR'}		= '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/';
89
	$pxs->{'ETC_DIR'}			= '/etc/';
89
	$pxs->{'ETC_DIR'}			= '@GENTOO_PORTAGE_EPREFIX@/etc/';
90
90
91
	$pxs->{'MAKE_PROFILE_PATHS'} = [
91
	$pxs->{'MAKE_PROFILE_PATHS'} = [
92
		'/etc/make.profile',
92
		'@GENTOO_PORTAGE_EPREFIX@/etc/make.profile',
93
		'/etc/portage/make.profile'
93
		'@GENTOO_PORTAGE_EPREFIX@/etc/portage/make.profile'
94
	];
94
	];
95
95
96
	$pxs->{'MAKE_CONF_PATHS'} = [
96
	$pxs->{'MAKE_CONF_PATHS'} = [
97
		'/etc/make.conf',
97
		'@GENTOO_PORTAGE_EPREFIX@/etc/make.conf',
98
		'/etc/portage/make.conf'
98
		'@GENTOO_PORTAGE_EPREFIX@/etc/portage/make.conf'
99
	];
99
	];
100
100
101
	for my $path ( @{ $pxs->{'MAKE_PROFILE_PATHS'} } ) {
101
	for my $path ( @{ $pxs->{'MAKE_PROFILE_PATHS'} } ) {
(-)a/lib/PortageXS/Core.pm (-4 / +4 lines)
Lines 118-124 sub getPortageMakeParam { Link Here
118
	my $self		= shift;
118
	my $self		= shift;
119
	my $param		= shift;
119
	my $param		= shift;
120
	my @files		= ();
120
	my @files		= ();
121
	my @etcfiles		= qw(/usr/share/portage/config/make.globals /etc/make.conf);
121
	my @etcfiles		= qw(@GENTOO_PORTAGE_EPREFIX@/usr/share/portage/config/make.globals @GENTOO_PORTAGE_EPREFIX@/etc/make.conf);
122
	my $v			= '';
122
	my $v			= '';
123
	my $parent		= '';
123
	my $parent		= '';
124
	my $curPath;
124
	my $curPath;
Lines 162-168 sub getPortageMakeParam { Link Here
162
162
163
	# - Defaults >
163
	# - Defaults >
164
	if ($param eq 'PORTDIR' && !$v) {
164
	if ($param eq 'PORTDIR' && !$v) {
165
		$v='/usr/portage';
165
		$v='@GENTOO_PORTAGE_EPREFIX@/usr/portage';
166
	}
166
	}
167
167
168
	return $v;
168
	return $v;
Lines 189-195 sub getPortdir { Link Here
189
		return $self->{'PORTDIR'};
189
		return $self->{'PORTDIR'};
190
	}
190
	}
191
	else {
191
	else {
192
		$self->{'PORTDIR'}=$self->getParamFromFile($self->getFileContents('/usr/share/portage/config/make.globals').$self->getFileContents('/etc/portage/make.conf'),'PORTDIR','lastseen');
192
		$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');
193
		return $self->{'PORTDIR'};
193
		return $self->{'PORTDIR'};
194
	}
194
	}
195
}
195
}
Lines 206-212 sub getPortdirOverlay { Link Here
206
	my $self	= shift;
206
	my $self	= shift;
207
	my $forcereload	= shift;
207
	my $forcereload	= shift;
208
208
209
	return split(/ /,$self->getParamFromFile($self->getFileContents('/usr/share/portage/config/make.globals').$self->getFileContents('/etc/make.conf'),'PORTDIR_OVERLAY','lastseen'));
209
	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'));
210
}
210
}
211
211
212
# Description:
212
# Description:
(-)a/usr/bin/portagexs_client (-4 / +4 lines)
Lines 1-4 Link Here
1
#!/usr/bin/perl
1
#!@GENTOO_PORTAGE_EPREFIX@/usr/bin/perl
2
2
3
# -----------------------------------------------------------------------------
3
# -----------------------------------------------------------------------------
4
#
4
#
Lines 54-62 if(!($sock = IO::Socket::SSL->new( PeerAddr => $remote_addr, Link Here
54
				SSL_use_cert => 1,
54
				SSL_use_cert => 1,
55
				SSL_verify_mode => 0x01,
55
				SSL_verify_mode => 0x01,
56
				SSL_passwd_cb => sub { return "" },
56
				SSL_passwd_cb => sub { return "" },
57
				SSL_key_file => '/etc/pxs/certs/client-key.pem',
57
				SSL_key_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/client-key.pem',
58
				SSL_cert_file => '/etc/pxs/certs/client-cert.pem',
58
				SSL_cert_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/client-cert.pem',
59
				SSL_ca_file => '/etc/pxs/certs/my-ca.pem'
59
				SSL_ca_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/my-ca.pem'
60
				 ))) {
60
				 ))) {
61
	$pxs->print_err("unable to create socket: ".&IO::Socket::SSL::errstr."\n");
61
	$pxs->print_err("unable to create socket: ".&IO::Socket::SSL::errstr."\n");
62
	$pxs->print_err("Server down?\n");
62
	$pxs->print_err("Server down?\n");
(-)a/usr/sbin/portagexsd (-6 / +5 lines)
Lines 50-56 else { Link Here
50
sub main {
50
sub main {
51
	# - Parse config >
51
	# - Parse config >
52
	my %config	= ();
52
	my %config	= ();
53
	$config{'cfgfiledata'} = $pxs->getFileContents("/etc/pxs/portagexsd.conf");
53
	$config{'cfgfiledata'} = $pxs->getFileContents("@GENTOO_PORTAGE_EPREFIX@/etc/pxs/portagexsd.conf");
54
	$config{'Port'} = $pxs->getParamFromFile($config{'cfgfiledata'},"Port","lastseen");
54
	$config{'Port'} = $pxs->getParamFromFile($config{'cfgfiledata'},"Port","lastseen");
55
	$config{'SSLpasswd'} = $pxs->getParamFromFile($config{'cfgfiledata'},"SSLpasswd","lastseen");
55
	$config{'SSLpasswd'} = $pxs->getParamFromFile($config{'cfgfiledata'},"SSLpasswd","lastseen");
56
	$config{'PidFile'} = $pxs->getParamFromFile($config{'cfgfiledata'},"PidFile","lastseen");
56
	$config{'PidFile'} = $pxs->getParamFromFile($config{'cfgfiledata'},"PidFile","lastseen");
Lines 60-66 sub main { Link Here
60
	$config{'cfgfiledata'} = undef;
60
	$config{'cfgfiledata'} = undef;
61
61
62
	if (!$config{'I_AM_ROOT_AND_I_KNOW_WHAT_I_AM_DOING'}) {
62
	if (!$config{'I_AM_ROOT_AND_I_KNOW_WHAT_I_AM_DOING'}) {
63
		syslog("info", 'Not starting server as it seems that you did not have a look at the configs yet! (/etc/pxs/portagexsd.conf)');
63
		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)');
64
		exit(0);
64
		exit(0);
65
	}
65
	}
66
66
Lines 70-78 sub main { Link Here
70
				Reuse     => 1,
70
				Reuse     => 1,
71
				SSL_verify_mode => 0x01,
71
				SSL_verify_mode => 0x01,
72
				SSL_passwd_cb => sub {return $config{'SSLpasswd'}},
72
				SSL_passwd_cb => sub {return $config{'SSLpasswd'}},
73
				SSL_key_file => '/etc/pxs/certs/server-key.pem',
73
				SSL_key_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/server-key.pem',
74
				SSL_cert_file => '/etc/pxs/certs/server-cert.pem',
74
				SSL_cert_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/server-cert.pem',
75
				SSL_ca_file => '/etc/pxs/certs/my-ca.pem'
75
				SSL_ca_file => '@GENTOO_PORTAGE_EPREFIX@/etc/pxs/certs/my-ca.pem'
76
			)) ) {
76
			)) ) {
77
		syslog("info", "Unable to create socket: ", &IO::Socket::SSL::errstr);
77
		syslog("info", "Unable to create socket: ", &IO::Socket::SSL::errstr);
78
		exit(0);
78
		exit(0);
79
- 

Return to bug 478126