From 6cd1a45d57b066167f4a383721c93e732294edf5 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 5 Sep 2012 23:52:48 +0000 Subject: allow for spaces in repo path again git-svn-id: svn://tug.org/texlive/trunk@27601 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/NEWS | 3 +++ Master/texmf/scripts/texlive/tlmgr.pl | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'Master/texmf/scripts') diff --git a/Master/texmf/scripts/texlive/NEWS b/Master/texmf/scripts/texlive/NEWS index bbc7ed0ea5f..cf9e0d5c4ba 100644 --- a/Master/texmf/scripts/texlive/NEWS +++ b/Master/texmf/scripts/texlive/NEWS @@ -1,6 +1,9 @@ (This file public domain. Originally written by Norbert Preining and Karl Berry, 2010.) +

tlmgr revision NEXT (released NNmmm12):
+

  • allow for spaces in the repository path (again) +

    tlmgr revision 27413 (released 16aug12):

  • fix Perl syntax warning in trans.pl
  • tar -m in Windows update to avoid spurious problems diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 94621dbab38..e1d95ab0c25 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -3505,11 +3505,13 @@ sub array_to_repository { } for my $k (keys %r) { my $v = $r{$k}; - if ($k eq $v) { - push @ret, $k; - } else { - push @ret, "$v#$k"; + if ($k ne $v) { + $v = "$v#$k"; } + # encode spaces and % in the path and tags + $v =~ s/%/%25/g; + $v =~ s/ /%20/g; + push @ret, $v; } return "@ret"; } @@ -3523,11 +3525,17 @@ sub repository_to_array { return %r; } for my $rr (@repos) { + my $tag; + my $url; + # decode spaces and % in reverse order + $rr =~ s/%20/ /g; + $rr =~ s/%25/%/g; + $tag = $url = $rr; if ($rr =~ m/^([^#]+)#(.*)$/) { - $r{$2} = $1; - } else { - $r{$rr} = $rr; + $tag = $2; + $url = $1; } + $r{$tag} = $url; } return %r; } -- cgit v1.2.3