pkgsrc-Changes archive

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

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   rillig
Date:           Wed Jul 17 18:34:16 UTC 2019

Modified Files:
        pkgsrc/lang/python: egg.mk
        pkgsrc/regress: Makefile
Added Files:
        pkgsrc/regress/print-plist-python: DESCR Makefile PLIST spec

Log Message:
lang/python: fix PYVERSSUFFIX escaping for print-PLIST

Before, the filename "3270" was wrongly replaced with "${PYVERSSUFFIX}"
since the version number "3.7", when interpreted as a regular expression,
matched that filename.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 pkgsrc/lang/python/egg.mk
cvs rdiff -u -r1.23 -r1.24 pkgsrc/regress/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/regress/print-plist-python/DESCR \
    pkgsrc/regress/print-plist-python/Makefile \
    pkgsrc/regress/print-plist-python/PLIST \
    pkgsrc/regress/print-plist-python/spec

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/python/egg.mk
diff -u pkgsrc/lang/python/egg.mk:1.27 pkgsrc/lang/python/egg.mk:1.28
--- pkgsrc/lang/python/egg.mk:1.27      Wed Feb  8 12:09:30 2017
+++ pkgsrc/lang/python/egg.mk   Wed Jul 17 18:34:16 2019
@@ -1,4 +1,4 @@
-# $NetBSD: egg.mk,v 1.27 2017/02/08 12:09:30 wiz Exp $
+# $NetBSD: egg.mk,v 1.28 2019/07/17 18:34:16 rillig Exp $
 #
 # Common logic to handle Python Eggs
 #
@@ -28,11 +28,11 @@ PY_PATCHPLIST=      yes
 
 PLIST_SUBST+=  EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX}
 PLIST_SUBST+=  EGG_INFODIR=${EGG_INFODIR}
-PRINT_PLIST_AWK+=      { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}.egg-info/, \
+PRINT_PLIST_AWK+=      { gsub(/${EGG_NAME}-py${PYVERSSUFFIX:S,.,\.,g}.egg-info/, \
                               "$${EGG_INFODIR}") }
-PRINT_PLIST_AWK+=      { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \
+PRINT_PLIST_AWK+=      { gsub(/${EGG_NAME}-py${PYVERSSUFFIX:S,.,\.,g}-nspkg.pth/, \
                               "$${EGG_NAME}-nspkg.pth") }
-PRINT_PLIST_AWK+=      { gsub(/${PYVERSSUFFIX}/, \
+PRINT_PLIST_AWK+=      { gsub(/${PYVERSSUFFIX:S,.,\.,g}/, \
                               "$${PYVERSSUFFIX}") }
 
 _PYSETUPTOOLSINSTALLARGS=      --single-version-externally-managed

Index: pkgsrc/regress/Makefile
diff -u pkgsrc/regress/Makefile:1.23 pkgsrc/regress/Makefile:1.24
--- pkgsrc/regress/Makefile:1.23        Sat May  4 15:17:39 2019
+++ pkgsrc/regress/Makefile     Wed Jul 17 18:34:16 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2019/05/04 15:17:39 rillig Exp $
+# $NetBSD: Makefile,v 1.24 2019/07/17 18:34:16 rillig Exp $
 #
 # See https://www.netbsd.org/docs/pkgsrc/regression.html for more
 # information about these tests.
@@ -22,6 +22,7 @@ SUBDIR+=      make-quoting
 SUBDIR+=       pkg-options
 SUBDIR+=       pkgfail
 SUBDIR+=       print-plist
+SUBDIR+=       print-plist-python
 SUBDIR+=       show-all
 SUBDIR+=       subst
 SUBDIR+=       tools

Added files:

Index: pkgsrc/regress/print-plist-python/DESCR
diff -u /dev/null pkgsrc/regress/print-plist-python/DESCR:1.1
--- /dev/null   Wed Jul 17 18:34:16 2019
+++ pkgsrc/regress/print-plist-python/DESCR     Wed Jul 17 18:34:16 2019
@@ -0,0 +1,3 @@
+This test verifies that the dots that may appear as "3.7" in PYVERSSUFFIX
+are properly escaped when that variable is treated as a regular
+expression in PLIST_AWK.
Index: pkgsrc/regress/print-plist-python/Makefile
diff -u /dev/null pkgsrc/regress/print-plist-python/Makefile:1.1
--- /dev/null   Wed Jul 17 18:34:16 2019
+++ pkgsrc/regress/print-plist-python/Makefile  Wed Jul 17 18:34:16 2019
@@ -0,0 +1,32 @@
+# $NetBSD: Makefile,v 1.1 2019/07/17 18:34:16 rillig Exp $
+
+DISTNAME=      print-plist-python-0.0
+CATEGORIES=    regress
+MASTER_SITES=  # none
+DISTFILES=     # none
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+COMMENT=       Test escaping in PRINT_PLIST_AWK
+LICENSE=       2-clause-bsd
+
+NO_CHECKSUM=   yes
+NO_CONFIGURE=  yes
+WRKSRC=                ${WRKDIR}
+AUTO_MKDIRS=   yes
+
+# When interpreted as a regular expression, the version number "3.7"
+# matches the filename "share/emul3270". Therefore only that version works.
+PYTHON_VERSIONS_ACCEPTABLE=    37
+
+pre-build:
+       ${TOUCH} ${WRKDIR}/setup.py
+
+post-build:
+       ${ECHO} "content" >${WRKDIR}/file
+
+post-install:
+       ${INSTALL_DATA} ${WRKSRC}/file ${DESTDIR}${PREFIX}/share/emul3270
+       ${INSTALL_DATA} ${WRKSRC}/file ${DESTDIR}${PREFIX}/share/file-${PYVERSSUFFIX}.txt
+
+.include "../../lang/python/egg.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/regress/print-plist-python/PLIST
diff -u /dev/null pkgsrc/regress/print-plist-python/PLIST:1.1
--- /dev/null   Wed Jul 17 18:34:16 2019
+++ pkgsrc/regress/print-plist-python/PLIST     Wed Jul 17 18:34:16 2019
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2019/07/17 18:34:16 rillig Exp $
+share/emul3270
+share/file-${PYVERSSUFFIX}.txt
Index: pkgsrc/regress/print-plist-python/spec
diff -u /dev/null pkgsrc/regress/print-plist-python/spec:1.1
--- /dev/null   Wed Jul 17 18:34:16 2019
+++ pkgsrc/regress/print-plist-python/spec      Wed Jul 17 18:34:16 2019
@@ -0,0 +1,12 @@
+# $NetBSD: spec,v 1.1 2019/07/17 18:34:16 rillig Exp $
+
+MAKEARGS_TEST="-s install print-PLIST"
+
+MAKEARGS_CLEAN="deinstall clean"
+
+check_result()
+{
+       exit_status 0
+       output_require "^share/emul3270$"
+       output_require "^share/file-\\\${PYVERSSUFFIX}\\.txt$"
+}



Home | Main Index | Thread Index | Old Index