diff options
author | Norbert Preining <preining@logic.at> | 2007-06-16 16:22:16 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-06-16 16:22:16 +0000 |
commit | d4eefe7213116b2b11dbfa09d39b54d6470203ca (patch) | |
tree | d0fa75c399323763c095e1ac6d77ae6766ab88e5 /Master/tlpkg/bin | |
parent | ad7c8ab6419951c6e744c47c4be81bef897a18b3 (diff) |
move new-infra to Master/tlpkg
rename stuff
create list files
tlsrc for all packages (also schemes)
git-svn-id: svn://tug.org/texlive/trunk@4439 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-x | Master/tlpkg/bin/create-tlsrc-from-tpm.pl | 326 | ||||
-rwxr-xr-x | Master/tlpkg/bin/read-tpm-dump-tpl.pl | 314 | ||||
-rw-r--r-- | Master/tlpkg/bin/tldb2list.pl | 101 | ||||
-rw-r--r-- | Master/tlpkg/bin/tlsrc2tldb.pl | 110 | ||||
-rw-r--r-- | Master/tlpkg/bin/update-tldb | 8 |
5 files changed, 859 insertions, 0 deletions
diff --git a/Master/tlpkg/bin/create-tlsrc-from-tpm.pl b/Master/tlpkg/bin/create-tlsrc-from-tpm.pl new file mode 100755 index 00000000000..08d8fb8bc3c --- /dev/null +++ b/Master/tlpkg/bin/create-tlsrc-from-tpm.pl @@ -0,0 +1,326 @@ +#!/usr/bin/env perl +# +# tpm2deb-source.pl +# machinery to create debian packages from TeX Live depot +# (c) 2005, 2006 Norbert Preining +# +# $Id: tpm2deb-source.pl 2691 2007-04-16 09:42:22Z frank $ +# +# configuration is done via the file tpm2deb.cfg +# + +use strict; +no strict 'refs'; +# use warnings; +# no warnings 'uninitialized'; + +my $_tmp; + +my $opt_master; +our $opt_nosrcpkg; +our $opt_noremove; +my $globalreclevel; +my $oldsrcdir; +my $datadump ; + +BEGIN { + my $upstream_modules = "/usr/share/tex-common/"; + unshift (@INC, "./all/debian"); + unshift (@INC, $upstream_modules); +} + +my ($mydir,$mmydir); +($mydir = $0) =~ s,/[^/]*$,,; +if ($mydir eq $0) { $mydir = `pwd` ; chomp($mydir); } +if (!($mydir =~ m,/.*,,)) { $mmydir = `pwd`; chomp($mmydir); $mydir = "$mmydir/$mydir" ; } + + +# $opt_master = "./LocalTPM"; +my $opt_debug = 0; +$opt_nosrcpkg = 0; +$opt_noremove = 0; +$globalreclevel = 1; +$oldsrcdir = "./src"; +$datadump = "tpm.data"; + +use Getopt::Long; +# use Data::Dumper; + +#use Strict; +use File::Basename; +use File::Copy; +use File::Path; +use File::Temp qw/ tempfile tempdir /; +use Storable; +## not needed, atm we are calling eperl binary use Parse::ePerl; +#use XML::DOM; +use Cwd; +#use FileUtils qw(canon_dir cleandir make_link newpath member +# normalize substitute_var_val dirname diff_list remove_list +# rec_rmdir sync_dir walk_dir start_redirection stop_redirection); +#use Tpm; +# +# Configuration for destination of files +# DONT USER DOUBLE QUOTES; THESE VARIABLES HAVE TO GET REEVALUATED +# AFTER $tmpdir IS SET!! +# +my $changelog = ""; +my $changelogversion = ""; +my $changelogextraversion = ""; +my $changelogrevision = ""; +my $changelogdistribution = ""; +my $allowed_dists = "(unstable|UNRELEASED|sarge-backports|etch-backports|stable-security|experimental)"; + + +our $Master; + +$Master = `pwd`; +chomp($Master); +my $TpmGlobalPath = $Master; +my $DataGlobalPath = $Master; + +unshift (@INC, "$Master/../Build/tools"); +File::Basename::fileparse_set_fstype('unix'); + + +use Getopt::Long; +use File::Basename; +use File::Copy; +use File::Path; +use File::Temp qw/ tempfile tempdir /; +use Storable; +use Cwd; +use Tpm; + +our (%TeXLive); +our (%Config,%TpmData); +our %TexmfTreeOfType = ( "TLCore" => "texmf", + "Documentation" => "texmf-doc", + "Package" => "texmf-dist"); +our @TpmCategories = keys %TexmfTreeOfType; +our %TypeOfTexmfTree = reverse %TexmfTreeOfType; + +# pre set $opt_master to ./LocalTPM which contains also the Tools dir +# this is set in the main script, and changed with commandline option. +# should it maybe be deleted here? + +my $opt_onlyscripts; + +sub populate_TpmData_from_dump { + my $datafile = $_[0]; + my $tpmdataref = retrieve($datafile); + %TpmData = %{$tpmdataref}; +} + +sub load_collection_tpm_data { + # local functions + sub trim { + my ($str) = @_; + $str =~ s/^[\n\s]+//; + $str =~ s/[\n\s]+$//; + return $str; + } + sub get_requires { + my ($tpm,$type) = @_; + my %requires = $tpm->getHash("Requires"); + my @keylist = keys %requires; + my @tlcorereqlist = (); + my @packagereqlist = (); + if ($type eq '') { + $type = "all"; + } + foreach my $k (keys %requires) { + foreach my $e (@{$requires{$k}}) { + # manually exclude Windows-only packages + if ($e eq "bin-bzip2") {} + elsif ($e eq "bin-xpdf") {} + elsif ($e eq "bin-chktex") {} + elsif ($e eq "bin-ghostscript") {} + elsif ($e eq "bin-gzip") {} + elsif ($e eq "bin-jpeg2ps") {} + elsif ($e eq "bin-perl") {} + elsif ($e eq "bin-windvi") {} + elsif ($e eq "lib-freetype2") {} + elsif ($e eq "lib-gd") {} + elsif ($e eq "lib-geturl") {} + elsif ($e eq "lib-gnu") {} + elsif ($e eq "lib-gs") {} + elsif ($e eq "lib-jpeg") {} + elsif ($e eq "lib-md5") {} + elsif ($e eq "lib-png") {} + elsif ($e eq "lib-regex") {} + elsif ($e eq "lib-texmfmp") {} + elsif ($e eq "lib-tiff") {} + elsif ($e eq "lib-ttf") {} + elsif ($e eq "lib-xpdf") {} + elsif ($e eq "lib-xpm") {} + elsif ($e eq "lib-zlib") {} + elsif ($e =~ /^bin-(.*)$/) { + push @packagereqlist, "$k/$e"; + } + elsif ($e =~ /^hyphen-(.*)$/){ + push @packagereqlist, "$k/$e"; + } + elsif ($k eq "TLCore") { + push @tlcorereqlist, "$k/$e"; + } else { + push @packagereqlist, "$k/$e"; + } + } + } + if ($type eq '' || $type eq 'all') { + my %foo; + $foo{'TLCore'} = \@tlcorereqlist; + $foo{'Package'} = \@packagereqlist; + #my @foo=(@tlcorereqlist,@packagereqlist); + #return(@foo); + return(\%foo); + } elsif ($type eq 'TLCore') { + return(@tlcorereqlist); + } elsif ($type eq 'Package') { + return(@packagereqlist); + } else { + die("Don't know this type: $type!\n"); + } + } + # start of real function + print "Start loading tpm data ... \n"; + foreach my $t ('TLCore', 'Documentation', 'Package') { + my $subtree = ${TexmfTreeOfType}{$t}; + foreach my $f (<$Master/$subtree/tpm/*.tpm>) { + print "Working on $f\n"; + my $shortn = basename($f); + $shortn =~ s,\.tpm$,,; + if ($shortn !~ m/^scheme-/) { next ; } + my $tpm = Tpm->new("$subtree/tpm/$shortn.tpm"); + $TpmData{$t}{$shortn}{'BinPatterns'} = [ $tpm->getList("BinPatterns") ]; + $TpmData{$t}{$shortn}{'DocPatterns'} = [ $tpm->getList("DocPatterns") ]; + $TpmData{$t}{$shortn}{'RunPatterns'} = [ $tpm->getList("RunPatterns") ]; + $TpmData{$t}{$shortn}{'SourcePatterns'} = [ $tpm->getList("SourcePatterns") ]; + $TpmData{$t}{$shortn}{'BinFiles'} = [ $tpm->getFileList("BinFiles") ]; + $TpmData{$t}{$shortn}{'DocFiles'} = [ $tpm->getFileList("DocFiles") ]; + $TpmData{$t}{$shortn}{'RunFiles'} = [ $tpm->getFileList("RunFiles") ]; + $TpmData{$t}{$shortn}{'SourceFiles'} = [ $tpm->getFileList("SourceFiles") ]; + $TpmData{$t}{$shortn}{'RemoteFiles'} = [ $tpm->getFileList("RemoteFiles") ]; + $TpmData{$t}{$shortn}{'Title'} = trim($tpm->getAttribute("Title")); + # print "got title $TpmData{$t}{$shortn}{'Title'}\n"; + $TpmData{$t}{$shortn}{'Description'} = trim($tpm->getAttribute("Description")); + $TpmData{$t}{$shortn}{'License'} = trim($tpm->getAttribute("License")); + my @foo = $tpm->getList("Installation"); + $TpmData{$t}{$shortn}{'Installation'} = \@foo ; + my $alldeps = get_requires($tpm,'all'); + my @incs = @{$alldeps->{'Package'}}; + my @deps = @{$alldeps->{'TLCore'}}; + $TpmData{$t}{$shortn}{'Package'} = \@incs; + $TpmData{$t}{$shortn}{'TLCore'} = \@deps; + } + } + print " ... done\n"; +} + +sub create_tlsrc_files { + print "Creating tlsrc files TpmData\n\n"; + #foreach my $t ('TLCore', 'Documentation', 'Package') { + foreach my $t ('TLCore', 'Documentation') { + print "Creating tlsrc for $t:\n"; + my %foo = %{$TpmData{$t}}; + foreach my $p (keys %foo) { + open (FOO,">tlsrc/$p.tlsrc") || die("Cannot open tlsrc/$p.tlsrc!"); + print FOO "name $p\n"; + print FOO "category $t\n"; + if ($TpmData{$t}{$p}{'Title'} !~ /^[[:space:]]*$/) { + print FOO "shortdesc $TpmData{$t}{$p}{'Title'}\n"; + } + $_tmp = "$TpmData{$t}{$p}{'Description'}"; + if (defined($_tmp) && ($_tmp !~ /^[[:space:]]*$/)) { + $_tmp = "longdesc $_tmp"; + write FOO; + } + #print FOO "longdesc $TpmData{$t}{$p}{'Description'}\n"; + foreach my $foo (@{$TpmData{$t}{$p}{'Package'}}) { + print FOO "depend $foo\n"; + } + foreach my $foo (@{$TpmData{$t}{$p}{'TLCore'}}) { + print FOO "depend $foo\n"; + } + foreach my $foo (@{$TpmData{$t}{$p}{'SourcePatterns'}}) { + print FOO "SourcePatterns f $foo\n"; + } + foreach my $foo (@{$TpmData{$t}{$p}{'BinPatterns'}}) { + print FOO "binpatterns f $foo\n"; + } + foreach my $foo (@{$TpmData{$t}{$p}{'DocPatterns'}}) { + print FOO "docpatterns f $foo\n"; + } + foreach my $foo (@{$TpmData{$t}{$p}{'RunPatterns'}}) { + next if ($foo =~ /\.tpm$/); + print FOO "runpatterns f $foo\n"; + } + foreach my $ex (@{$TpmData{$t}{$p}{'Installation'}}) { + my %foo = %{$ex}; + print FOO "execute $foo{'function'} $foo{'mode'} $foo{'parameter'}\n"; + } + close(FOO); + } + } + return (0); + foreach my $t ('Package') { + print "Creating tlsrc for $t:\n"; + my %foo = %{$TpmData{$t}}; + foreach my $p (keys %foo) { + open (FOO,">tlsrc/$p.tlsrc") || die("Cannot open tlsrc/$p.tlsrc!"); + print FOO "name $p\n"; + foreach my $foo (@{$TpmData{$t}{$p}{'Package'}}) { + print FOO "depend $foo\n"; + } + foreach my $foo (@{$TpmData{$t}{$p}{'TLCore'}}) { + print FOO "depend $foo\n"; + } + foreach my $ex (@{$TpmData{$t}{$p}{'Installation'}}) { + my %foo = %{$ex}; + print FOO "execute $foo{'function'} $foo{'mode'} $foo{'parameter'}\n"; + } + close(FOO); + } + } +} + + +&main(@ARGV); + +1; + +# variables needed outside of main +my $version; +my $revision; +my $extraversion; +my $date; +my $arch; +my $shortl; + +sub main { + ${Tpm::MasterDir} = $TeXLive{'all'}{'tpm_global_path'}; + $arch = "all"; + ${Tpm::CurrentArch} = "i386-linux"; + ${Tpm::MasterDir} = $Master; + load_collection_tpm_data(); + create_tlsrc_files(); +} + +##################################### +# +# Formats +# +format FOO = +^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +$_tmp + ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +$_tmp +. + +### Local Variables: +### perl-indent-level: 4 +### tab-width: 4 +### indent-tabs-mode: t +### End: +# vim:set tabstop=4: # diff --git a/Master/tlpkg/bin/read-tpm-dump-tpl.pl b/Master/tlpkg/bin/read-tpm-dump-tpl.pl new file mode 100755 index 00000000000..a35072c0da8 --- /dev/null +++ b/Master/tlpkg/bin/read-tpm-dump-tpl.pl @@ -0,0 +1,314 @@ +#!/usr/bin/env perl +# +# tpm2deb-source.pl +# machinery to create debian packages from TeX Live depot +# (c) 2005, 2006 Norbert Preining +# +# $Id: tpm2deb-source.pl 2691 2007-04-16 09:42:22Z frank $ +# +# configuration is done via the file tpm2deb.cfg +# + +use strict; +no strict 'refs'; +# use warnings; +# no warnings 'uninitialized'; + +my $opt_master; +our $opt_debug; +our $opt_nosrcpkg; +our $opt_noremove; +my $globalreclevel; +my $oldsrcdir; +my $datadump ; + +BEGIN { + my $upstream_modules = "/usr/share/tex-common/"; + unshift (@INC, "./all/debian"); + unshift (@INC, $upstream_modules); +} + +my ($mydir,$mmydir); +($mydir = $0) =~ s,/[^/]*$,,; +if ($mydir eq $0) { $mydir = `pwd` ; chomp($mydir); } +if (!($mydir =~ m,/.*,,)) { $mmydir = `pwd`; chomp($mmydir); $mydir = "$mmydir/$mydir" ; } + + +# $opt_master = "./LocalTPM"; +$opt_debug = 0; +$opt_nosrcpkg = 0; +$opt_noremove = 0; +$globalreclevel = 1; +$oldsrcdir = "./src"; +$datadump = "tpm.data"; + +use Getopt::Long; +# use Data::Dumper; + +#use Strict; +use File::Basename; +use File::Copy; +use File::Path; +use File::Temp qw/ tempfile tempdir /; +use Storable; +## not needed, atm we are calling eperl binary use Parse::ePerl; +#use XML::DOM; +use Cwd; +#use FileUtils qw(canon_dir cleandir make_link newpath member +# normalize substitute_var_val dirname diff_list remove_list +# rec_rmdir sync_dir walk_dir start_redirection stop_redirection); +#use Tpm; +# +# Configuration for destination of files +# DONT USER DOUBLE QUOTES; THESE VARIABLES HAVE TO GET REEVALUATED +# AFTER $tmpdir IS SET!! +# +my $changelog = ""; +my $changelogversion = ""; +my $changelogextraversion = ""; +my $changelogrevision = ""; +my $changelogdistribution = ""; +my $allowed_dists = "(unstable|UNRELEASED|sarge-backports|etch-backports|stable-security|experimental)"; + + +our $Master; +our %TpmData; + +$Master = `pwd`; +chomp($Master); +my $TpmGlobalPath = $Master; +my $DataGlobalPath = $Master; + +unshift (@INC, "$Master/../Build/tools"); +File::Basename::fileparse_set_fstype('unix'); + + +use Getopt::Long; +use File::Basename; +use File::Copy; +use File::Path; +use File::Temp qw/ tempfile tempdir /; +use Storable; +use Cwd; +use Tpm; + +our (%TeXLive); +our (%Config,%TpmData); +our %TexmfTreeOfType = ( "TLCore" => "texmf", + "Documentation" => "texmf-doc", + "Package" => "texmf-dist"); +our @TpmCategories = keys %TexmfTreeOfType; +our %TypeOfTexmfTree = reverse %TexmfTreeOfType; + +# pre set $opt_master to ./LocalTPM which contains also the Tools dir +# this is set in the main script, and changed with commandline option. +# should it maybe be deleted here? + +my $opt_debug; +my $opt_onlyscripts; + +sub populate_TpmData_from_dump { + my $datafile = $_[0]; + my $tpmdataref = retrieve($datafile); + %TpmData = %{$tpmdataref}; +} + +sub load_collection_tpm_data { + # local functions + sub trim { + my ($str) = @_; + $str =~ s/^[\n\s]+//; + $str =~ s/[\n\s]+$//; + return $str; + } + sub get_requires { + my ($tpm,$type) = @_; + my %requires = $tpm->getHash("Requires"); + my @keylist = keys %requires; + my @tlcorereqlist = (); + my @packagereqlist = (); + if ($type eq '') { + $type = "all"; + } + foreach my $k (keys %requires) { + foreach my $e (@{$requires{$k}}) { + # manually exclude Windows-only packages + if ($e eq "bin-bzip2") {} + elsif ($e eq "bin-xpdf") {} + elsif ($e eq "bin-chktex") {} + elsif ($e eq "bin-ghostscript") {} + elsif ($e eq "bin-gzip") {} + elsif ($e eq "bin-jpeg2ps") {} + elsif ($e eq "bin-perl") {} + elsif ($e eq "bin-windvi") {} + elsif ($e eq "lib-freetype2") {} + elsif ($e eq "lib-gd") {} + elsif ($e eq "lib-geturl") {} + elsif ($e eq "lib-gnu") {} + elsif ($e eq "lib-gs") {} + elsif ($e eq "lib-jpeg") {} + elsif ($e eq "lib-md5") {} + elsif ($e eq "lib-png") {} + elsif ($e eq "lib-regex") {} + elsif ($e eq "lib-texmfmp") {} + elsif ($e eq "lib-tiff") {} + elsif ($e eq "lib-ttf") {} + elsif ($e eq "lib-xpdf") {} + elsif ($e eq "lib-xpm") {} + elsif ($e eq "lib-zlib") {} + elsif ($e =~ /^bin-(.*)$/) { + push @packagereqlist, "$k/$e"; + } + elsif ($e =~ /^hyphen-(.*)$/){ + push @packagereqlist, "$k/$e"; + } + elsif ($k eq "TLCore") { + push @tlcorereqlist, "$k/$e"; + } else { + push @packagereqlist, "$k/$e"; + } + } + } + if ($type eq '' || $type eq 'all') { + my %foo; + $foo{'TLCore'} = \@tlcorereqlist; + $foo{'Package'} = \@packagereqlist; + #my @foo=(@tlcorereqlist,@packagereqlist); + #return(@foo); + return(\%foo); + } elsif ($type eq 'TLCore') { + return(@tlcorereqlist); + } elsif ($type eq 'Package') { + return(@packagereqlist); + } else { + die("Don't know this type: $type!\n"); + } + } + # start of real function + print "Start loading tpm data ... \n"; + foreach my $t ('TLCore', 'Documentation', 'Package') { + my $subtree = ${TexmfTreeOfType}{$t}; + foreach my $f (<$Master/$subtree/tpm/*.tpm>) { + print "Working on $f\n"; + my $shortn = basename($f); + $shortn =~ s,\.tpm$,,; + if (($t eq 'TLCore') && ($shortn =~ m/^scheme-/)) { next ; } + my $tpm = Tpm->new("$subtree/tpm/$shortn.tpm"); + foreach my $a (@Tpm::ArchList) { + ${Tpm::CurrentArch} = $a; + $TpmData{$t}{$shortn}{'BinFiles'}{$a} = [ $tpm->getFileList("BinFiles") ]; + } + #$TpmData{$t}{$shortn}{'BinFiles'} = [ $tpm->getFileList("BinFiles") ]; + $TpmData{$t}{$shortn}{'DocFiles'} = [ $tpm->getFileList("DocFiles") ]; + $TpmData{$t}{$shortn}{'RunFiles'} = [ $tpm->getFileList("RunFiles") ]; + $TpmData{$t}{$shortn}{'SourceFiles'} = [ $tpm->getFileList("SourceFiles") ]; + $TpmData{$t}{$shortn}{'RemoteFiles'} = [ $tpm->getFileList("RemoteFiles") ]; + $TpmData{$t}{$shortn}{'Title'} = trim($tpm->getAttribute("Title")); + # print "got title $TpmData{$t}{$shortn}{'Title'}\n"; + $TpmData{$t}{$shortn}{'Description'} = trim($tpm->getAttribute("Description")); + $TpmData{$t}{$shortn}{'License'} = trim($tpm->getAttribute("License")); + my @foo = $tpm->getList("Installation"); + $TpmData{$t}{$shortn}{'Installation'} = \@foo ; + my $alldeps = get_requires($tpm,'all'); + my @incs = @{$alldeps->{'Package'}}; + my @deps = @{$alldeps->{'TLCore'}}; + $TpmData{$t}{$shortn}{'Package'} = \@incs; + $TpmData{$t}{$shortn}{'TLCore'} = \@deps; + } + } + print " ... done\n"; +} + +sub dump_tpm_data { + print "Dumping TpmData\n\n"; + foreach my $t ('TLCore', 'Documentation', 'Package') { + #foreach my $t ('Package') { + print "Dumping $t:\n"; + my %foo = %{$TpmData{$t}}; + foreach my $p (keys %foo) { + open (FOO,">tlptpm/$p.tlp") || die("Cannot open tlptpm/$p.tpmtlp!"); + print FOO "name $p\n"; + print FOO "category $t\n"; + foreach my $foo (@{$TpmData{$t}{$p}{'Package'}}) { + print FOO "depend $foo\n"; + } + foreach my $foo (@{$TpmData{$t}{$p}{'TLCore'}}) { + print FOO "depend $foo\n"; + } + foreach my $ex (@{$TpmData{$t}{$p}{'Installation'}}) { + my %foo = %{$ex}; + print FOO "execute $foo{'function'} $foo{'mode'} $foo{'parameter'}\n"; + } + my @foo; + @foo = @{$TpmData{$t}{$p}{'DocFiles'}}; + if ($#foo >= 0) { + print FOO "docfiles\n"; + foreach my $foo (sort @foo) { + print FOO " $foo\n"; + } + } + @foo = @{$TpmData{$t}{$p}{'SourceFiles'}}; + if ($#foo >= 0) { + print FOO "srcfiles\n"; + foreach my $foo (sort @foo) { + print FOO " $foo\n"; + } + } + @foo = @{$TpmData{$t}{$p}{'RunFiles'}}; + if ($#foo >= 1) { + print FOO "runfiles\n"; + foreach my $foo (sort @foo) { + next if ($foo =~ /\.tpm$/); + print FOO " $foo\n"; + } + } + @foo = @{$TpmData{$t}{$p}{'RemoteFiles'}}; + if ($#foo >= 0) { + print FOO "remotefiles\n"; + foreach my $foo (sort @foo) { + print FOO " $foo\n"; + } + } + foreach my $a (sort @Tpm::ArchList) { + @foo = @{$TpmData{$t}{$p}{'BinFiles'}{$a}}; + if ($#foo >= 0) { + print FOO "binfiles arch=$a\n"; + foreach my $foo (sort @foo) { + print FOO " $foo\n"; + } + } + } + close(FOO); + } + } +} + + +&main(@ARGV); + +1; + +# variables needed outside of main +my $version; +my $revision; +my $extraversion; +my $date; +my $arch; +my $shortl; + +sub main { + ${Tpm::MasterDir} = $TeXLive{'all'}{'tpm_global_path'}; + $arch = "all"; + ${Tpm::CurrentArch} = "i386-linux"; + ${Tpm::MasterDir} = $Master; + load_collection_tpm_data(); + dump_tpm_data(); +} + + +### Local Variables: +### perl-indent-level: 4 +### tab-width: 4 +### indent-tabs-mode: t +### End: +# vim:set tabstop=4: # diff --git a/Master/tlpkg/bin/tldb2list.pl b/Master/tlpkg/bin/tldb2list.pl new file mode 100644 index 00000000000..e23a8a0d097 --- /dev/null +++ b/Master/tlpkg/bin/tldb2list.pl @@ -0,0 +1,101 @@ +#!/usr/bin/env perl -w +# +# tldb2list.pl +# create list file from tldb +# Copyright 2007 Norbert Preining +# +# This file is licensed under the GNU General Public Licence version 2 +# or any later version +# + +BEGIN { + ($mydir = $0) =~ s,/[^/]*$,,; + unshift (@INC, "$mydir/.."); +} + +use strict; + +use TeXLive::TLPOBJ; +use TeXLive::TLPDB; +use Getopt::Long; +use Pod::Usage; +use File::Path; + + +my $opt_outputdir = "new-list"; +our $opt_debug = 0; +my $man = 0; +my $help = 0; + +GetOptions("debug!", # debug mode + "outputdir=s" => \$opt_outputdir, + 'help|?' => \$help, man => \$man + ) or pod2usage(2); + +pod2usage(1) if $help; +pod2usage(-exitstatus => 0, -verbose => 2) if $man; +pod2usage(1) if ($#ARGV<0); + +if (! -d "$opt_outputdir") { + mkpath("$opt_outputdir") or die "Cannot mkdir $opt_outputdir!"; +} + + +die "Cannot read tldb file $ARGV[0]." if (! -r "$ARGV[0]"); + +my $tldb = new TeXLive::TLPDB ( location => "$ARGV[0]" ); + +$tldb->generate_listfiles($opt_outputdir); + +__END__ + +=head1 NAME + +tldb2list - Generates list files from a TeX Live Database + +=head1 SYNOPSIS + +tldb2list [options] texlive.tldb + + Options: + -help brief help message + -man full documentation + -outputdir=s specify the directory where list files are created + -debug get debug messages from TL* modules + +=head1 OPTIONS + +=over 8 + +=item B<-help> + +Print a brief help message and exits. + +=item B<-man> + +Prints the manual page and exits. + +=item B<-outputdir> + +Specifies the location where list files are created. Defaults to ./new-list + +=item B<-debug> + +Give debug messages from the TeX Live modules + +=back + +=head1 DESCRIPTION + +B<tldb2list> generates list files necessary for the installer from the +TeX Live Database. + +=head1 AUTHORS AND COPYRIGHT + +This script and its documentation was written by +Norbert Preining <F<preining@logic.at>> for the TeX Live distribution and both +are licensed under the GNU General Public License Version 2 or later. + +=cut + + diff --git a/Master/tlpkg/bin/tlsrc2tldb.pl b/Master/tlpkg/bin/tlsrc2tldb.pl new file mode 100644 index 00000000000..197c1bfbb09 --- /dev/null +++ b/Master/tlpkg/bin/tlsrc2tldb.pl @@ -0,0 +1,110 @@ +#!/usr/bin/env perl -w +# +# tlsrc2tldb.pl +# convert a set of tlsrc files (given as arguments) into tldb +# Copyright 2007 Norbert Preining +# +# This file is licensed under the GNU General Public Licence version 2 +# or any later version +# + +BEGIN { + ($mydir = $0) =~ s,/[^/]*$,,; + unshift (@INC, "$mydir/.."); +} + +use strict; + +use TeXLive::TLPSRC; +use TeXLive::TLPOBJ; +use TeXLive::TLPDB; +use TeXLive::TLTREE; +use Getopt::Long; +use Pod::Usage; +use File::Path; + + +my $opt_master = "/src/TeX/texlive-svn/Master"; +our $opt_debug = 0; +my $man = 0; +my $help = 0; + +GetOptions("debug!", # debug mode + "master=s" => \$opt_master, # location of the tree + 'help|?' => \$help, man => \$man + ) or pod2usage(2); + +pod2usage(1) if $help; +pod2usage(-exitstatus => 0, -verbose => 2) if $man; + +if (! -d "$opt_master") { + die "Master $opt_master does not exists!"; +} + +my $tltree = TeXLive::TLTREE->new( 'svnroot' => "$opt_master" ); +$tltree->init_from_svn; + +my $tldb = TeXLive::TLPDB->new; + +foreach my $f (@ARGV) { + my $tlsrc = new TeXLive::TLPSRC; + $tlsrc->from_file($f); + my $tlp = $tlsrc->make_tlpobj($tltree); + $tldb->add_tlpobj($tlp); +} + +$tldb->writeout; + +__END__ + +=head1 NAME + +tlsrc2tldb - Converting tlsrc files into tldb file + +=head1 SYNOPSIS + +tlsrc2tldb [options] [tlsrcfiles ...] + + Options: + -help brief help message + -man full documentation + -master=s set Master of TeX Live tree + -debug get debug messages from TL* modules + +=head1 OPTIONS + +=over 8 + +=item B<-help> + +Print a brief help message and exits. + +=item B<-man> + +Prints the manual page and exits. + +=item B<-master> + +The location given by B<-master> must point to a valid svn repository +of TeX Live Master direcory. Defaults to /src/TeX/texlive-svn/Master + +=item B<-debug> + +Give debug messages from the TeX Live modules + +=back + +=head1 DESCRIPTION + +B<tlsrc2tldb> converts TeX Live Source (tlsrc) files into TeX Live Database +(tldb). + +=head1 AUTHORS AND COPYRIGHT + +This script and its documentation was written by +Norbert Preining <F<preining@logic.at>> for the TeX Live distribution and both +are licensed under the GNU General Public License Version 2 or later. + +=cut + + diff --git a/Master/tlpkg/bin/update-tldb b/Master/tlpkg/bin/update-tldb new file mode 100644 index 00000000000..13bf29021a2 --- /dev/null +++ b/Master/tlpkg/bin/update-tldb @@ -0,0 +1,8 @@ +#!/bin/sh +# Norbert Preining +# these scripts are in Master/tlpkg/bin +cd $(dirname $0)/../.. +perl tlpkg/bin/tlsrc2tldb.pl tlpkg/tlsrc/*.tlsrc > texlive.tldb.new +mv texlive.tldb texlive.tldb.saved +mv texlive.tldb.new texlive.tldb + |