info-cvs
[Top][All Lists]
Advanced

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

Re: Processing hooks


From: Mark D. Baushke
Subject: Re: Processing hooks
Date: Wed, 09 Aug 2006 03:08:17 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Inder <address@hidden> writes:

> 
> I'm using CVS to store/distribute a perl web/CGI application.  
> 
> Trick is, I want it to run on both Windows and Unix servers, which
> have the perl binaries in different places.  
> 
> So I want to change the "#!" lines.  
> 
> OK, so I could write some kind of simple substitution program.
> 
> But is there a way to get cvs itself to do (something like) this?  To
> process files as they are checked in and out?
> 
> Failing that, is there a "standard" way to go about it?

Well, this is somewhat off-topic for a CVS group...

I often see perl scripts start with this kind of invokation

: # -*-Perl-*-
eval 'exec perl -S "$0" ${1+"$@"}'
     if 0;

This assumes that the perl executable is to be found in the user's path.

Other possibilities include:

: # -*-Perl-*-
eval 'for p in /path/to/perl /other/path/to/perl; do
      [ -x $p ] && exec $p -S "$0" ${1+"$@"}; done; 
      echo unable to find perl; exit 1'
     if 0;

The cute thing is that the eval could be any shell script that can find
the perl version you want or need.

The final method would be to do something like this:

: # -*-Perl-*-
eval 'exec $CVSROOT/CVSROOT/perl -S "$0" ${1+"$@"}'
     if 0;

and make sure that the $CVSROOT/CVSROOT/perl script is a wrapper script
or program that will eventually run the correct version of perl for you.

        Enjoy!
        -- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQFE2bQRCg7APGsDnFERAt+PAKCxPqOuKPdlnkUnlaYYCffThWfbmgCgp9Cj
z9NRJvZibJqmJCzSPvdX5TU=
=DF1X
-----END PGP SIGNATURE-----




reply via email to

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