diff options
author | Dexter Morgan <dmorgan@mageia.org> | 2011-06-02 20:51:35 +0000 |
---|---|---|
committer | Dexter Morgan <dmorgan@mageia.org> | 2011-06-02 20:51:35 +0000 |
commit | a9b2bdafaf625d10aef2f476aa4014fd36c846bc (patch) | |
tree | 2364afc0ee6739b59a25c44d68c9f003bcaf03d9 /perl-install/standalone/drakhelp | |
download | drakx-a9b2bdafaf625d10aef2f476aa4014fd36c846bc.tar drakx-a9b2bdafaf625d10aef2f476aa4014fd36c846bc.tar.gz drakx-a9b2bdafaf625d10aef2f476aa4014fd36c846bc.tar.bz2 drakx-a9b2bdafaf625d10aef2f476aa4014fd36c846bc.tar.xz drakx-a9b2bdafaf625d10aef2f476aa4014fd36c846bc.zip |
Branch for updates
Diffstat (limited to 'perl-install/standalone/drakhelp')
-rwxr-xr-x | perl-install/standalone/drakhelp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/perl-install/standalone/drakhelp b/perl-install/standalone/drakhelp new file mode 100755 index 000000000..2e77168a0 --- /dev/null +++ b/perl-install/standalone/drakhelp @@ -0,0 +1,54 @@ +#!/usr/bin/perl + +use strict; +use diagnostics; + +use lib qw(/usr/lib/libDrakX); +use standalone; #- warning, standalone must be loaded very first, for 'explanations' + +use interactive; +use common; +use any; +use ctxhelp; +use log; + + +sub usage() { + print STDERR N(" drakhelp 0.1 +Copyright (C) %s Mandriva. +Copyright (C) %s Mageia. +This is free software and may be redistributed under the terms of the GNU GPL. + +Usage: +", '2003-2008', '2011') . N(" --help - display this help +") . N(" --id <id_label> - load the html help page which refers to id_label +") . N(" --doc <link> - link to another web page ( for WM welcome frontend) +"); + exit(0); +} +my ($opt, $idlabel) = @ARGV; +@ARGV == 2 && ($opt eq '--id' || $opt eq '--doc' || $opt eq '--help') or usage(); + + + +my ($instpath, $ancpath, $package) = ctxhelp::path2help($opt, $idlabel); +if (! -e $instpath) { + system('/usr/sbin/drakhelp_inst', $package); +} + +if (! -e $instpath) { + #- trying again, asking for the english entry + ($instpath, $ancpath, my $package2) = ctxhelp::path2help($opt, $idlabel, 'en'); + if (! -e $instpath && $package ne $package2) { + system("/usr/sbin/drakhelp_inst $package2"); + } +} + +if (-f $instpath) { + local $ENV{HOME} = '/root' if !$<; + run_program::raw({ detach => 1 }, 'display_help', "file://$ancpath"); +} else { + $ugtk2::wm_icon = "help"; + my $in = interactive->vnew; + $in->ask_warn(N("%s Help Center"), N("No Help entry for %s\n", $idlabel)); +} |