summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLPDB.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm25
1 files changed, 22 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 3aaaff8aded..0fb2400518b 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -34,6 +34,7 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages
$tlpdb->fmtutil_cnf_lines;
$tlpdb->language_dat_lines;
$tlpdb->package_revision("packagename");
+ $tlpdb->location;
TeXLive::TLPDB->listdir([$dir]);
$tlpdb->generate_listfiles([$destdir]);
@@ -98,7 +99,7 @@ sub add_tlpobj {
=item C<< $tlpdb->from_file($filename) >>
The C<from_file> function initializes the C<TLPDB> in case the
-location was not given at generation time. If C<$filename> begins
+root was not given at generation time. If C<$filename> begins
with C<http://> or C<ftp://>, the program C<wget> is used to download
the file.
@@ -168,8 +169,8 @@ as location. If the location is undefined, die.
sub save {
my $self = shift;
- my $path = "$self->{'root'}/$InfraLocation/$DatabaseName";
- mkdirhier("$self->{'root'}/$InfraLocation");
+ my $path = $self->location;
+ mkdirhier(dirname($path));
open(FOO,">$path") || die("Cannot open $path for writing: $!");
$self->writeout(\*FOO);
close(FOO);
@@ -481,6 +482,24 @@ sub root {
=pod
+=item C<< $tlpdb->location >>
+
+The function C<location> returns the location of the actual C<texlive.tlpdb>
+file used. Note that this is a read-only function, you cannot change
+the root of the TLPDB using this function.
+
+=cut
+
+sub location {
+ my $self = shift;
+ return "$self->{'root'}/$InfraLocation/$DatabaseName";
+}
+
+=pod
+
+
+=pod
+
=item C<< $tlpdb->listdir >>
The function C<listdir> allows to read and set the packages variable