Subject: pkg/33870: obfuscated code in regarding X11_TYPE
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 06/30/2006 00:25:00
>Number:         33870
>Category:       pkg
>Synopsis:       obfuscated code in regarding X11_TYPE
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 30 00:25:00 +0000 2006
>Originator:     Christoph Badura
>Release:        NetBSD 3.0_STABLE
pkgsrc as of 2006-06-26
System: NetBSD limiting-factor 3.0_STABLE NetBSD 3.0_STABLE (GENERIC_LAPTOP) #7: Tue Jun 27 22:50:21 MEST 2006 bad@limiting-factor:/home/bad/c/GENERIC_LAPTOP i386
Architecture: i386
Machine: i386
.if ((defined(X11_TYPE) && !empty(X11_TYPE:MXFree86) || \
     defined(X11_TYPE) && !empty(X11_TYPE:Mxorg)) && \
     defined(X11_TYPE) && empty(X11_TYPE:Mnative))
X11BASE?=               ${LOCALBASE}/${X11ROOT_PREFIX}

Due to the repeated checks for X11_TYPE being defined and the indentiation
not reflecting the nesting level this is near unreadble.

Does the author really expect the value of X11_TYPE to change while evaluating
the expression? Or does he need to be told three times?
Simplify the expression.