You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/10/07 13:29:52 UTC

svn commit: r822670 - /httpd/mod_fcgid/trunk/Makefile.apxs

Author: trawick
Date: Wed Oct  7 11:29:52 2009
New Revision: 822670

URL: http://svn.apache.org/viewvc?rev=822670&view=rev
Log:
fix make install syntax error on at least OpenSolaris and Linux

Modified:
    httpd/mod_fcgid/trunk/Makefile.apxs

Modified: httpd/mod_fcgid/trunk/Makefile.apxs
URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/Makefile.apxs?rev=822670&r1=822669&r2=822670&view=diff
==============================================================================
--- httpd/mod_fcgid/trunk/Makefile.apxs (original)
+++ httpd/mod_fcgid/trunk/Makefile.apxs Wed Oct  7 11:29:52 2009
@@ -42,14 +42,14 @@
 	@$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir) \
 			  $(DESTDIR)$(exp_sysconfdir)/original
 	for i in $(DESTDIR)$(httpd_conffile) $(DESTDIR)$(httpd_origconffile); do \
-	    if test -f $$i; then (
+	    if test -f $$i; then \
 		awk -f $(fcgid_srcdir)/build/addloadexample.awk \
 		    -v MODULE=fcgid -v DSO=.so -v LIBPATH=$(rel_libexecdir) \
 		    -v EXAMPLECONF=$(rel_sysconfdir)/extra/httpd-fcgid.conf \
 		    $$i > $$i.new && \
-		mv $$i $$i.bak && mv $$i.new $$i \
-	) \
-	fi;
+		mv $$i $$i.bak && mv $$i.new $$i; \
+	    fi; \
+	done 
 
 install-conf-unused:
 	@$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir)/extra \



Re: svn commit: r822670 - /httpd/mod_fcgid/trunk/Makefile.apxs

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jeff Trawick wrote:
> 
> I guess this is what you're looking for?

Thanks Jeff, that works for me.

Re: svn commit: r822670 - /httpd/mod_fcgid/trunk/Makefile.apxs

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Oct 7, 2009 at 8:26 AM, William A. Rowe, Jr.
<wr...@rowe-clan.net> wrote:
> Jeff Trawick wrote:
>> On Wed, Oct 7, 2009 at 8:04 AM, William A. Rowe, Jr.
>> <wr...@rowe-clan.net> wrote:
>>> Jeff Trawick wrote:
>>>> As far as repairing, I switched to the syntax used elsewhere in the
>>>> makefile.  But I'll try the other syntax very shortly.
>>> IIRC that syntax was selected to avert the makefile from aborting in case of failure.
>>
>> Is this a valid test?  (sorry, in the middle of getting the 10 YO off to school)
>
> We don't want the non-valid result code to kill the build in this case.  The && syntax
> takes care of avoiding further complications, and it should just plug on.
>

Let me play stupid here...

The && syntax says don't rename files (.bak, .new) unless the edit worked.
It won't just plug on because () doesn't ignore errors.

Simple example, with proper syntax:

$ cat Makefile

all:
	for i in .bashrc .emacs; do \
	    echo $$i; \
	    if test -f $$i; then ( \
		cp $$i /tmp/a/b/c && true; \
	    ) fi; \
	done

$ make
for i in .bashrc .emacs; do \
    echo $i; \
    if test -f $i; then ( \
	cp $i /tmp/a/b/c; \
    ) fi; \
done
.bashrc
cp: cannot create regular file `/tmp/a/b/c': No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `all'

I guess this is what you're looking for?

$ cat Makefile2

all:
	for i in .bashrc .emacs; do \
	    echo $$i; \
	    if test -f $$i; then \
		(cp $$i /tmp/a/b/c && ls /tmp/a/b/c) || true; \
	    fi; \
	done

$ make -f Makefile2
for i in .bashrc .emacs; do \
    echo $i; \
    if test -f $i; then \
	(cp $i /tmp/a/b/c && ls /tmp/a/b/c) || true; \
    fi; \
done
.bashrc
cp: cannot create regular file `/tmp/a/b/c': No such file or directory
.emacs
cp: cannot create regular file `/tmp/a/b/c': No such file or directory
$ echo $?
0

Re: svn commit: r822670 - /httpd/mod_fcgid/trunk/Makefile.apxs

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jeff Trawick wrote:
> On Wed, Oct 7, 2009 at 8:04 AM, William A. Rowe, Jr.
> <wr...@rowe-clan.net> wrote:
>> Jeff Trawick wrote:
>>> As far as repairing, I switched to the syntax used elsewhere in the
>>> makefile.  But I'll try the other syntax very shortly.
>> IIRC that syntax was selected to avert the makefile from aborting in case of failure.
> 
> Is this a valid test?  (sorry, in the middle of getting the 10 YO off to school)

We don't want the non-valid result code to kill the build in this case.  The && syntax
takes care of avoiding further complications, and it should just plug on.

