Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jun 2006 02:35:03 +0100
From:      Shaun Amott <shaun@inerd.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/98891: [PATCH] bsd.port.mk: Fix DESKTOP_ENTRIES processing on 4.x
Message-ID:  <1150162503.74013@charon.picobyte.net>
Resent-Message-ID: <200606130140.k5D1eKU4071784@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1150162503.74013>