diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-08-12 19:53:35 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-08-12 19:53:35 +0000 |
commit | e19d9995e525fe989b3a674579c063a19825a272 (patch) | |
tree | 9d035355299146eec7e840276eb33db5e2daf527 | |
parent | f14f1e0e797b3305e2e6a53a4ad14e5064076559 (diff) | |
download | urpmi-e19d9995e525fe989b3a674579c063a19825a272.tar urpmi-e19d9995e525fe989b3a674579c063a19825a272.tar.gz urpmi-e19d9995e525fe989b3a674579c063a19825a272.tar.bz2 urpmi-e19d9995e525fe989b3a674579c063a19825a272.tar.xz urpmi-e19d9995e525fe989b3a674579c063a19825a272.zip |
- urpmi
o when using --urpmi-root, load <root>/etc/rpm/macros
this allow using _install_langs in the rooted directory
- fix test exclude.t: the build computer macro _install_langs don't interfere
anymore
- add one test to exclude.t: test wether urpmi correctly honor _install_langs
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | t/superuser--exclude.t | 23 | ||||
-rw-r--r-- | urpm.pm | 5 |
3 files changed, 28 insertions, 2 deletions
@@ -1,3 +1,5 @@ +- urpmi + o when using --urpmi-root, load <root>/etc/rpm/macros - urpmi.cfg o really add global option no-suggests diff --git a/t/superuser--exclude.t b/t/superuser--exclude.t index f7f14405..a59a2c32 100644 --- a/t/superuser--exclude.t +++ b/t/superuser--exclude.t @@ -16,20 +16,39 @@ my @want = `rpm -qpl media/$name/$name-1-1.*.rpm`; urpmi_addmedia("$name $::pwd/media/$name"); +set_install_langs_macro('fr'); + foreach ([ '', \@want ], [ '--excludedocs', [ grep { !m!^/usr/share/doc! } @want ] ], [ '--excludepath /usr', [ grep { !m!^/usr! } @want ] ], ) { my ($option, $want) = @$_; - test_rpm_cmdline($option, $want); + test_rpm_cmdline($option, 'fr', $want); test_urpmi_cmdline($option, $want); test_urpmi_through_urpmi_cfg($option, $want); } +{ + set_install_langs_macro('en'); + my $want = [ grep { !m!^/usr/share/locale/! } @want ]; + test_rpm_cmdline('', 'en', $want); + + test_urpmi_cmdline('', $want); +} + +sub set_install_langs_macro { + my ($langs) = @_; + mkdir "$::pwd/root/etc/rpm"; + my $macros_file = "$::pwd/root/etc/rpm/macros"; + system("echo \%_install_langs $langs > $macros_file"); + ok(-e $macros_file); +} + sub test_rpm_cmdline { - my ($option, $want) = @_; + my ($option, $lang, $want) = @_; + $option = "$option --define='_install_langs $lang'"; system_("rpm --root $::pwd/root -i $option media/$name/$name-1-1.*.rpm"); check("rpm -i $option", $want); system_("rpm --root $::pwd/root -e $name"); @@ -74,6 +74,11 @@ sub set_files { dirname($h{config}), "$urpmi_root/var/lib/rpm", ]); + + if ($urpmi_root && -e "$urpmi_root/etc/rpm/macros") { + URPM::loadmacrosfile("$urpmi_root/etc/rpm/macros"); + } + } sub protocol_from_url { |