aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-10-11 10:53:37 +0000
committerThierry Vignaud <tv@mandriva.org>2008-10-11 10:53:37 +0000
commitee42313152d478692d6daaa743a9f4be3c554226 (patch)
treea3bc3089c41dcfc188792e5f2a83f2a8f92a638c
parent5bd0ccd62c6569fb8f8a48532be77cdd5f8a3850 (diff)
downloadrpmdrake-ee42313152d478692d6daaa743a9f4be3c554226.tar
rpmdrake-ee42313152d478692d6daaa743a9f4be3c554226.tar.gz
rpmdrake-ee42313152d478692d6daaa743a9f4be3c554226.tar.bz2
rpmdrake-ee42313152d478692d6daaa743a9f4be3c554226.tar.xz
rpmdrake-ee42313152d478692d6daaa743a9f4be3c554226.zip
open the chrooted .rpmdrake config file when using --env
-rw-r--r--NEWS1
-rw-r--r--Rpmdrake/init.pm10
-rw-r--r--rpmdrake.pm1
3 files changed, 8 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 8c0db065..1efcff3e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+- open the chrooted .rpmdrake config file when using --env
- rpmdrake:
o enable to set 'noclean' option (#13522)
diff --git a/Rpmdrake/init.pm b/Rpmdrake/init.pm
index da5db001..3e9a8469 100644
--- a/Rpmdrake/init.pm
+++ b/Rpmdrake/init.pm
@@ -79,7 +79,6 @@ BEGIN { #- for mcc
}
}
-use rpmdrake;
#- This is needed because text printed by Gtk2 will always be encoded
#- in UTF-8; we first check if LC_ALL is defined, because if it is,
@@ -148,14 +147,17 @@ if ($MODE eq 'remove') {
$MODE eq 'update' || $rpmdrake_options{'run-as-root'} || $rpmdrake_options{root} and require_root_capability();
$::noborderWhenEmbedded = 1;
-our $changelog_first = $changelog_first_config->[0];
+require rpmdrake;
+
+our $changelog_first = $rpmdrake::changelog_first_config->[0];
$changelog_first = 1 if $rpmdrake_options{'changelog-first'};
sub warn_about_user_mode() {
- $> and (interactive_msg(N("Running in user mode"),
+ $> and (rpmdrake::interactive_msg(N("Running in user mode"),
N("You are launching this program as a normal user.
You will not be able to perform modifications on the system,
-but you may still browse the existing database."), yesno => 1, text => { no => N("Cancel"), yes => N("Ok") }) or myexit(0));
+but you may still browse the existing database."), yesno => 1, text => { no => N("Cancel"), yes => N("Ok") })
+ or rpmdrake::myexit(0));
}
sub init() {
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 9d22008d..4634e850 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -152,6 +152,7 @@ sub myexit {
my ($root) = grep { $_->[2] == 0 } list_passwd();
$ENV{HOME} = $> == 0 ? $root->[7] : $ENV{HOME} || '/root';
+$ENV{HOME} = $::env if $::env = $Rpmdrake::init::rpmdrake_options{env}[0];
our $configfile = "$ENV{HOME}/.rpmdrake";
our ($changelog_first_config, $filter, $max_info_in_descr, $mode, $tree_flat, $tree_mode);