php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16017 rule_pear.mk continues cleanly even on failure
Submitted: 2002-03-12 07:51 UTC Modified: 2002-06-12 01:00 UTC
From: adconrad at 0c3 dot net Assigned:
Status: No Feedback Package: PEAR related
PHP Version: 4.1.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: adconrad at 0c3 dot net
New email:
PHP Version: OS:

 

 [2002-03-12 07:51 UTC] adconrad at 0c3 dot net
build/rules_pear.mk contains a contruct in the install-modules target whereby no matter what happens, the rule will always succeed.  From an autobuilding and packaging perspective (as in the case of Debian, for instance), this is horribly broken, as it could lead to empty packages, with no one the wiser.

The reason for the "|| true" was so that the rule wouldn't bomb out if there were no modules to install, however it causes the exact opposite problem instead (if there is are supposed to be modules, but they don't get built correctly, we continue on anyway).

What follows is a patch to change the behaviour so that we still carry on gracefully if there's no "modules" directory, but if there is one, we will die horribly if installing from it fails:

--------
--- rules_pear.mk       Tue Mar 13 10:54:38 2001
+++ rules_pear.mk.new   Tue Mar 12 05:45:22 2002
@@ -62,11 +62,12 @@
        @rm -f $(SUBDIRS) 2>/dev/null || true
 
 install-modules:
-       @test -d modules && \
+       if [ -d modules ]; then \
        $(mkinstalldirs) $(moduledir) && \
        echo "installing shared modules into $(moduledir)" && \
        rm -f modules/*.la && \
-       cp modules/* $(moduledir) || true
+       cp modules/* $(moduledir); \
+       fi
 
 include $(builddir)/.deps
-----------

... Adam Conrad
(the new Debian php4 maintainer)

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC