gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] tla-rsync-mirror


From: Jan Hudec
Subject: Re: [Gnu-arch-users] tla-rsync-mirror
Date: Thu, 8 Jan 2004 21:56:15 +0100
User-agent: Mutt/1.5.5.1+cvs20040105i

On Thu, Jan 08, 2004 at 19:29:54 +0100, Jan Hudec wrote:
> On Wed, Dec 31, 2003 at 20:49:57 +0000, Andrew Suffield wrote:
> > I just polished my rsync-based alternative to archive-mirror; in the
> 
> It's a great tool, really. Most importantly because it will push cached
> revisions, and of course also because it is faster.
> 
> However, my archives reside in a directory called {archives} and the URI
> package encodes it with %7B. Rsync does not like that. So here is
> a small fix to undo such change, should anyone have similar problems:

Sorry, I left out one line. Here is a correct patch.

--- tla-rsync-mirror.orig       2004-01-08 19:19:01.000000000 +0100
+++ tla-rsync-mirror    2004-01-08 19:25:24.000000000 +0100
@@ -46,20 +46,27 @@
 die "Couldn't find FROM path" unless $from;
 die "Couldn't find TO path" unless $to;
 
+sub fixup
+  {
+    my $path = shift;
+    $path =~ s/%(..)/chr(hex($1))/eg;
+    return $path;
+  }
+
 sub process_location
   {
     my $location = shift;
     my $uri = URI->new($location, "file");
     if (not defined $uri->scheme or $uri->scheme eq "file")
       {
-        return $uri->path;
+        return fixup($uri->path);
       }
     elsif ($uri->scheme eq "sftp")
       {
         $uri->opaque =~ m,^//([^/]+)/(.*)$, or die "Failed to parse sftp URI: 
$uri";
         my $host = $1;
         my $path = $2;
-        return "$1:/$2";
+        return fixup("$1:/$2");
       }
     die "Don't know how to handle URI scheme " . $uri->scheme;
   }

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec 
<address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]