pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Simplify the check for whether we need a patch tool...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b0580c53b5d3
branches:  trunk
changeset: 493758:b0580c53b5d3
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sat May 14 04:26:15 2005 +0000

description:
Simplify the check for whether we need a patch tool or not -- we simply
check for whether ${PATCHDIR} exists or not, or whether PATCHFILES is
defined or not.  This avoids the use of != in a variable definition
just to find out if we need patch or not.

diffstat:

 mk/bsd.pkg.mk |  21 +++------------------
 1 files changed, 3 insertions(+), 18 deletions(-)

diffs (35 lines):

diff -r 056bf63f3c94 -r b0580c53b5d3 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sat May 14 03:30:56 2005 +0000
+++ b/mk/bsd.pkg.mk     Sat May 14 04:26:15 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1647 2005/05/14 02:03:00 rillig Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1648 2005/05/14 04:26:15 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -446,23 +446,8 @@
 
 TOUCH_FLAGS?=          -f
 
-.if !defined(_PKGSRC_USE_PATCH)
-.  if defined(PATCHFILES) && !empty(PATCHFILES)
-_PKGSRC_USE_PATCH=     yes
-.  elif !exists(${PATCHDIR})
-_PKGSRC_USE_PATCH=     no
-.  else
-_PKGSRC_USE_PATCH!=    \
-       if ${TEST} "`${ECHO} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*"; then \
-               ${ECHO} yes;                                    \
-       else                                                    \
-               ${ECHO} no;                                     \
-       fi
-.  endif
-.endif
-MAKEVARS+=     _PKGSRC_USE_PATCH
-
-.if !empty(_PKGSRC_USE_PATCH:M[yY][eE][sS])
+.if (defined(PATCHFILES) && !empty(PATCHFILES)) || \
+    (defined(PATCHDIR) && exists(${PATCHDIR}))
 .  if empty(_USE_NEW_TOOLS:M[yY][eE][sS])
 USE_GNU_TOOLS+=                patch
 .  else



Home | Main Index | Thread Index | Old Index