You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Maddes <ma...@arcor.de> on 2007/08/15 21:49:44 UTC

Re: [PATCH] check-mime-type.pl on Windows

Here's a new version of my patch:
1. The repository folder is now put in quotes too.
2. I was able to test the modified script successfully on Debian 4.0, so
it should be working for everybody with these changes.

Can someone please verify my result? - Thanks.


Also a correction to the batch file excerpt:
Please remove the quotes from the % arguments as Subversion already
provides quotes when there are white spaces in the names.


I recognized that an old draft of my first posting was send to this
list. Please ignore it and sorry for the inconvenience.


Regards
Matthias "Maddes" Bücher


On 15.08.2007 01:26, Maddes wrote:
> Hello everybody,
> 
> when you try to use check-mime-type.pl on Windows, you unfortunately get
> errors like "svnlook ... failed with no output".
> 
> By searching for similar errors I came across
> http://svn.haxx.se/users/archive-2004-04/1280.shtml
> which then led me to the following two pages
> http://perldoc.perl.org/perlport.html#Interprocess-Communication-(IPC)
> http://perldoc.perl.org/perlport.html#PLATFORMS
> 
> According to the PerlPort doc I see these script problems as a
> bug/shortcoming of those scripts.
> I would like to see that the most common hook scripts are written in an
> OS-independent way, or at least take care of OS-specialities like pipes.
> Subversion is a cross-platform Version Control System and not every new
> user is used to Perl/Python to adopt the scripts to their OS.
> 
> Maybe a standardized "safe_read_from_pipe" Perl sub can be developed,
> that works for all Subversion target systems.
> Does anyone agree on this? Or I'm the only one using hook scripts on
> Windows/Non-Unix/Non-Linux?
> 
> 
> As I do not want to only "complain" but also to contribute, I tried and
> was able to make the script work on my Windows XP SP2 with the
> information from the above URLs.
> The resulting patch is attached to this mail.
> 
> I hope that this patch can be tested on/reviewed for other OSes and get
> into the official script posted in the "Tools & Contrib" section.
> 
> 
> For the people interested in how to implement a this hook script on
> Windows [XP], here are the important lines of my pre-commit.bat for
> check-mime-type.pl:
> 
> set RC_ALL=0
> 
> ...
> 
> REM *** Check MIME types
> D:\Repositories\SVN\_Scripts\check-mime-type.pl "%1" "%2"
> if not errorlevel 1 goto check_mime_ok
> set /A RC_ALL+=1
> :check_mime_ok
> echo. 1>&2
> 
> ...
> 
> REM *** All checks done
> echo All checks done. RC=%RC_ALL% 1>&2
> 
> exit %RC_ALL%
> 
> 
> Regards
> Maddes