Michael G Schwern <[EMAIL PROTECTED]> writes:
>So a pretty common problem with the META.yml autogeneration is that
>people seem to put it into version control.  Normally I'd advise against
>this except *I* have it in version control for MakeMaker.
>
>I'm using CVS, so META.yml is still read-only, but some folks use VCs
>that make non-checked out files read-only.  RCS.  Perforce.  Aegis.
>
>Right now the 'metafile' target just pukes if it can't write to the file
>and NO_META isn't set.  This causes distdir to fail and thus 'make dist'.
>
>I'd like to put something in there which just warns if the file can't be
>altered.  Something along the lines of write the new file to META.yml.new
>and rename it.  If the rename fails, warn.
>
>Thoughts?

I have a bunch of generated files in Tk which are under version control
the perl scripts which generate them just 

chmod(0666,$file) unless -w $file;
open(my $fh,">$file") || die ... 

The 0666 thing is a Win32-ism - at one time at least all permissions
had to match (or which one it used was "wrong" or some such).

Then I need to remember to do a 

p4 diff -se ./... > e
p4 -x e edit

to "notice" file have changed.

It isn't perfect - the chmod won't do anything if you are not 
owner but it is probably better than a die.



Reply via email to