]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Updated patch
authorhttp://www.cse.unsw.edu.au/~willu/ <http://www.cse.unsw.edu.au/~willu/@web>
Mon, 21 Jul 2008 09:14:10 +0000 (05:14 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 21 Jul 2008 09:14:10 +0000 (05:14 -0400)
doc/forum/Allow_overriding_of_symlink_restriction.mdwn

index f658f0cb3479045658f63d51196f3dcfb7aa9611..0d93a28c16e2c796624084f5e20de4ef6c365360 100644 (file)
@@ -68,24 +68,30 @@ patch fixes things.  Again, patch inline.  Again, this patch could be
 cleaned up :).  I just wanted to see if there was any chance of a patch
 like this being accepted before I bothered.
 
 cleaned up :).  I just wanted to see if there was any chance of a patch
 like this being accepted before I bothered.
 
-       diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
-       index 79b9eb3..e88118b 100644
-       --- a/IkiWiki/Wrapper.pm
-       +++ b/IkiWiki/Wrapper.pm
-       @@ -9,9 +9,13 @@ use Data::Dumper;
-        use IkiWiki;
-        
-        sub gen_wrapper () { #{{{
-       +        my $this = $0;
-       +        if ($config{allowsrcdirlinks}) {
-       +       } else {
-               $config{srcdir}=abs_path($config{srcdir});
-               $config{destdir}=abs_path($config{destdir});
-               my $this=abs_path($0);
-       +       }
-               if (! -x $this) {
-                       error(sprintf(gettext("%s doesn't seem to be executable"), $this
-               }
+>>> Patch updated:
+
+    index 79b9eb3..ce1c395 100644
+    --- a/IkiWiki/Wrapper.pm
+    +++ b/IkiWiki/Wrapper.pm
+    @@ -4,14 +4,14 @@ package IkiWiki;
+     
+     use warnings;
+     use strict;
+    -use Cwd q{abs_path};
+     use Data::Dumper;
+     use IkiWiki;
+    +use File::Spec;
+     
+     sub gen_wrapper () { #{{{
+    -       $config{srcdir}=abs_path($config{srcdir});
+    -       $config{destdir}=abs_path($config{destdir});
+    -       my $this=abs_path($0);
+    +       $config{srcdir}=File::Spec->rel2abs($config{srcdir});
+    +       $config{destdir}=File::Spec->rel2abs($config{destdir});
+    +       my $this=File::Spec->rel2abs($0);
+            if (! -x $this) {
+                    error(sprintf(gettext("%s doesn't seem to be executable"), $this
+            }
 
 > ikiwiki uses absolute paths for `srcdir`, `destdir` and `this` because
 > the wrapper could be run from any location, and if any of them happen to
 
 > ikiwiki uses absolute paths for `srcdir`, `destdir` and `this` because
 > the wrapper could be run from any location, and if any of them happen to
@@ -100,6 +106,7 @@ like this being accepted before I bothered.
 
 >> I'll do that.  I assume something like <code> File::Spec->file_name_is_absolute( $path ); </code> would have more cross-platformy goodness.
 >> hrm.  I might see if <code> File::Spec->rel2abs( $path ) ; </code> will give absolute an path without expanding symlinks.
 
 >> I'll do that.  I assume something like <code> File::Spec->file_name_is_absolute( $path ); </code> would have more cross-platformy goodness.
 >> hrm.  I might see if <code> File::Spec->rel2abs( $path ) ; </code> will give absolute an path without expanding symlinks.
+>>> Patch using rel2abs() works well - it no longer expands symlinks.
 
 > I suppose you could do the same thing with `$this`, but it does not sound
 > like it has caused you problems anyway.
 
 > I suppose you could do the same thing with `$this`, but it does not sound
 > like it has caused you problems anyway.