diff options
author | Norbert Preining <preining@logic.at> | 2007-12-03 15:11:01 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-12-03 15:11:01 +0000 |
commit | 8769358c65a1821de408076b69cf94f3ce2073a4 (patch) | |
tree | a827b5dda42bd3712f55c7adf38d978d25c30322 | |
parent | 9edb5feefe19dfb1ba540bbcca521a1904136609 (diff) |
BIG change: no TLPDB->location anymore, but TLPDB->root
git-svn-id: svn://tug.org/texlive/trunk@5697 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/install-tl.pl | 15 | ||||
-rw-r--r-- | Master/tlpkg/TODO | 27 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLConfig.pm | 2 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 81 | ||||
-rwxr-xr-x | Master/tlpkg/bin/create-package-list | 7 | ||||
-rwxr-xr-x | Master/tlpkg/bin/place | 7 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpdb2container | 11 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpdb2list | 7 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpdb2updmap | 5 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpfiles | 4 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 5 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlprm | 5 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpsrc2tlpdb | 12 |
13 files changed, 80 insertions, 108 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl index 35eb18cf89a..a6643eb7358 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -369,14 +369,14 @@ sub calc_depends { } sub load_tlpdb { - my $database; + my $master; if (media eq 'NET') { - $database="$::texlive_url/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb"; + $master="$::texlive_url"; } else { - $database="$::installerdir/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb"; + $master="$::installerdir"; } - print "Loading $database ...\n"; - $tlpdb=TeXLive::TLPDB->new(location => "$database"); + print "Loading $master ...\n"; + $tlpdb=TeXLive::TLPDB->new(root => "$master"); } sub initialize_collections { @@ -482,15 +482,10 @@ sub read_profile { } sub prepare_installation { - my $infralocation="$TeXLive::TLConfig::InfraLocation"; - my $localtlpdbfile="$vars{'TEXDIR'}/$infralocation/texlive.tlpdb"; - - mkdirhier "$vars{'TEXDIR'}/$infralocation"; make_var_skeleton "$vars{'TEXMFSYSVAR'}"; make_local_skeleton "$vars{'TEXMFLOCAL'}"; $localtlpdb=new TeXLive::TLPDB; - $localtlpdb->location("$localtlpdbfile"); $localtlpdb->root("$vars{'TEXDIR'}"); } diff --git a/Master/tlpkg/TODO b/Master/tlpkg/TODO index ab27ef6df5e..e609df6fdf4 100644 --- a/Master/tlpkg/TODO +++ b/Master/tlpkg/TODO @@ -4,18 +4,25 @@ TODO for TeX Live installer --------- -- write TLPDB->make_fmtutil_cnf_lines and TLPDB->make_updmap_cfg_lines - returning arrays of lines. +- more intelligent support of + texmf-local/web2c/fmtutil-local.cnf + texmf-local/web2c/updmap-local.cfg + texmf-local/tex/generic/config/language-local.dat + currently these files are simply added at the end of the respective + config files at installation time, but not in any way checked for + duplication etc. -- using the above functions the installer should do the following at the - end of the installation and after an upgrade session: - . call the above two functions - . check on the existence of texmf-local/web2c/fmtutil-local.cnf and - texmf-local/web2c/updmap-local.cfg and merge these files with the - above lines - . write out the final config files to texmf-var and call the respective - update programs +- Change the headers of the three "header" files + texmf/web2c/fmtutil-hdr.cnf + texmf/web2c/updmap-hdr.cfg + texmf/tex/generic/config/language.us + stating that the file is generated and the user should add stuff + to the above config files ... +- implement a managing program that does the same as the installer, i.e. + updates the 3 config files from the installed stuff plus the -local + files, and calls the respective programs + infra structure --------------- diff --git a/Master/tlpkg/TeXLive/TLConfig.pm b/Master/tlpkg/TeXLive/TLConfig.pm index 9afb4fa8199..f0819d34a41 100644 --- a/Master/tlpkg/TeXLive/TLConfig.pm +++ b/Master/tlpkg/TeXLive/TLConfig.pm @@ -18,6 +18,7 @@ BEGIN { $CategoriesRegexp $DefaultCategory $InfraLocation + $DatabaseName $BlockSize ); } @@ -38,6 +39,7 @@ our $DefaultCategory = "Package"; # location of various infra files (texlive.tlpdb, .tlpobj etc) # relative to a root (e.g., the Master/, or the installation path) our $InfraLocation = "tlpkg"; +our $DatabaseName = "texlive.tlpdb"; our $BlockSize = 4096; diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index e79d9df2fa3..1525e99334c 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -18,9 +18,8 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages use TeXLive::TLPDB; TeXLive::TLPDB->new (); - TeXLive::TLPDB->new (location => "/path/to/texlive.tlpdb"); + TeXLive::TLPDB->new (root => "/path/to/texlive/installation/root"); - $tlpdb->location("/path/to/texlive.tlpdb"); $tlpdb->root("/path/to/root/of/texlive/installation"); $tlpdb->from_file($filename); $tlpdb->writeout; @@ -43,8 +42,9 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages =cut -use TeXLive::TLConfig qw($CategoriesRegexp $DefaultCategory); -use TeXLive::TLUtils qw(basename); +use TeXLive::TLConfig qw($CategoriesRegexp $DefaultCategory $InfraLocation + $DatabaseName); +use TeXLive::TLUtils qw(dirname); use TeXLive::TLPOBJ; my $_listdir; @@ -55,12 +55,12 @@ my $_listdir; =item C<< TeXLive::TLPDB->new >> -=item C<< TeXLive::TLPDB->new(location => "$filename") >> +=item C<< TeXLive::TLPDB->new( [root => "$path"] ) >> C<< TeXLive::TLPDB->new >> creates a new C<TLPDB> object. If the -argument C<location> is given it will be initialized from this -location. C<$filename> is usually C</path/to/texlive.tlpdb>. If -C<$filename> begins with C<http://> or C<ftp://>, the program C<wget> +argument C<root> is given it will be initialized from the respective +location within $path. If +C<$path> begins with C<http://> or C<ftp://>, the program C<wget> is used to download the file. =cut @@ -69,26 +69,13 @@ sub new { my $class = shift; my %params = @_; my $self = { - location => $params{'location'}, root => $params{'root'}, tlps => $params{'tlps'} }; $_listdir = $params{'listdir'} if defined($params{'listdir'}); bless $self, $class; - if (defined($self->{'location'}) && defined($self->{'root'})) { - my $chk = basename(basename($self->{'root'})); - if ($self->{'root'} ne $chk) { - warn "root $self->{'root'} and location $self->{'location'} does not really fit, are you sure?!\n"; - } - } - if (defined($self->{'location'})) { - if (not(defined($self->{'root'}))) { - $self->{'root'} = basename(basename($self->{'location'})); - } - $self->from_file($self->{'location'}); - } - if (defined($self->{'root'}) && not(defined($self->{'location'}))) { - $self->{'location'} = $self->{'root'} . "/" . $TeXLive::TLConfig::InfraLocation . "/texlive.tlpdb"; + if (defined($self->{'root'})) { + $self->from_file("$self->{'root'}/$InfraLocation/$DatabaseName"); } return $self; } @@ -118,26 +105,29 @@ the file. =cut sub from_file { - my $self = shift; - if (@_ != 1) { + my ($self, $path) = @_; + if (@_ != 2) { die("Need a filename for initialization!"); } - if (defined($self->{'location'})) { - if ($self->location ne $_[0]) { + my $root_from_path = dirname(dirname($path)); + if (defined($self->{'root'})) { + if ($self->{'root'} ne $root_from_path) { + printf STDERR "root=$self->{'root'}, root_from_path=$root_from_path\n"; printf STDERR "Initialisation from different location as originally given.\nHope you are sure!\n"; } + } else { + $self->root($root_from_path); } - $self->location($_[0]); - if ($_[0]=~/^(http|ftp):\/\//) { - open(TMP, "wget -nv --output-document=- $_[0]|") - || die("Cannot open tlpdb file: $_[0]"); + if ($path =~ /^(http|ftp):\/\//) { + open(TMP, "wget -nv --output-document=- $path|") + || die("Cannot open tlpdb file: $path"); } else { - open(TMP,"<$_[0]") || die("Cannot open tlpdb file: $_[0]"); + open(TMP,"<$path") || die("Cannot open tlpdb file: $path"); } my $found = 0; do { my $tlp = TeXLive::TLPOBJ->new; - &TeXLive::TLUtils::debug("creating tlp from $_[0]..."); + &TeXLive::TLUtils::debug("creating tlp from $path..."); $found = $tlp->from_fh(\*TMP,1); if ($found) { $self->add_tlpobj($tlp); @@ -178,7 +168,8 @@ as location. If the location is undefined, die. sub save { my $self = shift; - open(FOO,">$self->{'location'}") || die("Cannot open $self->{'location'} for writing: $!"); + my $path = "$self->{'root'}/$InfraLocation/$DatabaseName"; + open(FOO,">$path") || die("Cannot open $path for writing: $!"); $self->writeout(\*FOO); close(FOO); } @@ -245,10 +236,7 @@ sub _add_tlpcontainer { # WARNING: If you change the location of the texlive.tlpdb this # has to be changed, too!! if (not(defined($dest))) { - my $cwd = getcwd(); - chdir($self->location . "/.."); - $dest = getcwd(); - chdir($cwd); + $dest = $self->{'root'}; } my $container = "$ziplocation/$package"; if ($arch ne "all") { @@ -480,7 +468,7 @@ sub _generate_listfile { =item C<< $tlpdb->root([ "/path/to/installation" ]) >> The function C<root> allows to read and set the root of the -installation. Note that root and location is somehow linked! +installation. =cut @@ -492,21 +480,6 @@ sub root { =pod -=item C<< $tlpdb->location("/path/to/texlive.tlpdb") >> - -The function C<location> allows to read and set the location of the -text file of the TeX Live database, by default named C<texlive.tlpdb>. - -=cut - -sub location { - my $self = shift; - if (@_) { $self->{'location'} = shift } - return $self->{'location'}; -} - -=pod - =item C<< $tlpdb->listdir >> The function C<listdir> allows to read and set the packages variable diff --git a/Master/tlpkg/bin/create-package-list b/Master/tlpkg/bin/create-package-list index 4c7b8efbcd4..b6ccacd9cec 100755 --- a/Master/tlpkg/bin/create-package-list +++ b/Master/tlpkg/bin/create-package-list @@ -29,7 +29,7 @@ die "$0: missing tlpdb argument; try --help if you need it.\n" if ($#ARGV<0); die "cannot read tlpdb file $ARGV[0]." if (! -r "$ARGV[0]"); -my $tldb = new TeXLive::TLPDB ( location => "$ARGV[0]" ); +my $tldb = new TeXLive::TLPDB ( root => "$ARGV[0]" ); $tldb->generate_packagelist; @@ -41,7 +41,7 @@ create-package-list - generate a list of TeX Live packages with revisions =head1 SYNOPSIS -create-package-list [OPTION]... texlive.tlpdb +create-package-list [OPTION]... /path/to/root/of/installation/ =head1 OPTIONS @@ -51,7 +51,8 @@ See the tlpfiles documentation for details. =head1 DESCRIPTION B<create-package-list> generates the list of packages with revisions -from the TeX Live Database specified on the command line. +from the TeX Live Installation present at the location specified +at the command line. =head1 AUTHORS AND COPYRIGHT diff --git a/Master/tlpkg/bin/place b/Master/tlpkg/bin/place index b1f69032265..d194119554c 100755 --- a/Master/tlpkg/bin/place +++ b/Master/tlpkg/bin/place @@ -16,7 +16,7 @@ BEGIN { use File::Basename; use File::Find; use Cwd; -use TeXLive::TLConfig; +use TeXLive::TLConfig qw/$InfraLocation $DatabaseName/; use TeXLive::TLPSRC; use TeXLive::TLPOBJ; use TeXLive::TLPDB; @@ -61,8 +61,7 @@ if ($Root eq 'texmf-doc') { } # initialize TLPDB -my $tlpdb_path = "$M/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb"; -my $tlpdb = new TeXLive::TLPDB ( location => $tlpdb_path ); +my $tlpdb = new TeXLive::TLPDB ( root => "$M" ); # create TLTREE from stuff in cooked/$pkg my $tltree = TeXLive::TLTREE->new( 'svnroot' => "$cooked/$package" ); $tltree->init_from_files; @@ -98,7 +97,7 @@ my $tlpnew = $tlpsrc->make_tlpobj($tltree); # we are here in perl world, which makes it easier ... print "\n\f "; if (!defined($tlpold)) { - print "place: $package not present in $tlpdb_path\n\n"; + print "place: $package not present in $M/$InfraLocation/$DatabaseName\n\n"; } else { print "new vs. present $package\n"; my @oldfiles; diff --git a/Master/tlpkg/bin/tlpdb2container b/Master/tlpkg/bin/tlpdb2container index 68d4768dbe9..efb33bd9531 100755 --- a/Master/tlpkg/bin/tlpdb2container +++ b/Master/tlpkg/bin/tlpdb2container @@ -25,8 +25,8 @@ use File::Path; my $opt_all = 0; our $mydir; our $opt_debug = 0; -my $opt_type = "zip"; -my $opt_outputdir = "./zip"; +my $opt_type = "lzma"; +my $opt_outputdir = "./archive"; my $opt_relative = 0; my $help = 0; @@ -45,9 +45,8 @@ sub main { # get the db. chomp (my $Master = `cd $mydir/../.. && pwd`); # xx TLPDB should default - my $tlpdb_path = "$Master/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb"; - my $tlpdb = TeXLive::TLPDB->new ("location" => $tlpdb_path); - die("Cannot load tlpdb at $tlpdb_path!\n") unless defined($tlpdb); + my $tlpdb = TeXLive::TLPDB->new ("root" => "$Master"); + die("Cannot find tlpdb in $Master!\n") unless defined($tlpdb); my @packs; if ($opt_all) { @packs = $tlpdb->list_packages; @@ -57,7 +56,7 @@ sub main # get list of packages. for my $pkg (@packs) { my $obj = $tlpdb->get_package ($pkg); - die "$0: no TeX Live package named $pkg in $tlpdb_path.\n" if ! $obj; + die "$0: no TeX Live package named $pkg in $Master.\n" if ! $obj; $obj->make_container($opt_type,$Master,$opt_outputdir,$pkg,$opt_relative); } } diff --git a/Master/tlpkg/bin/tlpdb2list b/Master/tlpkg/bin/tlpdb2list index 1d4082bf994..f2b74a37a1f 100755 --- a/Master/tlpkg/bin/tlpdb2list +++ b/Master/tlpkg/bin/tlpdb2list @@ -36,7 +36,7 @@ if (! -d $opt_outputdir) { die "cannot read tlpdb $ARGV[0]." if (! -r "$ARGV[0]"); -my $tlpdb = new TeXLive::TLPDB (location => $ARGV[0]); +my $tlpdb = new TeXLive::TLPDB (root => $ARGV[0]); $tlpdb->generate_listfiles ($opt_outputdir); __END__ @@ -47,7 +47,7 @@ tlpdb2list - generates list files from a TeX Live Package Database =head1 SYNOPSIS -tlpdb2list [OPTION]... texlive.tlpdb +tlpdb2list [OPTION]... /path/to/installation/root/ =head1 OPTIONS @@ -65,7 +65,8 @@ See the tlpfiles documentation for details. =head1 DESCRIPTION B<tlpdb2list> generates list files necessary for the installer from the -TeX Live Package Database. +TeX Live Package Database found in the installation given on the +command line. =head1 AUTHORS AND COPYRIGHT diff --git a/Master/tlpkg/bin/tlpdb2updmap b/Master/tlpkg/bin/tlpdb2updmap index a66badc1966..bfb51a5eedb 100755 --- a/Master/tlpkg/bin/tlpdb2updmap +++ b/Master/tlpkg/bin/tlpdb2updmap @@ -39,14 +39,13 @@ sub main { # get the db. chomp (my $Master = `cd $mydir/../.. && pwd`); # xx TLPDB should default - my $tlpdb_path = "$Master/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb"; - my $tlpdb = TeXLive::TLPDB->new ("location" => $tlpdb_path); + my $tlpdb = TeXLive::TLPDB->new ("root" => "$Master"); # get list of packages. my %maps; for my $pkg ($tlpdb->list_packages) { my $obj = $tlpdb->get_package ($pkg); - die "$0: no TeX Live package named $pkg in $tlpdb_path.\n" if ! $obj; + die "$0: no TeX Live package named $pkg in $Master.\n" if ! $obj; # record any maps. my @executes = $obj->executes; diff --git a/Master/tlpkg/bin/tlpfiles b/Master/tlpkg/bin/tlpfiles index 41bc8a48f8d..1409b875569 100755 --- a/Master/tlpkg/bin/tlpfiles +++ b/Master/tlpkg/bin/tlpfiles @@ -51,10 +51,10 @@ sub main # report files in given package. my $pkg = $ARGV[0]; - my $tlpdb = TeXLive::TLPDB->new (location => $tlpdb_path); + my $tlpdb = TeXLive::TLPDB->new (root => $Master); my $obj = $tlpdb->get_package ($pkg); - die "$0: no TeX Live package named $pkg in $tlpdb_path.\n" if ! $obj; + die "$0: no TeX Live package named $pkg in $Master.\n" if ! $obj; my @files = $obj->all_files; print "$_\n" foreach @files; diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 17f13cf0f29..581d69e43a7 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -201,10 +201,9 @@ sub main # get the Master dir chomp (my $Master = `cd $mydir/../.. && pwd`); $TL = $Master; - my $tlpdbloc = "$Master/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb"; # First we load the current texlive.tlpdb - $tlpdb = TeXLive::TLPDB->new ("location" => $tlpdbloc); - die("Cannot load tlpdb at $tlpdbloc!\n") unless defined($tlpdb); + $tlpdb = TeXLive::TLPDB->new ("root" => "$Master"); + die("Cannot find tlpdb in $Master!\n") unless defined($tlpdb); $OPT{"verbose"} = 1; diff --git a/Master/tlpkg/bin/tlprm b/Master/tlpkg/bin/tlprm index 60ec0622cce..24c16ff624a 100755 --- a/Master/tlpkg/bin/tlprm +++ b/Master/tlpkg/bin/tlprm @@ -43,13 +43,12 @@ sub main # xx should default in TLPDB. chomp (my $Master = `cd $mydir/../.. && pwd`); - my $tlpdb_path = "$Master/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb"; - my $tlpdb = TeXLive::TLPDB->new (location => $tlpdb_path); + my $tlpdb = TeXLive::TLPDB->new (root => $Master); foreach my $f (@ARGV) { my $obj = $tlpdb->get_package ($f); if (! $obj) { - warn "$0: no TeX Live package named $f (in $Master/texlive.tlpdb).\n"; + warn "$0: no TeX Live package named $f.\n"; $failure_count++; next; } diff --git a/Master/tlpkg/bin/tlpsrc2tlpdb b/Master/tlpkg/bin/tlpsrc2tlpdb index 173fb554725..6d6741c546d 100755 --- a/Master/tlpkg/bin/tlpsrc2tlpdb +++ b/Master/tlpkg/bin/tlpsrc2tlpdb @@ -103,11 +103,9 @@ sub main # write the new db, to the real location given --all, or stdout. if ($opt_all) { - local *TLPDB; - our $TLPDB = ">$opt_master/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb"; - open (TLPDB) || die "open($TLPDB) failed: $!"; - $tldb->writeout (*TLPDB); - warn "$0: wrote $src_count packages $TLPDB.\n"; + $tldb->root("$opt_master"); + $tldb->save; + warn "$0: wrote $src_count packages ", $tldb->root, ".\n"; } else { $tldb->writeout; } @@ -131,8 +129,8 @@ tlpsrc2tlpdb [OPTION]... [TLPSRC]... =item B<-all> Use all .tlpsrc files in C<Master/tlpkg/tlpsrc/*.tlpsrc>, and update the -live database in C<Master/texlive.tlpdb>. (No repository operations are -done.) +live database in C<Master/tlpkg/texlive.tlpdb>. +(No repository operations are done.) =item B<-catalogue> I<Catalogue_dir> The location given by B<-catalogue> must point to a valid TeX Catalogue. |