From cf643b58650b5f839617deb64c86370ccfe113ef Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Thu, 2 Oct 2008 22:21:41 +0000 Subject: Fix reading ctan_path from the catalogue: - handles multi-line ctan tag - with "" or '' as quotes - attributes in any order - no more sensitive to spurious spaces at EOL. git-svn-id: svn://tug.org/texlive/trunk@10830 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/bin/tlpkginfo | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Master') diff --git a/Master/tlpkg/bin/tlpkginfo b/Master/tlpkg/bin/tlpkginfo index bea17cd6590..9aa0f34412e 100755 --- a/Master/tlpkg/bin/tlpkginfo +++ b/Master/tlpkg/bin/tlpkginfo @@ -187,14 +187,20 @@ sub catalogue_find_ctan_path my $catfile = "$CATALOGUE/$firstchar/$pkgname.xml"; return undef unless -r $catfile; - # get the raw line from the catalogue file. (let's hope it's one line.) - my $ctan_path = `sed -n "s,^ *) { last if $ctan_path =~ /#) and ()); + close CATFILE; + $ctan_path =~ s/\n/ /g; + ($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. - (my $ctan_loc = $ctan_path) =~ s,'/>,,; - $ctan_loc =~ s,' .*,,; - chomp ($ctan_loc); + $ctan_path =~ m#path=(["'])/(.*?)\1#; + $ctan_loc = $2; + return undef unless $ctan_loc; # should never happen, but who knows # if the Catalogue lists the path as a single file, there are two # possibilities: (1) it really is a single file, e.g., texilikecover, -- cgit v1.2.3