Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2004 01:53:55 +0100 (CET)
From:      Dag-Erling Smørgrav <des@des.no>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/61855: [PATCH] cosmetic fixes for bsd.ports.mk
Message-ID:  <20040125005355.57A4C33C9A@dwp.des.no>
Resent-Message-ID: <200401250100.i0P10D2F065619@freefall.freebsd.org>

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

>Number:         61855
>Category:       ports
>Synopsis:       [PATCH] cosmetic fixes for bsd.ports.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 24 17:00:13 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dag-Erling Smørgrav
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD dwp.des.no 5.2-CURRENT FreeBSD 5.2-CURRENT #22: Sat Jan 24 20:11:54 CET 2004 des@dwp.des.no:/usr/obj/usr/src/sys/dwp_smp i386

ports-current

>Description:

bsd.ports.mk makes repeated use of `id -n` despite the fact that it
defines a variable (${UID}) to hold this value.

at least one line starts with spaces instead of tabs

>How-To-Repeat:

n/a

>Fix:

apply attached patch.

--- ports-misc.diff begins here ---
Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.483
diff -u -r1.483 bsd.port.mk
--- Mk/bsd.port.mk	24 Jan 2004 01:26:30 -0000	1.483
+++ Mk/bsd.port.mk	25 Jan 2004 00:50:24 -0000
@@ -3125,7 +3125,7 @@
 		fi \
 	done
 .if !defined(EXTRACT_PRESERVE_OWNERSHIP)
-	@if [ `id -u` = 0 ]; then \
+	@if [ ${UID} -eq 0 ]; then \
 		${CHMOD} -R ug-s ${WRKDIR}; \
 		${CHOWN} -R 0:0 ${WRKDIR}; \
 	fi
@@ -3462,7 +3462,7 @@
 .if !target(install-mtree)
 install-mtree:
 	@${MKDIR} ${PREFIX}
-	@if [ `id -u` != 0 ]; then \
+	@if [ ${UID} -ne 0 ]; then \
 		if [ -w ${PREFIX}/ ]; then \
 			${ECHO_MSG} "Warning: not superuser, you may get some errors during installation."; \
 		else \
@@ -3471,7 +3471,7 @@
 		fi; \
 	fi
 .if !defined(NO_MTREE)
-	@if [ `id -u` = 0 ]; then \
+	@if [ ${UID} -eq 0 ]; then \
 		if [ ! -f ${MTREE_FILE} ]; then \
 			${ECHO_CMD} "Error: mtree file \"${MTREE_FILE}\" is missing."; \
 			${ECHO_CMD} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
@@ -4145,7 +4145,7 @@
 			  	      OK="true"; \
 			  	  fi; \
 			  fi; \
-			fi ; \
+		  fi ; \
 		  if [ "$$OK" != "true" -a ${FETCH_REGET} -eq 0 ]; then \
 			  ${ECHO_MSG} "===>  Giving up on fetching files: $$refetchlist"; \
 			  ${ECHO_MSG} "Make sure the Makefile and distinfo file (${MD5_FILE})"; \
--- ports-misc.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?20040125005355.57A4C33C9A>