From 3f3076230b9e66a439187e812172a7e5facb9ed7 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 14 Nov 2015 03:12:34 +0000 Subject: tlpfiles: implement -fullpath option git-svn-id: svn://tug.org/texlive/trunk@38848 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tlpfiles | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'Master/tlpkg/bin/tlpfiles') 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 is contained. +=item B<-fullpath> + +By default C<-pkgof> uses only the basename of I for comparison. +With this option given, comparision/search is based on the full path +names. + =item B<-help> Print this documentation and exit. -- cgit v1.2.3