summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tlpfiles
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2015-11-14 03:12:34 +0000
committerNorbert Preining <preining@logic.at>2015-11-14 03:12:34 +0000
commit3f3076230b9e66a439187e812172a7e5facb9ed7 (patch)
tree0080957636fc5af82bd02f676c28f127e65d9eef /Master/tlpkg/bin/tlpfiles
parentffcc49c4b4d5f5ad05ff487cf2de0b5c7a8f7e09 (diff)
tlpfiles: implement -fullpath option
git-svn-id: svn://tug.org/texlive/trunk@38848 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tlpfiles')
-rwxr-xr-xMaster/tlpkg/bin/tlpfiles22
1 files changed, 19 insertions, 3 deletions
diff --git a/Master/tlpkg/bin/tlpfiles b/Master/tlpkg/bin/tlpfiles
index e086d02d907..b42e83ad3f8 100755
--- a/Master/tlpkg/bin/tlpfiles
+++ b/Master/tlpkg/bin/tlpfiles
@@ -28,9 +28,11 @@ our %DB_BY_FILE; # used privately below.
our @opt_pkgof = ();
my $opt_help = 0;
+my $opt_fullpath = 0;
TeXLive::TLUtils::process_logging_options ();
GetOptions ("pkgof=s" => \@opt_pkgof,
+ "fullpath" => \$opt_fullpath,
"help|?" => \$opt_help) or pod2usage (2);
pod2usage ("-exitstatus" => 0, "-verbose" => 2) if $opt_help;
@@ -107,15 +109,23 @@ sub find_pkg_of_file
(undef,$pkg) = split (/ /);
} elsif (/^ /) {
# we carefully designed the format so that the only lines with
- # leading spaces are the files. here we just take the basename.
- (my $dbfile = $_) =~ s,^.*/,,;
+ # leading spaces are the files.
+ # By default we take only the basename, unless $opt_fullpath
+ my $dbfile = $_;
+ if ($opt_fullpath) {
+ $dbfile =~ s,^ ,,;
+ } else {
+ $dbfile =~ s,^.*/,,;
+ }
$DB_BY_FILE{$dbfile} .= "$pkg ";
}
}
close (FILE) || warn "close($FILE) failed: $!";
}
- $file =~ s,^.*/,,; # take basename
+ if (!$opt_fullpath) {
+ $file =~ s,^.*/,,; # take basename
+ }
# strict stupidity
my $ret = exists $DB_BY_FILE{$file} ? substr ($DB_BY_FILE{$file}, 0, -1)
@@ -142,6 +152,12 @@ tlpfiles - list files contained in a TeX Live package, or vice versa
Output the TeX Live package(s) in which each I<file> is contained.
+=item B<-fullpath>
+
+By default C<-pkgof> uses only the basename of I<file> for comparison.
+With this option given, comparision/search is based on the full path
+names.
+
=item B<-help>
Print this documentation and exit.