You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Peter Samuelson <pe...@p12n.org> on 2008/06/20 05:00:55 UTC

[PATCH] out-of-tree build, python bindings

[[[
* Makefile.in
  (copy-swig-py): Copy the SWIG-generated .py files from the build
    dir, not the source dir.  And don't bother copying __init__.py from
    the source dir, just 'touch' it.

Patch by: Peter Samuelson <pe...@p12n.org>
]]]

--- a/Makefile.in
+++ b/Makefile.in
@@ -680,7 +680,8 @@
 	mkdir $(SWIG_PY_DIR)/libsvn
 
 copy-swig-py: autogen-swig-py $(SWIG_PY_DIR)/libsvn
-	@cp -pf $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/libsvn
+	@cp -pf $(SWIG_PY_DIR)/*.py $(SWIG_PY_DIR)/libsvn
+	@touch $(SWIG_PY_DIR)/libsvn/__init__.py
 
 swig-py: autogen-swig-py copy-swig-py
 

Re: [PATCH] out-of-tree build, python bindings

Posted by Peter Samuelson <pe...@p12n.org>.
[Arfrever Frehtes Taifersar Arahesis]
> > -	@cp -pf $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/libsvn
> > +	@for f in $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/*.py; do \
> > +	  ! [ -f "$$f" ] || cp -pf "$$f" $(SWIG_PY_DIR)/libsvn; \
> 
> Wouldn't the following be better?:
> [ -f "$$f" ] && cp -pf "$$f" $(SWIG_PY_DIR)/libsvn; \

Yeah, except that then it sometimes returns false, and 'make' halts
with an error.
-- 
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] out-of-tree build, python bindings

Posted by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>.
2008-06-20 22:01:51 Peter Samuelson napisaƂ(a):
> 
> [David James]
> > Does your patch work if autogen.sh was run in release mode? I believe
> > that, if autogen.py was run in release mode, the SWIG-generated .py
> > files are in the source dir and included in the tarball.
> 
> Good point.  Try this one.  The [ -f "$$f" ] logic accounts for the
> shell passing literal "*.py" if the wildcard doesn't match anything.
> The negated test is to make sure the shell line as a whole returns true
> unless cp actually fails.
> 
> Also, I think you can 'svn rm subversion/bindings/swig/python/__init__.py'
> now.  It is not meaningful in its present location.
> 
> [[[
> * Makefile.in
>   (copy-swig-py): Copy .py files to bindings/swig/python/libsvn/ from
>     both source and build dirs.  Also ensure that __init__.py exists.
> 
> Patch by: Peter Samuelson <pe...@p12n.org>
> ]]]
> 
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -680,7 +680,10 @@
>  	mkdir $(SWIG_PY_DIR)/libsvn
>  
>  copy-swig-py: autogen-swig-py $(SWIG_PY_DIR)/libsvn
> -	@cp -pf $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/libsvn
> +	@for f in $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/*.py; do \
> +	  ! [ -f "$$f" ] || cp -pf "$$f" $(SWIG_PY_DIR)/libsvn; \

Wouldn't the following be better?:
[ -f "$$f" ] && cp -pf "$$f" $(SWIG_PY_DIR)/libsvn; \

-- 
Arfrever Frehtes Taifersar Arahesis

Re: [PATCH] out-of-tree build, python bindings

Posted by Peter Samuelson <pe...@p12n.org>.
[David James]
> I haven't tested your patch but it looks good to me.

r31908.
-- 
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/

Re: [PATCH] out-of-tree build, python bindings

Posted by David James <ja...@cs.toronto.edu>.
On Fri, Jun 20, 2008 at 1:01 PM, Peter Samuelson <pe...@p12n.org> wrote:
>
> [David James]
>> Does your patch work if autogen.sh was run in release mode? I believe
>> that, if autogen.py was run in release mode, the SWIG-generated .py
>> files are in the source dir and included in the tarball.
>
> Good point.  Try this one.  The [ -f "$$f" ] logic accounts for the
> shell passing literal "*.py" if the wildcard doesn't match anything.
> The negated test is to make sure the shell line as a whole returns true
> unless cp actually fails.
>
> Also, I think you can 'svn rm subversion/bindings/swig/python/__init__.py'
> now.  It is not meaningful in its present location.
>
> [[[
> * Makefile.in
>  (copy-swig-py): Copy .py files to bindings/swig/python/libsvn/ from
>    both source and build dirs.  Also ensure that __init__.py exists.
>
> Patch by: Peter Samuelson <pe...@p12n.org>
> ]]]
>
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -680,7 +680,10 @@
>        mkdir $(SWIG_PY_DIR)/libsvn
>
>  copy-swig-py: autogen-swig-py $(SWIG_PY_DIR)/libsvn
> -       @cp -pf $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/libsvn
> +       @for f in $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/*.py; do \
> +         ! [ -f "$$f" ] || cp -pf "$$f" $(SWIG_PY_DIR)/libsvn; \
> +       done
> +       @touch $(SWIG_PY_DIR)/libsvn/__init__.py

I haven't tested your patch but it looks good to me.

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] out-of-tree build, python bindings

Posted by Peter Samuelson <pe...@p12n.org>.
[David James]
> Does your patch work if autogen.sh was run in release mode? I believe
> that, if autogen.py was run in release mode, the SWIG-generated .py
> files are in the source dir and included in the tarball.

Good point.  Try this one.  The [ -f "$$f" ] logic accounts for the
shell passing literal "*.py" if the wildcard doesn't match anything.
The negated test is to make sure the shell line as a whole returns true
unless cp actually fails.

Also, I think you can 'svn rm subversion/bindings/swig/python/__init__.py'
now.  It is not meaningful in its present location.

[[[
* Makefile.in
  (copy-swig-py): Copy .py files to bindings/swig/python/libsvn/ from
    both source and build dirs.  Also ensure that __init__.py exists.

Patch by: Peter Samuelson <pe...@p12n.org>
]]]

--- a/Makefile.in
+++ b/Makefile.in
@@ -680,7 +680,10 @@
 	mkdir $(SWIG_PY_DIR)/libsvn
 
 copy-swig-py: autogen-swig-py $(SWIG_PY_DIR)/libsvn
-	@cp -pf $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/libsvn
+	@for f in $(SWIG_PY_SRC_DIR)/*.py $(SWIG_PY_DIR)/*.py; do \
+	  ! [ -f "$$f" ] || cp -pf "$$f" $(SWIG_PY_DIR)/libsvn; \
+	done
+	@touch $(SWIG_PY_DIR)/libsvn/__init__.py
 
 swig-py: autogen-swig-py copy-swig-py
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] out-of-tree build, python bindings

Posted by David James <ja...@cs.toronto.edu>.
On Thu, Jun 19, 2008 at 10:00 PM, Peter Samuelson <pe...@p12n.org> wrote:
> [[[
> * Makefile.in
>  (copy-swig-py): Copy the SWIG-generated .py files from the build
>    dir, not the source dir.  And don't bother copying __init__.py from
>    the source dir, just 'touch' it.
>
> Patch by: Peter Samuelson <pe...@p12n.org>
> ]]]

Does your patch work if autogen.sh was run in release mode? I believe
that, if autogen.py was run in release mode, the SWIG-generated .py
files are in the source dir and included in the tarball. When a user
runs the build process, copy-swig-py is supposed to copy the
SWIG-generated .py files from the source dir to the build dir.

Maybe copy-swig-py should try both locations (build dir first, then
source dir)? Or maybe there is a more elegant fix.

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org