summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-08-05 16:19:41 +0000
committerNorbert Preining <preining@logic.at>2009-08-05 16:19:41 +0000
commitedd31659b22ab4d3718918fca2ac2506fe118474 (patch)
tree55a9f86d0262db51a6e5c31c960c98ca1eeefbd1 /Master/tlpkg
parent272f667ff1987bad105a0f13f0337e9813671862 (diff)
move all the options from the .tlpsrc files to hashes in TLConfig
and initialize the respective tlpobjs (00texlive.installation and 00texlive.config) from the values in these hashes. Update tl-update-tlpdb to use that, and add some comments to the tlpsrc files git-svn-id: svn://tug.org/texlive/trunk@14542 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/TeXLive/TLConfig.pm48
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm27
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlpdb7
-rwxr-xr-xMaster/tlpkg/bin/tlpsrc2tlpdb3
-rw-r--r--Master/tlpkg/tlpsrc/00texlive.config.tlpsrc8
-rw-r--r--Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc19
6 files changed, 76 insertions, 36 deletions
diff --git a/Master/tlpkg/TeXLive/TLConfig.pm b/Master/tlpkg/TeXLive/TLConfig.pm
index 0313be0bf81..73703489569 100644
--- a/Master/tlpkg/TeXLive/TLConfig.pm
+++ b/Master/tlpkg/TeXLive/TLConfig.pm
@@ -18,6 +18,7 @@ BEGIN {
$MetaCategoriesRegexp
$CategoriesRegexp
$DefaultCategory
+ $DefaultContainerFormat
$DefaultContainerExtension
$InfraLocation
$DatabaseName
@@ -33,6 +34,7 @@ BEGIN {
$RelocTree
%TLPDBOptions
%TLPDBSettings
+ %TLPDBConfigs
);
@EXPORT = @EXPORT_OK;
}
@@ -64,7 +66,8 @@ our $DatabaseName = "texlive.tlpdb";
our $BlockSize = 4096;
# the way we package things on the web
-our $DefaultContainerExtension = "tar.xz";
+our $DefaultContainerFormat = "xz";
+our $DefaultContainerExtension = "tar.$DefaultContainerFormat";
our $Archive = "archive";
our $TeXLiveServerURL = "http://mirror.ctan.org";
@@ -84,6 +87,15 @@ if ($^O=~/^MSWin(32|64)$/i) {
}
#
+# stuff formerly set in 00texlive.config
+#
+our %TLPDBConfigs = (
+ "container_split_src_files" => 1,
+ "container_split_doc_files" => 1,
+ "container_format" => $DefaultContainerFormat,
+ "release" => $ReleaseYear );
+
+#
# definition of the option strings and their value types
# possible types are:
# - u: url
@@ -98,61 +110,63 @@ if ($^O=~/^MSWin(32|64)$/i) {
# WARNING: keep these in sync!
#
# $TLPDBOptions{"option"}->[0] --> type
-# ->[1] --> tlmgr name
-# ->[2] --> tlmgr description
+# ->[1] --> default value
+# ->[2] --> tlmgr name
+# ->[3] --> tlmgr description
+
our %TLPDBOptions = (
"location" =>
- [ "u",
+ [ "u", "__MASTER__",
"location",
"Default installation location" ],
"create_formats" =>
- [ "b",
+ [ "b", 1,
"formats",
"Create formats on installation" ],
"desktop_integration" =>
- [ "b",
+ [ "b", 1,
"desktop_integration",
"Create shortcuts (menu and desktop) in postinst" ],
"file_assocs" =>
- [ "n:0..2",
+ [ "n:0..2", 1,
"fileassocs",
"Change file associations in postinst" ],
"post_code" =>
- [ "b",
+ [ "b", 1,
"postcode",
"Run postinst code blobs" ],
"sys_bin" =>
- [ "p",
+ [ "p", "/usr/local/bin",
"sys_bin",
"Destination for symlinks for binaries" ],
"sys_man" =>
- [ "p",
+ [ "p", "/usr/local/man",
"sys_man",
"Destination for symlinks for man pages" ],
"sys_info" =>
- [ "p",
+ [ "p", "/usr/local/info",
"sys_info",
"Destination for symlinks for info docs" ],
"install_docfiles" =>
- [ "b",
+ [ "b", 1,
"docfiles",
"Install documentation files" ],
"install_srcfiles" =>
- [ "b",
+ [ "b", 1,
"srcfiles",
"Install source files" ],
"w32_multi_user" =>
- [ "b",
+ [ "b", 1,
"multiuser",
"Install for shortcuts/menu items for all users (w32)" ],
"autobackup" =>
- [ "n:-1..",
+ [ "n:-1..", 0,
"autobackup",
"Number of backups to keep" ],
"backupdir" =>
- [ "p",
+ [ "p", "",
"backupdir",
- "Directory for backups" ]
+ "Directory for backups" ],
);
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index e91bea2620d..c9024d7e113 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -51,6 +51,8 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages
$tlpdb->config_revision;
$tlpdb->options;
$tlpdb->option($key, [$value]);
+ $tlpdb->reset_options();
+ $tlpdb->add_default_options();
$tlpdb->settings;
$tlpdb->setting($key, [$value]);
$tlpdb->sizes_of_packages($opt_src, $opt_doc [, @packs ]);
@@ -828,8 +830,8 @@ sub config_src_container {
my $self = shift;
if (defined($self->{'tlps'}{'00texlive.config'})) {
foreach my $d ($self->{'tlps'}{'00texlive.config'}->depends) {
- if ($d eq "container_split_src_files") {
- return 1;
+ if ($d =~ m!^container_split_src_files/(.*)$!) {
+ return "$1";
}
}
}
@@ -849,8 +851,8 @@ sub config_doc_container {
my $self = shift;
if (defined($self->{'tlps'}{'00texlive.config'})) {
foreach my $d ($self->{'tlps'}{'00texlive.config'}->depends) {
- if ($d eq "container_split_doc_files") {
- return 1;
+ if ($d =~ m!^container_split_doc_files/(.*)$!) {
+ return "$1";
}
}
}
@@ -1129,6 +1131,23 @@ sub setting {
return $ret;
}
+sub reset_options {
+ my $self = shift;
+ for my $k (keys %TeXLive::TLConfig::TLPDBOptions) {
+ $self->option($k, $TeXLive::TLConfig::TLPDBOptions{$k}->[1]);
+ }
+}
+
+sub add_default_options {
+ my $self = shift;
+ for my $k (keys %TeXLive::TLConfig::TLPDBOptions) {
+ # if the option is not set already, do set it to defaults
+ if (! $self->option($k) ) {
+ $self->option($k, $TeXLive::TLConfig::TLPDBOptions{$k}->[1]);
+ }
+ }
+}
+
=pod
=item C<< $tlpdb->options >>
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb
index 9b6b5c3c2eb..3b74e04f60d 100755
--- a/Master/tlpkg/bin/tl-update-tlpdb
+++ b/Master/tlpkg/bin/tl-update-tlpdb
@@ -179,6 +179,10 @@ sub create_tlpdb
}
if ($tlp->name eq "00texlive.config") {
my @bar = $tlp->depends;
+ for my $k (keys %TeXLive::TLConfig::TLPDBConfigs) {
+ push @bar, "$k/" . $TeXLive::TLConfig::TLPDBConfigs{$k};
+ }
+ # add the latest revision
push @bar, "revision/".$tltree->revision;
$tlp->depends (@bar);
}
@@ -189,6 +193,9 @@ sub create_tlpdb
my @archs = $tltree->architectures;
$tldb->setting("available_architectures", @archs);
+ # reset options to what we have by default
+ $tldb->add_default_options();
+
return($tldb, $src_count);
}
diff --git a/Master/tlpkg/bin/tlpsrc2tlpdb b/Master/tlpkg/bin/tlpsrc2tlpdb
index 59643fc2273..2281ddd3e75 100755
--- a/Master/tlpkg/bin/tlpsrc2tlpdb
+++ b/Master/tlpkg/bin/tlpsrc2tlpdb
@@ -124,6 +124,9 @@ sub main
}
if ($tlp->name eq "00texlive.config") {
my @bar = $tlp->depends;
+ for my $k (keys %TeXLive::TLConfig::TLPDBConfigs) {
+ push @bar, "$k/" . $TeXLive::TLConfig::TLPDBConfigs{$k};
+ }
push @bar, "revision/".$tltree->revision;
$tlp->depends (@bar);
}
diff --git a/Master/tlpkg/tlpsrc/00texlive.config.tlpsrc b/Master/tlpkg/tlpsrc/00texlive.config.tlpsrc
index 90c05e5f3d9..7a8da4fbb31 100644
--- a/Master/tlpkg/tlpsrc/00texlive.config.tlpsrc
+++ b/Master/tlpkg/tlpsrc/00texlive.config.tlpsrc
@@ -7,9 +7,9 @@ longdesc appearance within the texlive.tlpdb. It is only on container level.
longdesc The container_format/XXXXX specifies the format, currently allowed
longdesc is only "xz", which generates .tar.xz files. zip can be supported.
longdesc release/NNNN specifies the release number as used in the installer.
+longdesc
+longdesc These values are taken from TeXLive::TLConfig::TLPDBConfigs hash
+longdesc at tlpdb creation time.
+longdesc
longdesc For information on the 00texlive prefix see
longdesc 00texlive.installation(.tlpsrc)
-depend container_split_src_files
-depend container_split_doc_files
-depend container_format/xz
-depend release/2009
diff --git a/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc b/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc
index 959ae99fb81..088fd2954ff 100644
--- a/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc
+++ b/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc
@@ -7,6 +7,14 @@ longdesc
longdesc 2. on an installed system it serves as a configuration file.
longdesc We have to remember these settings for additional package
longdesc installation, removal, etc.
+longdesc
+longdesc In the tlpsrc itself only those options are saved that are used *ONLY*
+longdesc at installation time, currently opt_paper, opt_path, opt_frozen.
+longdesc These will longdesc be saved in the local tlpdb and will not be
+longdesc accessible by tlmgr.
+longdesc
+longdesc All other options are set from TLConfig::TLPDBOptions to the
+longdesc default values specified there.
longdesc
longdesc There are two types here:
longdesc - If the key starts with opt_ this is an options that can be
@@ -30,19 +38,8 @@ longdesc All packages starting with 00texlive are considered virtual packages
longdesc in the sense that no containers are generated and these packages
longdesc are never split into .src and .doc sub-packages in the tlpdb.
-depend opt_location:__MASTER__
depend opt_paper:a4
-depend opt_create_formats:1
-depend opt_desktop_integration:1
-depend opt_file_assocs:1
-depend opt_post_code:1
-depend opt_w32_multi_user:1
depend opt_path:0
-depend opt_sys_bin:/usr/local/bin
-depend opt_sys_info:/usr/local/info
-depend opt_sys_man:/usr/local/man
-depend opt_install_docfiles:1
-depend opt_install_srcfiles:1
# if we want to make a dist frozen uncomment that and tlmgr will bail out
# telling that TLNNNN is frozen