[tex-common] 09/10: fixes for building and installing
This is an automated email from the git hooks/post-receive script.
preining pushed a commit to branch full-trigger
in repository tex-common.
commit 207f08828d125743621268486f36ca6447a64e08
Author: Norbert Preining <preining@debian.org>
Date: Tue Jun 2 13:38:35 2015 +0900
fixes for building and installing
---
scripts/postrm-tex | 7 ++--
scripts/update-language | 86 +++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 85 insertions(+), 8 deletions(-)
diff --git a/scripts/postrm-tex b/scripts/postrm-tex
index 3e47157..67b5707 100644
--- a/scripts/postrm-tex
+++ b/scripts/postrm-tex
@@ -18,8 +18,11 @@ case "$1" in
for fmt in #FORMATS# ; do
rm -f /var/lib/texmf/web2c/$fmt.*
# try to remove empty directories of format dumps
- if [ `dirname $fmt` != "." ] ; then
- rmdir --ignore-fail-on-non-empty `dirname $fmt`
+ dn=`dirname $fmt`
+ if [ $dn != "." ] ; then
+ if [ -d /var/lib/texmf/web2c/$dn ] ; then
+ rmdir --ignore-fail-on-non-empty /var/lib/texmf/web2c/$dn
+ fi
fi
done
;;
diff --git a/scripts/update-language b/scripts/update-language
index b6ff5ea..5988cd4 100755
--- a/scripts/update-language
+++ b/scripts/update-language
@@ -22,11 +22,6 @@ use strict;
my $version = "0.1";
-BEGIN {
- unshift (@INC, "/usr/share/texlive/tlpkg");
-}
-
-use TeXLive::TLUtils;
use File::Basename;
use Getopt::Long;
@@ -104,6 +99,12 @@ sub main {
exit 0;
}
+ # if texlive-base is not properly installed, we do nothing
+ my $stat = `dpkg-query -W -f=\'\${Status}\' texlive-base 2>/dev/null`;
+ if ($stat ne "install ok installed") {
+ printf "$progname: texlive-base not installed and configured, doing nothing!\n";
+ exit 0;
+ }
update_conffiles($mode);
}
@@ -193,6 +194,79 @@ EOF
return $ret;
}
+sub parse_hyphen_line {
+ my $line = shift;
+ my %ret;
+ my $default_lefthyphenmin = 2;
+ my $default_righthyphenmin = 3;
+ $ret{"lefthyphenmin"} = $default_lefthyphenmin;
+ $ret{"righthyphenmin"} = $default_righthyphenmin;
+ $ret{"synonyms"} = [];
+ for my $p (split($line)) {
+ my ($a, $b) = split /=/, $p;
+ if ($a eq "name") {
+ if (!$b) {
+ $ret{"error"} = "AddHyphen line needs name=something";
+ return %ret;
+ }
+ $ret{"name"} = $b;
+ next;
+ }
+ if ($a eq "lefthyphenmin") {
+ $ret{"lefthyphenmin"} = ( $b ? $b : $default_lefthyphenmin );
+ next;
+ }
+ if ($a eq "righthyphenmin") {
+ $ret{"righthyphenmin"} = ( $b ? $b : $default_righthyphenmin );
+ next;
+ }
+ if ($a eq "file") {
+ if (!$b) {
+ $ret{"error"} = "AddHyphen line needs file=something";
+ return %ret;
+ }
+ $ret{"file"} = $b;
+ next;
+ }
+ if ($a eq "file_patterns") {
+ $ret{"file_patterns"} = $b;
+ next;
+ }
+ if ($a eq "file_exceptions") {
+ $ret{"file_exceptions"} = $b;
+ next;
+ }
+ if ($a eq "luaspecial") {
+ $ret{"luaspecial"} = $b;
+ next;
+ }
+ if ($a eq "databases") {
+ @{$ret{"databases"}} = split /,/, $b;
+ next;
+ }
+ if ($a eq "synonyms") {
+ @{$ret{"synonyms"}} = split /,/, $b;
+ next;
+ }
+ if ($a eq "comment") {
+ $ret{"comment"} = $b;
+ next;
+ }
+ # should not be reached at all
+ $ret{"error"} = "Unknown language directive $a";
+ return %ret;
+ }
+ # this default value couldn't be set earlier
+ if (not defined($ret{"databases"})) {
+ if (defined $ret{"file_patterns"} or defined $ret{"file_exceptions"}
+ or defined $ret{"luaspecial"}) {
+ @{$ret{"databases"}} = qw(dat def lua);
+ } else {
+ @{$ret{"databases"}} = qw(dat def);
+ }
+ }
+ return %ret;
+}
sub read_one_file {
my $f = shift;
@@ -201,7 +275,7 @@ sub read_one_file {
while (<FOO>) {
next if /^\s*%/;
next if /^\s*$/;
- my %r = TeXLive::TLUtils::parse_AddHyphen_line($_);
+ my %r = parse_hyphen_line($_);
if (defined($r{"error"})) {
die ("Cannot parse $_ in $f: $r{'error'}");
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-tex/tex-common.git
Reply to: