ports/98891: [PATCH] bsd.port.mk: Fix DESKTOP_ENTRIES processing on 4.x

Shaun Amott shaun at inerd.com
Tue Jun 13 01:40:22 UTC 2006


>Number:         98891
>Category:       ports
>Synopsis:       [PATCH] bsd.port.mk: Fix DESKTOP_ENTRIES processing on 4.x
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 13 01:40:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Shaun Amott
>Release:        FreeBSD 6.1-STABLE i386
>Organization:
>Environment:

>Description:

There is some sh(1) code in bsd.port.mk that processes DESKTOP_ENTRIES -
unfortunately, it doesn't seem to work on 4.x[1]

The patch below uses replaces the use of built-in sh arithmatic code
with expr(1) - this fixes the problem on 4.x, and also still works on
later OS versions.

[1] Example of a broken port:
    http://pointyhat.freebsd.org/errorlogs/i386-errorlogs/e.4.2005092302/blobandconquer-0.1.1.log

>How-To-Repeat:

>Fix:

	

--- bsd.port.mk.diff begins here ---
Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.533
diff -u -r1.533 bsd.port.mk
--- bsd.port.mk	23 May 2006 21:53:18 -0000	1.533
+++ bsd.port.mk	13 Jun 2006 01:25:37 -0000
@@ -5480,7 +5480,7 @@
 check-desktop-entries:
 .if defined(DESKTOP_ENTRIES)
 	@set ${DESKTOP_ENTRIES} XXX; \
-	if [ $$((($$# - 1) % 6)) -ne 0 ]; then \
+	if [ `${EXPR} \( $$# - 1 \) % 6` -ne 0 ]; then \
 		${ECHO_CMD} "${PKGNAME}: Makefile error: the DESKTOP_ENTRIES list must contain one or more groups of 6 elements"; \
 		exit 1; \
 	fi; \
@@ -5526,7 +5526,7 @@
 			exit 1; \
 		fi; \
 		shift 6; \
-		num=$$((num + 1)); \
+		num=`${EXPR} $$num + 1`; \
 	done
 .else
 	@${DO_NADA}
--- bsd.port.mk.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list