diff options
author | Francois Pons <fpons@mandriva.com> | 2001-01-05 12:00:47 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-01-05 12:00:47 +0000 |
commit | 1113f1a9304ef42586921f77e0eada2db25b19ea (patch) | |
tree | f2e1308133831833203749448a0a41c3bc5ca475 /perl-install/keyboard.pm | |
parent | 9ced370887c609cd221b798dc871dec78e8d3ee8 (diff) | |
download | drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.tar drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.tar.gz drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.tar.bz2 drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.tar.xz drakx-1113f1a9304ef42586921f77e0eada2db25b19ea.zip |
removed need of packdrake binary
Diffstat (limited to 'perl-install/keyboard.pm')
-rw-r--r-- | perl-install/keyboard.pm | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm index 78f5a13e1..edf74e87e 100644 --- a/perl-install/keyboard.pm +++ b/perl-install/keyboard.pm @@ -256,7 +256,12 @@ sub xmodmap_file { my ($keyboard) = @_; my $f = "$ENV{SHARE_PATH}/xmodmap/xmodmap.$keyboard"; if (! -e $f) { - run_program::run("packdrake", "-x", "$ENV{SHARE_PATH}/xmodmap.cz2", '/tmp', "xmodmap.$keyboard"); + eval { + require packdrake; + my $packer = new packdrake("$ENV{SHARE_PATH}/xmodmap.cz2"); + $packer->extract_archive("/tmp", "xmodmap.$keyboard"); + }; + #run_program::run("packdrake", "-x", "$ENV{SHARE_PATH}/xmodmap.cz2", '/tmp', "xmodmap.$keyboard"); $f = "/tmp/xmodmap.$keyboard"; } -e $f && $f; @@ -272,9 +277,18 @@ sub setup { load(scalar cat_($f)); } else { local *F; - open F, "packdrake -x $ENV{SHARE_PATH}/keymaps.cz2 '' $o->[1].bkmap |"; - local $/ = undef; - eval { load(join('', <F>)) }; + #open F, "packdrake -x $ENV{SHARE_PATH}/keymaps.cz2 '' $o->[1].bkmap |"; + if (my $pid = open F, "-|") { + local $/ = undef; + eval { load(join('', <F>)) }; + waitpid $pid, 0; + } else { + eval { + require packdrake; + my $packer = new packdrake("$ENV{SHARE_PATH}/keymaps.cz2"); + $packer->extract_archive(undef, "$o->[1].bkmap"); + }; + } } my $f = xmodmap_file($keyboard); eval { run_program::run('xmodmap', $f) } unless $::testing || !$f; |