diff options
author | Jory Pratt <anarchy@gentoo.org> | 2010-02-18 00:09:52 +0000 |
---|---|---|
committer | Jory Pratt <anarchy@gentoo.org> | 2010-02-18 00:09:52 +0000 |
commit | ed7a8d050109374524b91424de96203a97b9dc66 (patch) | |
tree | 2ce5f0ec2d8e7eed9bd7d766695cd1f6c4ffc76b | |
parent | [x11-libs/qt-phonon] added exceptions USE flag description (diff) | |
download | gentoo-2-ed7a8d050109374524b91424de96203a97b9dc66.tar.gz gentoo-2-ed7a8d050109374524b91424de96203a97b9dc66.tar.bz2 gentoo-2-ed7a8d050109374524b91424de96203a97b9dc66.zip |
Readd seamonkey-rebuild-databases.pl bug #302694
(Portage version: 2.1.7.17/cvs/Linux x86_64)
-rw-r--r-- | www-client/seamonkey/ChangeLog | 5 | ||||
-rw-r--r-- | www-client/seamonkey/files/seamonkey-rebuild-databases.pl | 99 |
2 files changed, 103 insertions, 1 deletions
diff --git a/www-client/seamonkey/ChangeLog b/www-client/seamonkey/ChangeLog index 9070f4185969..0c9c5c6f1907 100644 --- a/www-client/seamonkey/ChangeLog +++ b/www-client/seamonkey/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for www-client/seamonkey # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/ChangeLog,v 1.210 2010/01/15 01:18:57 anarchy Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-client/seamonkey/ChangeLog,v 1.211 2010/02/18 00:09:51 anarchy Exp $ + + 18 Feb 2010; <anarchy@gentoo.org> +files/seamonkey-rebuild-databases.pl: + Readd seamonkey-rebuild-databases.pl bug #302694 *seamonkey-2.0.2 (15 Jan 2010) diff --git a/www-client/seamonkey/files/seamonkey-rebuild-databases.pl b/www-client/seamonkey/files/seamonkey-rebuild-databases.pl new file mode 100644 index 000000000000..2556041dae11 --- /dev/null +++ b/www-client/seamonkey/files/seamonkey-rebuild-databases.pl @@ -0,0 +1,99 @@ +#!/usr/bin/perl + +use File::Path; +use File::Copy; +use File::Glob ":glob"; +use POSIX ":sys_wait_h"; + +$timeout = 60; + +%{ENV}->{"MOZILLA_FIVE_HOME"}="/usr/lib/seamonkey"; +%{ENV}->{"LD_LIBRARY_PATH"}="/usr/lib/seamonkey"; + +umask 022; + +if ( -f "/usr/lib/seamonkey/regxpcom" ) +{ + # remove all of the old files + rmtree("/usr/lib/seamonkey/chrome/overlayinfo"); + unlink </usr/lib/seamonkey/chrome/*.rdf>; + unlink("/usr/lib/seamonkey/component.reg"); + unlink("/usr/lib/seamonkey/components/compreg.dat"); + unlink("/usr/lib/seamonkey/components/xpti.dat"); + + # create a new clean path + mkpath("/usr/lib/seamonkey/chrome/overlayinfo"); + + # rebuild the installed-chrome.txt file from the installed + # languages + if ( -f "/usr/lib/seamonkey/chrome/lang/installed-chrome.txt" ) { + rebuild_lang_files(); + } + + # run regxpcom + $pid = fork(); + + # I am the child. + if ($pid == 0) { + exec("/usr/lib/seamonkey/regxpcom > /dev/null 2> /dev/null"); + } + # I am the parent. + else { + my $timepassed = 0; + do { + $kid = waitpid($pid, &WNOHANG); + sleep(1); + $timepassed++; + } until $kid == -1 || $timepassed > $timeout; + + # should we kill? + if ($timepassed > $timeout) { + kill (9, $pid); + # kill -9 can leave threads hanging around + system("/usr/bin/killall -9 regxpcom"); + } + } + + # and run regchrome for good measure + $pid = fork(); + + # I am the child. + if ($pid == 0) { + exec("/usr/lib/seamonkey/regchrome > /dev/null 2> /dev/null"); + } + # I am the parent. + else { + my $timepassed = 0; + do { + $kid = waitpid($pid, &WNOHANG); + sleep(1); + $timepassed++; + } until $kid == -1 || $timepassed > $timeout; + + # should we kill? + if ($timepassed > $timeout) { + kill (9, $pid); + # kill -9 can leave threads hanging around + system("/usr/bin/killall -9 regchrome"); + } + } + +} + + +sub rebuild_lang_files { + unlink("/usr/lib/seamonkey/chrome/installed-chrome.txt"); + + open (OUTPUT, "+>", "/usr/lib/seamonkey/chrome/installed-chrome.txt")|| + die("Failed to open installed-chrome.txt: $!\n"); + + copy("/usr/lib/seamonkey/chrome/lang/installed-chrome.txt", + \*OUTPUT); + + foreach (bsd_glob("/usr/lib/seamonkey/chrome/lang/lang-*.txt")) { + copy($_, \*OUTPUT); + } + + copy("/usr/lib/seamonkey/chrome/lang/default.txt", + \*OUTPUT); +} |