Commits

Xu Xiaodong  committed e9ca348

add fix_java_font.pl

  • Participants
  • Parent commits 374f62e

Comments (0)

Files changed (5)

File README.markdown

 + update\_kernel.pl: update Gentoo kernel
 + update\_perl.pl: update Perl packages
 + update\_system.pl: update Gentoo
++ fix\_java\_font.pl: fix java chinese problem

File fix_java_font.pl

+#!/usr/bin/env perl
+#
+# name:      fix_java_font.pl, fix java chinese problem
+# author:    Xu Xiaodong <xxdlhy@gmail.com>
+# license:   GPL
+# created:   2011 Apr 27
+# modified:  2011 Apr 27
+#
+
+use Modern::Perl;
+
+my ($jre_ver)
+    = qx(eix -I --format '<installedversions:NAMEVERSION>' sun-jre-bin)
+    =~ m!/(.*)\Z!;
+my $jre_path = "/opt/$jre_ver/lib/fonts/";
+
+chdir $jre_path;
+mkdir 'fallback';
+chdir 'fallback';
+symlink '/usr/share/fonts/ttf-droid/DroidSansFallback.ttf',
+    'DroidSansFallback.ttf';
+system 'mkfontdir';
+system 'mkfontscale';

File not_dep_pkg.pl

 #!/usr/bin/env perl
 #
-# name:      get orphan packages in Gentoo
+# name:      not_dep_pkg.pl, get orphan packages in gentoo
 # author:    Xu Xiaodong <xxdlhy@gmail.com>
 # license:   GPL
 # created:   2011 Apr 10
-# modified:  2011 Apr 13
+# modified:  2011 Apr 27
 #
 
 use Modern::Perl;
     my @pkgs;
 
     local $/ = "\n\n";
-    open my $in_fh, "emerge -av --depclean |";
+    open my $in_fh, '-|', 'emerge', '-av', '--depclean';
     while (<$in_fh>) {
         push @pkgs, $1 if m!/(.*?)-\d.*\s.*\s+\@selected\n\n!;
     }
     my ($pkg_ref) = @_;
     my %info;
 
-    for (@$pkg_ref) {
-        $info{$_} = $1 if `eix -csI $_` =~ /: (.*)\n/;
+    for my $pkg (@$pkg_ref) {
+        $info{$pkg} = $1 if qx(eix -csI $pkg) =~ /: (.*)\n/;
     }
 
     return %info;

File update_perl.pl

 # author:    Xu Xiaodong <xxdlhy@gmail.com>
 # license:   GPL
 # created:   2011 Feb  7
-# modified:  2011 Apr 13
+# modified:  2011 Apr 27
 #
 
 use Modern::Perl;

File update_system.pl

 # author:    Xu Xiaodong <xxdlhy@gmail.com>
 # license:   GPL
 # created:   2011 Apr  3
-# modified:  2011 Apr 19
+# modified:  2011 Apr 27
 #
 
 use Modern::Perl;
 my $update = 'eix-sync';
 my @cmds   = (
     'emerge -avuND world',
-    'etc-update',
+    'dispatch-conf',
+    'emerge -av --depclean',
     'revdep-rebuild -i',
     'localepurge',
-    'emerge -av --depclean',
     'eclean -d distfiles',
 );
 
-my $reval = $no_sync ? 0 : system $update;
+my $reval = $no_sync ? 0 : run_cmd($update);
 
 unless ($reval) {
     for my $cmd (@cmds) {