You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Daniel Quinlan <qu...@pathname.com> on 2005/02/10 03:31:43 UTC

Re: svn commit: r153131 - in spamassassin/trunk: Makefile.PL build/do

> bug 4124: implemented a symlink-safe copy routine for Makefile.PL to
> make the spamassassin->sa-filter stuff possible

This patch is really complicated.

>          'spamc/spamc$(EXE_EXT)', # must next to last one
>          'spamd/spamd',	# must be the last one

those comments really need to be explained

> 	$(PERL) -MFile::Copy -e 'chdir q{$(INSTALLSITEBIN)}; $$symlink_exists =
>  eval { symlink("",""); 1 }; if ($$symlink_exists) { symlink(q{sa-filter},
> q{spamassassin}); } else { copy(q{sa-filter}, q{spamassassin}); }'

The ability to fallback to copy if symlink is not supported needs to be
preserved for Windows, etc.  perldoc -f symlink

> +my($cmd, $src, $tgt, $lnk) =3D @ARGV;

If this intended to be generic for additional commands or just
copy/move/link?  Does it handle multiple sources?  You might want to
call it "symlink" for clarity.

> +  symlink($lnk, $tgt) || die "Can't link '$lnk' to '$tgt': $!\n";

This needs to gracefully fail on systems not supporting symlink.  Use
the above eval trick.  You can even do a const to avoid dying.

  use const SYMLINK_EXISTS => eval { symlink("",""); 1 };

Daniel

-- 
Daniel Quinlan
http://www.pathname.com/~quinlan/

Re: svn commit: r153131 - in spamassassin/trunk: Makefile.PL build/do

Posted by "Malte S. Stretz" <ms...@gmx.net>.
On Thursday 10 February 2005 22:31 CET Daniel Quinlan wrote:
> Hmmm... the symbolic link is created in the SVN tree during "make", but
> does not get copied over during "make install" (which is really the only
> place it's needed, there's no need for the symlink in the SVN tree,
> really).

*gnah* You're right.  I didn't test 'make install', just made sure the 
symlink is kept while the stuff is copied to blib.  The install step is 
done by ExtUtils::MakeMaker::Install and I had a look at the source and am 
afraid its simply impossible to install symlinks :-(  At least without 
rewriting most of EU::MM in our Makefile.PL.

I'm currently experimenting with Module::Build and that looks much more 
promising.  I hope I can replace the Makefile.PL mess in March, probably 
for 3.2 I guess.  That will cost us an additional build time dependency but 
I think its worth it.

I guess for now the scipt-exec-wrapper is the easier solution -- why didn't 
Justin like the FindBin solution?

Cheers,
Malte

-- 
[SGT] Simon G. Tatham: "How to Report Bugs Effectively"
      <http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
[ESR] Eric S. Raymond: "How To Ask Questions The Smart Way"
      <http://www.catb.org/~esr/faqs/smart-questions.html>

Re: svn commit: r153131 - in spamassassin/trunk: Makefile.PL build/do

Posted by Daniel Quinlan <qu...@pathname.com>.
Hmmm... the symbolic link is created in the SVN tree during "make", but
does not get copied over during "make install" (which is really the only
place it's needed, there's no need for the symlink in the SVN tree,
really).

Daniel

-- 
Daniel Quinlan
http://www.pathname.com/~quinlan/

Re: svn commit: r153131 - in spamassassin/trunk: Makefile.PL build/do

Posted by "Malte S. Stretz" <ms...@gmx.net>.
On Thursday 10 February 2005 03:31 CET Daniel Quinlan wrote:
> > bug 4124: implemented a symlink-safe copy routine for Makefile.PL to
> > make the spamassassin->sa-filter stuff possible
>
> This patch is really complicated.

Yeah, but everything EU::MM related is unfortunately complicated :-/

> >          'spamc/spamc$(EXE_EXT)', # must next to last one
> >          'spamd/spamd', # must be the last one
>
> those comments really need to be explained

It is for the Windows build to make it possible to remove those apps when 
they should not be build.  I'll replace it with a hash which will make it 
more obvious.

> >  $(PERL) -MFile::Copy -e 'chdir q{$(INSTALLSITEBIN)}; $$symlink_exists
> > = eval { symlink("",""); 1 }; if ($$symlink_exists) {
> > symlink(q{sa-filter}, q{spamassassin}); } else { copy(q{sa-filter},
> > q{spamassassin}); }'
>
> The ability to fallback to copy if symlink is not supported needs to be
> preserved for Windows, etc.  perldoc -f symlink

perldoc -f readlink :)  But I'll add a few comments.

> > +my($cmd, $src, $tgt, $lnk) =3D @ARGV;
>
> If this intended to be generic for additional commands or just
> copy/move/link?  Does it handle multiple sources?  You might want to
> call it "symlink" for clarity.

I guess its only needed for move/copy/link I can't think of any command 
which we'd need on top (even move isn't really needed but it was trivial to 
implement).

> > +  symlink($lnk, $tgt) || die "Can't link '$lnk' to '$tgt': $!\n";
>
> This needs to gracefully fail on systems not supporting symlink.  Use
> the above eval trick.  You can even do a const to avoid dying.
>
>   use const SYMLINK_EXISTS => eval { symlink("",""); 1 };

perldoc -f readlink

Cheers,
Malte

-- 
[SGT] Simon G. Tatham: "How to Report Bugs Effectively"
      <http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
[ESR] Eric S. Raymond: "How To Ask Questions The Smart Way"
      <http://www.catb.org/~esr/faqs/smart-questions.html>