Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Mar 2006 17:37:11 +1100 (EST)
From:      Edwin Groothuis <edwin@mavetju.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/94675: [patch] bsd.port.mk - give reasons to ONLY_FOR_ARCH / NOT_FOR_ARCH
Message-ID:  <20060319063711.880B326E@k7.mavetju>
Resent-Message-ID: <200603190640.k2J6eC8i059400@freefall.freebsd.org>

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

>Number:         94675
>Category:       ports
>Synopsis:       [patch] bsd.port.mk - give reasons to ONLY_FOR_ARCH / NOT_FOR_ARCH
>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:   Sun Mar 19 06:40:12 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Edwin Groothuis
>Release:        FreeBSD 6.0-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 root@x64.samsco.home:/usr/obj/usr/src/sys/GENERIC i386


>Description:

During a brainstorm session with linimon@ (who was happily sipping
away his third beer), he mentioned that he wanted to have something
which gave the reason for NOT_FOR_ARCHS and ONLY_FOR_ARCHS.

Hereby the patch to add the following keywords:

	ONLY_FOR_ARCHS_REASON
	ONLY_FOR_ARCHS_REASON_${ARCH}
	NOT_FOR_ARCHS_REASON
	NOT_FOR_ARCHS_REASON_${ARCH}

Examples:

	ONLY_FOR_ARCHS= z80 
	ONLY_FOR_ARCHS_REASON_i386=     It does not exist yet.
	ONLY_FOR_ARCHS_REASON_amd64=    What are 64 bits?

	[~/cvs/ports/net/bbsnet] edwin@k7>ARCH=z80 make checksum
	===>  Vulnerability check disabled, database not found
	=> MD5 Checksum OK for bbsnet-2.8.tar.gz.
	=> SHA256 Checksum OK for bbsnet-2.8.tar.gz.
	[~/cvs/ports/net/bbsnet] edwin@k7>ARCH=i386 make checksum
	===>  bbsnet-2.8 is only for z80, and you are running i386. Reason: It does not exist yet.
	*** Error code 1

	Stop in /usr/home/edwin/cvs/ports/net/bbsnet.
	[~/cvs/ports/net/bbsnet] edwin@k7>ARCH=amd64 make checksum
	===>  bbsnet-2.8 is only for z80, and you are running amd64. Reason: What are 64 bits?.

Same story with NOT_FOR_ARCHS.

>How-To-Repeat:
>Fix:

--- bsd.port.mk.orig	Sun Mar 19 17:18:28 2006
+++ bsd.port.mk	Sun Mar 19 17:29:42 2006
@@ -207,6 +207,12 @@
 # ONLY_FOR_ARCHS
 #				- Only build ports if ${ARCH} matches one of these.
 # NOT_FOR_ARCHS	- Only build ports if ${ARCH} doesn't match one of these.
+# ONLY_FOR_ARCHS_REASON
+# ONLY_FOR_ARCHS_REASON_${ARCH}
+#				- Reason why it's only for ${ONLY_FOR_ARCHS}s
+# NOT_FOR_ARCHS_REASON
+# NOT_FOR_ARCHS_REASON_${ARCH}
+#				- Reason why it's not for ${NOT_FOR_ARCHS}s
 #
 # Dependency checking.  Use these if your port requires another port
 # not in the list below.  (Default: empty.)
@@ -2799,6 +2805,7 @@
 # Don't build a port if the system is too old.
 ################################################################
 
+# Check the machine architectures
 .if defined(ONLY_FOR_ARCHS)
 .for __ARCH in ${ONLY_FOR_ARCHS}
 .if ${ARCH:M${__ARCH}} != ""
@@ -2821,11 +2828,25 @@
 .if defined(ONLY_FOR_ARCHS)
 IGNORE=		is only for ${ONLY_FOR_ARCHS},
 .else # defined(NOT_FOR_ARCHS)
-IGNORE=		does not run on ${NOT_FOR_ARCHS},
+IGNORE=		does not run on ${NOT_FOR_ARCHS}.
 .endif
-IGNORE+=	and you are running ${ARCH}
+IGNORE+=	and you are running ${ARCH}.
+
+.if defined(ONLY_FOR_ARCHS_REASON_${ARCH})
+IGNORE+=	Reason: ${ONLY_FOR_ARCHS_REASON_${ARCH}}
+.elif defined(ONLY_FOR_ARCHS_REASON)
+IGNORE+=	Reason: ${ONLY_FOR_ARCHS_REASON}
+.endif
+
+.if defined(NOT_FOR_ARCHS_REASON_${ARCH})
+IGNORE+=	Reason: ${NOT_FOR_ARCHS_REASON_${ARCH}}
+.elif defined(NOT_FOR_ARCHS_REASON)
+IGNORE+=	Reason: ${NOT_FOR_ARCHS_REASON}
+.endif
+
 .endif
 
+# Check the user interaction and legal issues
 .if !defined(NO_IGNORE)
 .if (defined(IS_INTERACTIVE) && defined(BATCH))
 IGNORE=	is an interactive port

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



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