summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tlpkginfo
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-04-05 15:57:39 +0000
committerKarl Berry <karl@freefriends.org>2011-04-05 15:57:39 +0000
commit57a5179d7c1ea1d34e207784e5e52e2438ba16de (patch)
tree51a7c268c2a733e37ddb696bc6153993d540d732 /Master/tlpkg/bin/tlpkginfo
parent540927ad17a1d3f65acd988f4f93edf13d4b303e (diff)
beamerthemejltree renamed from beamer-contrib
git-svn-id: svn://tug.org/texlive/trunk@21977 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tlpkginfo')
-rwxr-xr-xMaster/tlpkg/bin/tlpkginfo40
1 files changed, 20 insertions, 20 deletions
diff --git a/Master/tlpkg/bin/tlpkginfo b/Master/tlpkg/bin/tlpkginfo
index 120df3477fd..25f4f07bfea 100755
--- a/Master/tlpkg/bin/tlpkginfo
+++ b/Master/tlpkg/bin/tlpkginfo
@@ -2,13 +2,12 @@
# $Id$
# Public domain. Originally written 2005, Karl Berry.
#
-# Return information given a TL package name (i.e., a tpm file name).
-# We use local copies of CTAN and the TeX Catalogue.
+# Return information given a TL package name (i.e., a tlpsrc file name).
+# We require local copies of CTAN and the TeX Catalogue.
exit (&main ());
-sub main
-{
+sub main {
$CTAN = $ENV{"CTAN"} || "/home/ftp/tex-archive";
$TMPDIR = $ENV{"TMPDIR"} || "/tmp";
$CATALOGUE = $ENV{"TEX_CATALOGUE"} || "/home/httpd/html/catalogue/entries";
@@ -60,8 +59,7 @@ sub main
# Return 0 for success if we find a path (and print it on stdout), else
# return 1.
#
-sub find_ctan_dir
-{
+sub find_ctan_dir {
my ($pkgname) = @_;
return 1 unless $pkgname;
@@ -188,8 +186,7 @@ sub find_ctan_dir
# If the .tlpsrc file for ME has a catalogue entry, return it.
# Else return empty string.
#
-sub tlpsrc_find_catalogue
-{
+sub tlpsrc_find_catalogue {
my ($me) = @_;
chomp (my $mydir = `dirname $0`);
@@ -211,8 +208,7 @@ sub tlpsrc_find_catalogue
#
# Return the ctan path if found (without leading /), or undef.
#
-sub catalogue_find_ctan_path
-{
+sub catalogue_find_ctan_path {
my ($pkgname) = @_;
# catalogue uses all-lowercase file/directory names.
@@ -225,15 +221,21 @@ sub catalogue_find_ctan_path
while ($ctan_path = <CATFILE>) {
last if $ctan_path =~ /<ctan /;
}
- do { close CATFILE; return undef } unless $ctan_path; # the tag may not exist
- $ctan_path .= $_ while (($ctan_path !~ m#/>#) and (<CATFILE>));
+ if (! $ctan_path) { # give up if the tag wasn't there.
+ close CATFILE;
+ return undef;
+ }
+ # if we found the tag, read more lines until we get to the end of the value.
+ while ($ctan_path !~ m,/>,) {
+ $ctan_path .= <CATFILE>;
+ }
close CATFILE;
$ctan_path =~ s/\n/ /g;
- ($ctan_path) = ($ctan_path =~ m#(<.*?/>)#);
+ ($ctan_path) = ($ctan_path =~ m,(<.*?/>),);
return undef unless $ctan_path; # in case it's not present at all
# extract just the dir or file name, without options, etc.
- $ctan_path =~ m#path=(["'])/(.*?)\1#;
+ $ctan_path =~ m,path=(["'])/(.*?)\1,;
$ctan_loc = $2;
return undef unless $ctan_loc; # should never happen, but who knows
@@ -249,8 +251,8 @@ sub catalogue_find_ctan_path
return undef;
} else {
return $do_copy # are we called by prepare() or not?
- ? &copy_to_tmpdir ($pkgname, "$CTAN/$ctan_loc")
- : "$CTAN/$ctan_loc";
+ ? &copy_to_tmpdir ($pkgname, "$CTAN/$ctan_loc")
+ : "$CTAN/$ctan_loc";
}
}
@@ -262,8 +264,7 @@ sub catalogue_find_ctan_path
# Create a tmpdir with the tds-ready tree unpacked if any,
# else return the normal ctan dir.
#
-sub prepare
-{
+sub prepare {
my ($pkg) = @_;
return undef unless $pkg;
@@ -332,8 +333,7 @@ sub prepare
# copy file to temp dir and return that for ctan2tl to use.
#
-sub copy_to_tmpdir
-{
+sub copy_to_tmpdir {
my ($pkgname,$src) = @_;
my $pkgdir = "$TMPDIR/tl.$pkgname";