Skip Menu |

This queue is for tickets about the SVN-Web CPAN distribution.

Report information
The Basics
Id: 16774
Status: resolved
Priority: 0/
Queue: SVN-Web

People
Owner: Nobody in particular
Requestors: dpavlin [...] rot13.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.42
Fixed in: (no value)



Subject: svnweb-install create zero size files instead of coping directories
This affect css/trac and template/trac and template/plain. File::Copy should be really blamed for this. Simple workaround is to issue something like: cp -r lib/SVN/Web/Template/* /data/svnweb/template/ cp -r lib/SVN/Web/Style/ /data/svnweb/css/ from distribution directory if installed version is in /data/svnweb. Without this, strange "file not found" errors might scare away new users (which is shame, great module, btw).
Hi On Wed Dec 28 16:14:29 2005, DPAVLIN wrote: Show quoted text
> This affect css/trac and template/trac and template/plain. File::Copy > should be really blamed for this. > > Simple workaround is to issue something like: > > cp -r lib/SVN/Web/Template/* /data/svnweb/template/ > cp -r lib/SVN/Web/Style/ /data/svnweb/css/ > > from distribution directory if installed version is in /data/svnweb. > Without this, strange "file not found" errors might scare away new > users (which is shame, great module, btw).
I can't reproduce this -- svnweb-install has always worked with no problems on my development system, and on the handful of systems (FreeBSD and Solaris) that I've deployed it on. Please could you explain, in detail, what the problem is. Ideally, if you could: mkdir /tmp/svnweb cd /tmp/svnweb svnweb-install find . -print and include the output from the find(1) command, that would be really helpful. Thanks.
On Tue Jan 24 11:47:20 2006, NIKC wrote: Show quoted text
> Please could you explain, in detail, what the problem is. Ideally, if > you could: > > mkdir /tmp/svnweb > cd /tmp/svnweb > svnweb-install > find . -print > > and include the output from the find(1) command, that would be really > helpful.
find . -ls would be even better. Thanks.
Subject: Re: [rt.cpan.org #16774] svnweb-install create zero size files instead of coping directories
Date: Wed, 25 Jan 2006 12:36:58 +0100
To: via RT <bug-SVN-Web [...] rt.cpan.org>
From: Dobrica Pavlinusic <dpavlin [...] rot13.org>
On Tue, Jan 24, 2006 at 11:47:22AM -0500, via RT wrote: Show quoted text
> I can't reproduce this -- svnweb-install has always worked with no > problems on my development system, and on the handful of systems > (FreeBSD and Solaris) that I've deployed it on. > > Please could you explain, in detail, what the problem is. Ideally, if > you could: > > mkdir /tmp/svnweb > cd /tmp/svnweb > svnweb-install > find . -print > > and include the output from the find(1) command, that would be really > helpful.
I included output from find . -ls which is more verbose on Linux systems. I think that File::Copy is to blame: $ mkdir 1 $ perl -MFile::Copy -e 'copy('1','2')' $ ls -ald 1 2 drwxr-xr-x 2 dpavlin dpavlin 4096 2006-01-25 12:31 1 -rw-r--r-- 1 dpavlin dpavlin 0 2006-01-25 12:32 2 -- Dobrica Pavlinusic 2share!2flame dpavlin@rot13.org Unix addict. Internet consultant. http://www.rot13.org/~dpavlin

Message body is not shown because sender requested not to inline it.

On Wed Jan 25 06:38:30 2006, dpavlin@rot13.org wrote: Show quoted text
> I think that File::Copy is to blame:
Quick chat to PerlMonks chatterbox proved me wrong. It seems that File::Copy should be only blamed for not returning error, while directory handling is just not task for it :-)
Subject: Re: [rt.cpan.org #16774] svnweb-install create zero size files instead of coping directories
Date: Thu, 26 Jan 2006 09:50:36 +0000
To: bug-SVN-Web [...] rt.cpan.org
From: Nik Clayton <nik [...] ngo.org.uk>
Dobrica Pavlinusic via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=16774 > > > On Wed Jan 25 06:38:30 2006, dpavlin@rot13.org wrote:
>> I think that File::Copy is to blame:
> > Quick chat to PerlMonks chatterbox proved me wrong. It seems that > File::Copy should be only blamed for not returning error, while > directory handling is just not task for it :-)
OK, that makes sense. The problem is that svnweb-install doesn't use File::Copy to copy directories -- it creates the directory itself. Here's the relevant code from svnweb-install: find({ wanted => sub { my $dst_path = $File::Find::name; $dst_path =~ s/$path/$to/; if(-d $File::Find::name) { mkdir $dst_path; } else { copy($File::Find::name, $dst_path); } }, no_chdir => 1 }, $path); As you can see, if $dst_path is a directory then mkdir() is used, otherwise File::Copy::copy() is used to copy the file. I've just released SVN::Web 0.43 to CPAN. Could you try that, and please verify that you're using the svnweb-install that ships with 0.43. If that doesn't work, please try the attached svnweb-install. It's almost identical to the one that ships with 0.43, it just emits some extra debugging information. Please run that version, and send me a copy of the output. I've attached a copy of the output I get when I run it. Each block of output that starts: Found: /path/to/file indicates a file or directory that's been found in the svnweb distribution. As you can see from my run, directories are found first, created, and then all files in that directory are copied. I suspect it's not happening in that order on your installation for some reason. The output also includes the versions of Perl, File::Copy, and File::Find that work on my system. If you're using an earlier version of these (especially if it's an earlier version of File::Find) can you try upgrading to at least the same version that I'm running, and see if that fixes the problem. And there's one more thing to try. If the attached svnweb-install doesn't work, could you edit it. Find the line that looks like this: }, no_chdir => 1 }, $path); (line #62) and change it to: }, no_chdir => 1, bydepth => 0 }, $path); Then re-run svnweb-install. That shouldn't make any difference. But if it does then I think it's a bug (or an incompatability between different versions) in File::Find. Thanks for your help in tracking this down. N
svnweb-install Using SVN::Web 0.43 Using Perl 5.8.7 Using File::Copy 2.08 Using File::Find 1.09 Loaded SVN::Web from /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web.pm Installing I18N -> po Base path is now /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/I18N Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/I18N dst_path is now: po Directory, making it Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/I18N/en.po dst_path is now: po/en.po File, copying to po/en.po Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/I18N/fr.po dst_path is now: po/fr.po File, copying to po/fr.po Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/I18N/zh_cn.po dst_path is now: po/zh_cn.po File, copying to po/zh_cn.po Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/I18N/zh_tw.po dst_path is now: po/zh_tw.po File, copying to po/zh_tw.po Installing Style -> css Base path is now /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style dst_path is now: css Directory, making it Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/common.css dst_path is now: css/common.css File, copying to css/common.css Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/styles-hlb.css dst_path is now: css/styles-hlb.css File, copying to css/styles-hlb.css Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac dst_path is now: css/trac Directory, making it Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/browser.css dst_path is now: css/trac/browser.css File, copying to css/trac/browser.css Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/changeset.css dst_path is now: css/trac/changeset.css File, copying to css/trac/changeset.css Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/code.css dst_path is now: css/trac/code.css File, copying to css/trac/code.css Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/diff.css dst_path is now: css/trac/diff.css File, copying to css/trac/diff.css Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/file.png dst_path is now: css/trac/file.png File, copying to css/trac/file.png Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/filedeny.png dst_path is now: css/trac/filedeny.png File, copying to css/trac/filedeny.png Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/folder.png dst_path is now: css/trac/folder.png File, copying to css/trac/folder.png Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/folderdeny.png dst_path is now: css/trac/folderdeny.png File, copying to css/trac/folderdeny.png Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/parent.png dst_path is now: css/trac/parent.png File, copying to css/trac/parent.png Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/svnweb.css dst_path is now: css/trac/svnweb.css File, copying to css/trac/svnweb.css Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/text-diff-html.css dst_path is now: css/trac/text-diff-html.css File, copying to css/trac/text-diff-html.css Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Style/trac/trac.css dst_path is now: css/trac/trac.css File, copying to css/trac/trac.css Installing Template -> template Base path is now /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template dst_path is now: template Directory, making it Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain dst_path is now: template/plain Directory, making it Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/browse dst_path is now: template/plain/browse File, copying to template/plain/browse Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/diff dst_path is now: template/plain/diff File, copying to template/plain/diff Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/footer dst_path is now: template/plain/footer File, copying to template/plain/footer Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/header dst_path is now: template/plain/header File, copying to template/plain/header Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/list dst_path is now: template/plain/list File, copying to template/plain/list Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/log dst_path is now: template/plain/log File, copying to template/plain/log Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/revision dst_path is now: template/plain/revision File, copying to template/plain/revision Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/view dst_path is now: template/plain/view File, copying to template/plain/view Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/plain/x dst_path is now: template/plain/x File, copying to template/plain/x Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac dst_path is now: template/trac Directory, making it Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/browse dst_path is now: template/trac/browse File, copying to template/trac/browse Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/diff dst_path is now: template/trac/diff File, copying to template/trac/diff Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/footer dst_path is now: template/trac/footer File, copying to template/trac/footer Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/header dst_path is now: template/trac/header File, copying to template/trac/header Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/list dst_path is now: template/trac/list File, copying to template/trac/list Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/log dst_path is now: template/trac/log File, copying to template/trac/log Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/revision dst_path is now: template/trac/revision File, copying to template/trac/revision Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/view dst_path is now: template/trac/view File, copying to template/trac/view Found: /usr/home/nik/svk/local/jc/CPAN/SVN-Web/trunk/s/../blib/lib/SVN/Web/Template/trac/x dst_path is now: template/trac/x File, copying to template/trac/x SVN::Web now installed! please see config.yaml
#!/usr/bin/perl use strict; use Config; use File::Copy; use File::Basename; use File::Find; BEGIN { # This is a nasty hack. SVN::Core has a bug. "perl -MSVN::Core -c -e 1" # will dump core. Something to do with the interaction between "-c" # running BEGIN blocks but not running END blocks, or similar. # # Anyway, we want to test to make sure this script compiles cleanly. # And we want to use SVN::Web. Since the two are mutually exclusive, # only use SVN::Web (and hence SVN::Core) if we're not compiling. if(! $^C) { require SVN::Web; } } die "already have config.yaml" if -e 'config.yaml'; print "svnweb-install\n"; print "Using SVN::Web $SVN::Web::VERSION\n"; print "Using Perl "; printf("%vd\n", $^V); print "Using File::Copy $File::Copy::VERSION\n"; print "Using File::Find $File::Find::VERSION\n"; print "\n"; open my $fh, ">config.yaml"; my %targets = ( Template => 'template', I18N => 'po', Style => 'css', ); my $svnweb_path = $INC{'SVN/Web.pm'}; print "Loaded SVN::Web from $svnweb_path\n"; while (my ($from, $to) = each %targets) { my $path = $svnweb_path; print "Installing $from -> $to\n"; $path =~ s{.pm$}{/$from}i or next; print " Base path is now $path\n"; find({ wanted => sub { my $dst_path = $File::Find::name; print " Found: $dst_path\n"; $dst_path =~ s/$path/$to/; print " dst_path is now: $dst_path\n"; if(-d $File::Find::name) { print " Directory, making it\n"; mkdir $dst_path; } else { print " File, copying to $dst_path\n"; copy($File::Find::name, $dst_path); } }, no_chdir => 1 }, $path); } print $fh <<END; # Actions, and the classes that implement them. actions: browse: class: SVN::Web::Browse checkout: class: SVN::Web::Checkout diff: class: SVN::Web::Diff list: class: SVN::Web::List log: class: SVN::Web::Log revision: class: SVN::Web::Revision rss: class: SVN::Web::RSS view: class: SVN::Web::View # Suggested minimum filters to run log messages through. Note that # it is not fatal if one of these filters is not installed. log_msg_filters: - name: standard filter: html - name: standard filter: html_line_break - name: Clickable filter: clickable - name: Clickable::Email filter: filter # set your repository path below: # #repos: # test: '/tmp/svnweb-test' # test2: '/tmp/svnweb-test2' # # or a parent path contains repositories # #reposparent: '/path/to/repositories' # # if you set a parent you can block specific repositories # like this: # #block: # - 'blocked1' # - 'blocked2' # END close $fh; open $fh, '>index.cgi'; print $fh <<"END"; $Config::Config{startperl} -w #use lib '.'; #use lib '../lib'; use CGI::Carp qw(fatalsToBrowser); use SVN::Web; SVN::Web::run_cgi(); END close $fh; chmod 0755,'index.cgi'; # XXX: export the template too print "SVN::Web now installed! please see config.yaml\n";
Did the code in my previous replies help? There's an updated svnweb-install at http://jc.ngo.org.uk/svnweb/jc/view/nik/CPAN/SVN-Web/trunk/bin/svnweb-install if you'd like to try that too. I'd appreciate feedback as to whether or not this fixes the problem for you. Thanks, N
From: DPAVLIN [...] cpan.org
On Mon Mar 06 08:12:55 2006, NIKC wrote: Show quoted text
> Did the code in my previous replies help?
Yes thanks. Sorry for long delay.
Thanks for confirming that I can close this ticket.