diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-09-23 21:33:29 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-09-23 21:33:29 +0000 |
commit | 79b5a20698ee4d4f1b07da9fceebc1d549b6a548 (patch) | |
tree | a8c317b3b7f88e3c10c2fa866ca793ad2708e305 /perl-install | |
parent | c3640b88aed5689eb4b598f9733baa724da7f15e (diff) | |
download | drakx-79b5a20698ee4d4f1b07da9fceebc1d549b6a548.tar drakx-79b5a20698ee4d4f1b07da9fceebc1d549b6a548.tar.gz drakx-79b5a20698ee4d4f1b07da9fceebc1d549b6a548.tar.bz2 drakx-79b5a20698ee4d4f1b07da9fceebc1d549b6a548.tar.xz drakx-79b5a20698ee4d4f1b07da9fceebc1d549b6a548.zip |
(move_fonts) factorize clean fonts move
Diffstat (limited to 'perl-install')
-rwxr-xr-x | perl-install/standalone/drakfont | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index 1143f7c33..b4db98bf2 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -323,6 +323,11 @@ sub convert_ttf_fonts { } +sub move_fonts { + my ($src_dir, $dest_dir, @extensions) = @_; + my @fonts = map { s@.*/@@; $_ } map { glob("$src_dir/*.$_") } @extensions; + system("cd $src_dir && mv @fonts $dest_dir") if @fonts; +} sub put_font_dir() { -e "/usr/share/ghostscript" or do { $gs = 0; print "ghostscript is not installed on your system...\n" }; @@ -346,17 +351,16 @@ sub put_font_dir() { if ($gs) { convert_ttf_fonts([ glob("$drakfont_dir/tmp/tmp/*.ttf") ], 1); - my @fonts = map { s@.*/@@; $_ } map { glob("$drakfont_dir/tmp/tmp/*.$_") } qw(gsf pfb pfm afm); - system("cd $drakfont_dir/tmp/tmp && mv @fonts ../Type1") if @fonts; + move_fonts("$drakfont_dir/tmp/tmp", "../Type1", qw(afm gsf pfb pfm)); system("cd $drakfont_dir/tmp/Type1 && $type1inst"); interactive_progress($pbar2, 0.1, N("type1inst building")); if ($so) { -e "$drakfont_dir/tmp/Type1/Fontmap" and system("cd $drakfont_dir/tmp/Type1 && cat Fontmap >> `rpm -ql ghostscript | grep Fontmap.GS` "); - system("cd $drakfont_dir/tmp/Type1 && mv *.pfm *.gsf *.afm *.pfb ../../Type1 "); + move_fonts("$drakfont_dir/tmp/Type1", "../../Type1", qw(afm gsf pfb pfm)); } else { system("cd $drakfont_dir/tmp/Type1 && cat Fontmap >> `rpm -ql ghostscript | grep Fontmap.GS` "); - system("cd $drakfont_dir/tmp/Type1 && mv *.pfm *.afm *.gsf *.pfb ../../Type1 "); + move_fonts("$drakfont_dir/tmp/Type1", "../../Type1", qw(afm gsf pfb pfm)); } my $type1dir = $drakfont_dir . "/Type1"; system("cd $type1dir && $fccache && $type1inst"); @@ -365,8 +369,8 @@ sub put_font_dir() { } elsif ($so) { convert_ttf_fonts([ glob("$drakfont_dir/tmp/tmp/*.ttf") ]); convert_fonts([ glob("$drakfont_dir/tmp/tmp/*.pfm") ], $pfm2afm, "PFM"); - system("cd $drakfont_dir/tmp/tmp && mv *.afm ../Type1"); - system("cd $drakfont_dir/tmp/Type1 && mv *.afm ../../Type1 "); + move_fonts("$drakfont_dir/tmp/tmp", "../Type1", qw(afm)); + move_fonts("$drakfont_dir/tmp/Type1", "../../Type1", qw(afm)); my $type1dir = $drakfont_dir . "/Type1"; system("cd $type1dir && $fccache && $type1inst"); interactive_progress($pbar2, 0.14, N("type1inst building")); |