Re: svn commit: r822670 - /httpd/mod_fcgid/trunk/Makefile.apxs

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Oct 7, 2009 at 8:04 AM, William A. Rowe, Jr.
<wr...@rowe-clan.net> wrote:
> Jeff Trawick wrote:
>>
>> As far as repairing, I switched to the syntax used elsewhere in the
>> makefile.  But I'll try the other syntax very shortly.
>
> IIRC that syntax was selected to avert the makefile from aborting in case of failure.

Is this a valid test?  (sorry, in the middle of getting the 10 YO off to school)

$ if test -f Makefile.apxs; then ls /not/home; fi
ls: cannot access /not/home: No such file or directory
$ echo $?
2
$ if test -f Makefile.apxs; then ( ls /not/home ); fi
ls: cannot access /not/home: No such file or directory
$ echo $?
2

>
> As it now stands, we check the file existence.  But that doesn't mean this can't
> fail due to permissions, etc.
>

Re: svn commit: r822670 - /httpd/mod_fcgid/trunk/Makefile.apxs

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jeff Trawick wrote:
> 
> As far as repairing, I switched to the syntax used elsewhere in the
> makefile.  But I'll try the other syntax very shortly.

IIRC that syntax was selected to avert the makefile from aborting in case of failure.

As it now stands, we check the file existence.  But that doesn't mean this can't
fail due to permissions, etc.

Re: svn commit: r822670 - /httpd/mod_fcgid/trunk/Makefile.apxs

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Oct 7, 2009 at 7:45 AM, William A. Rowe, Jr.
<wr...@rowe-clan.net> wrote:
> trawick@apache.org wrote:
>> Author: trawick
>> Date: Wed Oct  7 11:29:52 2009
>> New Revision: 822670
>>
>> URL: http://svn.apache.org/viewvc?rev=822670&view=rev
>> Log:
>> fix make install syntax error on at least OpenSolaris and Linux
>>
>> Modified:
>>     httpd/mod_fcgid/trunk/Makefile.apxs
>>
>> Modified: httpd/mod_fcgid/trunk/Makefile.apxs
>> URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/Makefile.apxs?rev=822670&r1=822669&r2=822670&view=diff
>> ==============================================================================
>> --- httpd/mod_fcgid/trunk/Makefile.apxs (original)
>> +++ httpd/mod_fcgid/trunk/Makefile.apxs Wed Oct  7 11:29:52 2009
>> @@ -42,14 +42,14 @@
>>       @$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir) \
>>                         $(DESTDIR)$(exp_sysconfdir)/original
>>       for i in $(DESTDIR)$(httpd_conffile) $(DESTDIR)$(httpd_origconffile); do \
>> -         if test -f $$i; then (
>> +         if test -f $$i; then \
>
> Wasn't this a simple matter of the missing trailing backslash on the line above?

As far as repairing, I switched to the syntax used elsewhere in the
makefile.  But I'll try the other syntax very shortly.

Re: svn commit: r822670 - /httpd/mod_fcgid/trunk/Makefile.apxs

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
trawick@apache.org wrote:
> Author: trawick
> Date: Wed Oct  7 11:29:52 2009
> New Revision: 822670
> 
> URL: http://svn.apache.org/viewvc?rev=822670&view=rev
> Log:
> fix make install syntax error on at least OpenSolaris and Linux
> 
> Modified:
>     httpd/mod_fcgid/trunk/Makefile.apxs
> 
> Modified: httpd/mod_fcgid/trunk/Makefile.apxs
> URL: http://svn.apache.org/viewvc/httpd/mod_fcgid/trunk/Makefile.apxs?rev=822670&r1=822669&r2=822670&view=diff
> ==============================================================================
> --- httpd/mod_fcgid/trunk/Makefile.apxs (original)
> +++ httpd/mod_fcgid/trunk/Makefile.apxs Wed Oct  7 11:29:52 2009
> @@ -42,14 +42,14 @@
>  	@$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir) \
>  			  $(DESTDIR)$(exp_sysconfdir)/original
>  	for i in $(DESTDIR)$(httpd_conffile) $(DESTDIR)$(httpd_origconffile); do \
> -	    if test -f $$i; then (
> +	    if test -f $$i; then \

Wasn't this a simple matter of the missing trailing backslash on the line above?

>  		awk -f $(fcgid_srcdir)/build/addloadexample.awk \
>  		    -v MODULE=fcgid -v DSO=.so -v LIBPATH=$(rel_libexecdir) \
>  		    -v EXAMPLECONF=$(rel_sysconfdir)/extra/httpd-fcgid.conf \
>  		    $$i > $$i.new && \
> -		mv $$i $$i.bak && mv $$i.new $$i \
> -	) \
> -	fi;
> +		mv $$i $$i.bak && mv $$i.new $$i; \
> +	    fi; \
> +	done 
>  
>  install-conf-unused:
>  	@$(MKINSTALLDIRS) $(DESTDIR)$(exp_sysconfdir)/extra \
> 
> 
> 
>