diff options
author | Angelo Naselli <anaselli@linux.it> | 2015-04-25 17:54:08 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2015-04-25 17:54:08 +0200 |
commit | a5bf60bfaada25efe437b309823dc85a74055630 (patch) | |
tree | 3641e241dfd175f34652b5ac315e0f963cec2a84 /lib/ManaTools/Rpmdragora | |
parent | 3fe4551df5f825213c266a2a2b8aad3adecd4507 (diff) | |
download | colin-keep-a5bf60bfaada25efe437b309823dc85a74055630.tar colin-keep-a5bf60bfaada25efe437b309823dc85a74055630.tar.gz colin-keep-a5bf60bfaada25efe437b309823dc85a74055630.tar.bz2 colin-keep-a5bf60bfaada25efe437b309823dc85a74055630.tar.xz colin-keep-a5bf60bfaada25efe437b309823dc85a74055630.zip |
Added --locales-dir also to rpmdragora
Diffstat (limited to 'lib/ManaTools/Rpmdragora')
-rw-r--r-- | lib/ManaTools/Rpmdragora/init.pm | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/lib/ManaTools/Rpmdragora/init.pm b/lib/ManaTools/Rpmdragora/init.pm index f28af34..f029cfb 100644 --- a/lib/ManaTools/Rpmdragora/init.pm +++ b/lib/ManaTools/Rpmdragora/init.pm @@ -51,31 +51,40 @@ our @EXPORT = qw(init our @ARGV_copy = @ARGV; BEGIN { #- we want to run this code before the Gtk->init of the use-my_gtk - my $loc = ManaTools::Shared::Locales->new(domain_name => 'rpmdrake'); + my $locale_dir = undef; + $DB::single = 1; + if ("@ARGV" =~/--locales-dir(\s*(.+))/) { + $locale_dir = $2 ? $2 : $1; + } + my $loc = ManaTools::Shared::Locales->new( + domain_name => 'manatools', + dir_name => $locale_dir, + ); + my $basename = sub { local $_ = shift; s|/*\s*$||; s|.*/||; $_ }; any { /^--?h/ } @ARGV and do { - printf join("\n", $loc->N("Usage: %s [OPTION]...", $basename->($0)), -$loc->N(" --auto assume default answers to questions"), -$loc->N(" --changelog-first display changelog before filelist in the description window"), -$loc->N(" --media=medium1,.. limit to given media"), -$loc->N(" --merge-all-rpmnew propose to merge all .rpmnew/.rpmsave files found"), -$loc->N(" --mode=MODE set mode (install (default), remove, update)"), -$loc->N(" --justdb update the database, but do not modify the filesystem"), -$loc->N(" --no-confirmation don't ask first confirmation question in update mode"), -$loc->N(" --no-media-update don't update media at startup"), -$loc->N(" --no-verify-rpm don't verify package signatures"), -if_($0 !~ /dragoraUpdate/, $loc->N(" --parallel=alias,host be in parallel mode, use \"alias\" group, use \"host\" machine to show needed deps")), -$loc->N(" --rpm-root=path use another root for rpm installation"), -$loc->N(" --urpmi-root use another root for urpmi db & rpm installation"), -$loc->N(" --run-as-root force to run as root"), -$loc->N(" --search=pkg run search for \"pkg\""), -$loc->N(" --test only verify if the installation can be achieved correctly"), -chomp_($loc->N(" --version print this tool's version number -")), -"" -); - exit 0; + printf join("\n", $loc->N("Usage: %s [OPTION]...", $basename->($0)), + $loc->N(" --auto assume default answers to questions"), + $loc->N(" --changelog-first display changelog before filelist in the description window"), + $loc->N(" --media=medium1,.. limit to given media"), + $loc->N(" --merge-all-rpmnew propose to merge all .rpmnew/.rpmsave files found"), + $loc->N(" --mode=MODE set mode (install (default), remove, update)"), + $loc->N(" --justdb update the database, but do not modify the filesystem"), + $loc->N(" --no-confirmation don't ask first confirmation question in update mode"), + $loc->N(" --no-media-update don't update media at startup"), + $loc->N(" --no-verify-rpm don't verify package signatures"), + if_($0 !~ /dragoraUpdate/, $loc->N(" --parallel=alias,host be in parallel mode, use \"alias\" group, use \"host\" machine to show needed deps")), + $loc->N(" --rpm-root=path use another root for rpm installation"), + $loc->N(" --urpmi-root use another root for urpmi db & rpm installation"), + $loc->N(" --run-as-root force to run as root"), + $loc->N(" --search=pkg run search for \"pkg\""), + $loc->N(" --test only verify if the installation can be achieved correctly"), + chomp_($loc->N(" --version print this tool's version number + ")), + "" + ); + exit 0; }; } @@ -162,7 +171,7 @@ our $changelog_first = $ManaTools::rpmdragora::changelog_first_config->[0]; $changelog_first = 1 if $rpmdragora_options{'changelog-first'}; sub warn_about_user_mode() { - my $loc = ManaTools::Shared::Locales->new(domain_name => 'rpmdrake'); + my $loc = ManaTools::rpmdragora::locale(); my $title = $loc->N("Running in user mode"); my $msg = $loc->N("You are launching this program as a normal user.\n". "You will not be able to perform modifications on the system,\n". |