Stas Bekman wrote:

>Randy Kobes wrote:
>  
>
>>But the port of apxs that I did does have an EXTRA_CPPFLAGS,
>>it's just that
>>   apxs -q EXTRA_CPPFLAGS
>>returns nothing. That's to be compared to, eg,
>>   apxs -q FOO_BAR
>>which gives an apxs error.
>>    
>>
>
>Yes, sorry Randy, you are right, it's the apxs() sub problem. It always 
>expects some value, and considers the empty value as a an error.
>
>May be this is a safe change:
>
>Index: lib/Apache/Build.pm
>===================================================================
>RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
>retrieving revision 1.160
>diff -u -r1.160 Build.pm
>--- lib/Apache/Build.pm 5 Apr 2004 21:45:08 -0000       1.160
>+++ lib/Apache/Build.pm 26 Apr 2004 18:19:43 -0000
>@@ -168,13 +168,13 @@
>      chomp $val if defined $val; # apxs post-2.0.40 adds a new line
>
>      unless ($val) {
>-        error "'$apxs @_' failed:";
>-
>+        # do we have an error or it's just an empty value?
>          if (my $error = qx($apxs @_ 2>&1)) {
>+            error "'$apxs @_' failed:";
>              error $error;
>          }
>          else {
>-            error 'unknown error';
>+            $val = '';
>          }
>      }
>
Didn't quite do the trick: $error needs to be chomp()'ed like $val 
itself was a line or two earlier, otherwise $error contains a newline 
and evaluates as "true".  This fixes it for me:

Index: lib/Apache/Build.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.160
diff -u -u -r1.160 Build.pm
--- lib/Apache/Build.pm 5 Apr 2004 21:45:08 -0000       1.160
+++ lib/Apache/Build.pm 27 Apr 2004 13:12:47 -0000
@@ -168,13 +168,15 @@
     chomp $val if defined $val; # apxs post-2.0.40 adds a new line

     unless ($val) {
-        error "'$apxs @_' failed:";
-
-        if (my $error = qx($apxs @_ 2>&1)) {
+        # do we have an error or is it just an empty value?
+        my $error = qx($apxs @_ 2>&1);
+        chomp $error if defined $error; # apxs post-2.0.40 adds a new line
+        if ($error) {
+            error "'$apxs @_' failed:";
             error $error;
         }
         else {
-            error 'unknown error';
+            $val = '';
         }
     }




------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only.  If you have received this 
message in error or there are any problems, please notify the sender immediately.  The 
unauthorized use, disclosure, copying or alteration of this message is strictly 
forbidden.  Note that any views or opinions presented in this email are solely those 
of the author and do not necessarily represent those of Radan Computational Ltd.  The 
recipient(s) of this message should check it and any attached files for viruses: Radan 
Computational will accept no liability for any damage caused by any virus transmitted 
by this email.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to