ports/86573: [patch] bsd.port.mk - Add check-broken target

ringworm01 at gmail.com ringworm01 at gmail.com
Mon Sep 26 02:50:17 UTC 2005


>Number:         86573
>Category:       ports
>Synopsis:       [patch] bsd.port.mk - Add check-broken target
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 26 02:50:15 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Michael C. Shultz
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD ringworm.mechee.com 5.4-STABLE FreeBSD 5.4-STABLE #0: Fri Sep 23 23:11:01 PDT 2005 root at ringworm.mechee.com:/usr5/obj/usr5/src/sys/RINGWORM5 i386


>Description:

        If Make is run from a shell and a port is marked broken, make will not return an error code. sysutils/portmanager
        uses make targets to update ports, when it runs "make" and a port is marked broken portmanager has no way of
        knowing something went wrong and results in the previous installed port being removed.

        By adding a simple target "check-broken" to bsd.port.mk that returns error code 1 when "make check-broken"  is run
        will provide a simple way for portmanager and other utilities to check the status of ports without having to parse 
	port Makefiles.

        The attached patch should effect nothing in the ports system, it just provides a simple way to determine if
        "BROKEN" has been defined in a given port's Makefile.

        I have very little experience with scripting languages so please look the patch over carefully before committing
        this.

        Pav Lucistnik pav at FreeBSD.org suggested using something like "make -V BROKEN", while that could work it is awkward to
        code in C.  The output of "make -V BROKEN" would have to be read into a buffer then parsing the buffer for a result,
        It really is much simpler to just check the return code after running "make check-conflicts".

	ref:
        http://lists.freebsd.org/pipermail/freebsd-ports/2005-September/026069.html

        Just a comment:  If a port fails to build for any reason after running make I think an error code should be ruturned.  It
        is beyond my ability to make this level of a fix however.

>How-To-Repeat:

	Run a port that is marked broken from a shell, see that no error code is returned.
	Put a known conflict in a port's Makefile then run "make check-conflicts" from
	s shell, notice it will return error code 1.

>Fix:


--- bsd.port.mk.patch begins here ---
--- bsd.port.mk	Thu Sep 15 05:24:33 2005
+++ /home/mike/work/bsd.port.mk	Sun Sep 25 17:38:20 2005
@@ -3406,6 +3406,16 @@
 .endif  # CONFLICTS
 .endif
 
+.if !target(check-broken)
+check-broken:
+.if defined(BROKEN)
+	${ECHO_MSG}; \
+	${ECHO_MSG} "====> ${PKGNAME} marked broken"; \
+	exit 1
+.endif
+.endif
+
+
 # Install
 
 .if !target(do-install)
--- bsd.port.mk.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list