On Friday, November 04, 2011 5:41 PM, "Jonathan Nieder" <jrnie...@gmail.com> 
wrote:
> With r1197804, I tried:
> 
>       svn export ~/src/subversion svn-test
>       cd svn-test
>       ./autogen.sh
>       mkdir BUILD
>       cd BUILD
>       ../configure --prefix=$HOME/opt/subversion
>       make extraclean-swig
> 
> The result:
> 
>       for d in /tmp/svn-test/BUILD/subversion/bindings/swig/python 
> /tmp/svn-test/BUILD/subversion/bindings/swig/python/libsvn_swig_py; \
>       do \
>         cd $d && rm -rf *.lo *.la *.o *.pyc .libs; \
>       done
>       /bin/sh: 3: cd: can't cd to 
> /tmp/svn-test/BUILD/subversion/bindings/swig/python
>       /bin/sh: 3: cd: can't cd to 
> /tmp/svn-test/BUILD/subversion/bindings/swig/python/libsvn_swig_py
>       make: *** [clean-swig-py] Error 2
> 
> The following patch fixes it for me.  What do you think?
> 
> [[[
> * configure.ac: In VPATH builds, create directories imitating the source
>     hierarchy under the build directory, so other parts of the build system
>     (like "make extraclean-swig") don't have to worry about directories not
>     existing.
> 
> Patch by: peters
> (Tweaked by me to avoid creating unnecessary .svn directories when building
> from an svn checkout.)
> ]]]
> 
> Index: configure.ac
> ===================================================================
> --- configure.ac      (revision 1197804)
> +++ configure.ac      (working copy)
> @@ -1374,6 +1374,15 @@
>  
>  AC_OUTPUT
>  
> +if test "$abs_srcdir" != "$abs_builddir"
> +then
> +  AC_MSG_NOTICE([Creating build directories])
> +  (
> +    cd "$abs_srcdir"
> +    find subversion tools contrib -name .svn -prune -o -type d -print
> +  ) | xargs $MKDIR

I disagree with the fix.

First, can you rely on xargs(1) in configure scripts?

Secondly, quoting issues.  '$MKDIR' needs to be quoted, and the xargs
will fail if someone does q[mkdir "subversion/ foo'bar"] in
"$abs_srcdir".  (The latter is somewhat of an edge case, but it'd be
nice not to have it IMO.)

And thirdly, with this fix 'make extraclean-swig; make extraclean-swig'
will still fail :-)

Perhaps then you'd resend a patch that fixes the bug differently?

> +fi
> +
>  # ==== Print final messages to user 
> ==========================================
>  
>  dnl Configure is long - users tend to miss warnings printed during it.
> 

Reply via email to