svn commit: r376710 - head/lang/fpc

John Marino marino at FreeBSD.org
Sat Jan 10 14:41:55 UTC 2015


Author: marino
Date: Sat Jan 10 14:41:53 2015
New Revision: 376710
URL: https://svnweb.freebsd.org/changeset/ports/376710
QAT: https://qat.redports.org/buildarchive/r376710/

Log:
  lang/fpc: Remove unnecessarily variable substition and EXTRACT_SUFX
  
  There were several substitions like "${XXX:S/$/.something/} which is the
  equivalent of appending, e.g. "${XXX}.something".
  
  So for the sake of comprehension, change these to appends, and also just
  hardcode ".tar.gz" instead of using ${EXTRACT_SUFX} for the same reason.
  Since the distfiles are being manually defined, there's no real purpose
  to have a variable in the name, and if the EXTRACT_SUFX changes for any
  reason (say a new distfile with a different suffix requiring USES+=tar),
  then the code actually breaks.  These changes make the code easier to
  read, comprehend, and arguably makes the port more robust.

Modified:
  head/lang/fpc/Makefile

Modified: head/lang/fpc/Makefile
==============================================================================
--- head/lang/fpc/Makefile	Sat Jan 10 14:39:42 2015	(r376709)
+++ head/lang/fpc/Makefile	Sat Jan 10 14:41:53 2015	(r376710)
@@ -15,7 +15,7 @@ MASTER_SITES=	ftp://ftp.freepascal.org/p
 		SF/freepascal/Source/${PORTVERSION}:source \
 		LOCAL/acm/freepascal/:bootstrap \
 		LOCAL/acm/freepascal/:man
-DISTFILES=	${DISTNAME:S/$/.source/}${EXTRACT_SUFX}:source
+DISTFILES=	${DISTNAME}.source.tar.gz:source
 DIST_SUBDIR=	freepascal
 
 MAINTAINER?=	freebsd-fpc at FreeBSD.org
@@ -57,8 +57,8 @@ SUB_FILES=	pkg-message
 BUILDNAME=	${FPC_ARCH}-${OPSYS:tl}
 PLIST_SUB+=	PORTVERSION=${PORTVERSION} \
 		BUILDNAME=${BUILDNAME}
-DISTFILES+=	${BOOTDIR}${EXTRACT_SUFX}:${OPSYS:MDragonFly}bootstrap \
-		${DISTNAME:S/$/.man/}${EXTRACT_SUFX}:man
+DISTFILES+=	${BOOTDIR}.tar.gz:${OPSYS:MDragonFly}bootstrap \
+		${DISTNAME}.man.tar.gz:man
 MAKE_ARGS+=	FPCMAKE=${WRKDIR}/${FPCSRCDIR}/utils/fpcm/fpcmake \
 		FPCTARGET=${BUILDNAME} \
 		ARCH=${FPC_ARCH} \
@@ -73,14 +73,13 @@ BOOTPPC=	PP=${WRKDIR}/${BOOTDIR}
 do-extract:
 # unpack binary distribution
 	@${MKDIR} ${WRKDIR}
-	@${TAR} -xzf ${_DISTDIR}/${BOOTDIR}${EXTRACT_SUFX} \
+	@${TAR} -xzf ${_DISTDIR}/${BOOTDIR}.tar.gz \
 		--directory ${WRKDIR} && ${CHMOD} +x ${WRKDIR}/${BOOTDIR}
 # unpack man files
-	@${TAR} -xzf ${_DISTDIR}/${DISTNAME:S/$/.man/}${EXTRACT_SUFX} \
-		--directory ${WRKDIR}
+	@${TAR} -xzf ${_DISTDIR}/${DISTNAME}.man.tar.gz --directory ${WRKDIR}
 # unpack source distribution
-	@(cd ${WRKDIR} && ${GZIP_CMD} -dc \
-		${_DISTDIR}/${DISTNAME:S/$/.source/}${EXTRACT_SUFX} | \
+	@(cd ${WRKDIR} && \
+		${GZIP_CMD} -dc ${_DISTDIR}/${DISTNAME}.source.tar.gz | \
 		${TAR} -xf - \
 		${FPCSRCDIR}/compiler \
 		${FPCSRCDIR}/rtl \


More information about the svn-ports-all mailing list