Wed Jun 1 09:44:52 2016 UTC ()
Check for directory existence inside an "if", so that non-existence
does not cause breakage.

Fixes build of e.g. syncthing-gtk.

>From richard@


(wiz)
diff -r1.22 -r1.23 pkgsrc/lang/python/egg.mk

cvs diff -r1.22 -r1.23 pkgsrc/lang/python/egg.mk (expand / switch to unified diff)

--- pkgsrc/lang/python/egg.mk 2016/05/28 11:23:46 1.22
+++ pkgsrc/lang/python/egg.mk 2016/06/01 09:44:52 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: egg.mk,v 1.22 2016/05/28 11:23:46 richard Exp $ 1# $NetBSD: egg.mk,v 1.23 2016/06/01 09:44:52 wiz Exp $
2# 2#
3# Common logic to handle Python Eggs 3# Common logic to handle Python Eggs
4# 4#
5.include "../../mk/bsd.fast.prefs.mk" 5.include "../../mk/bsd.fast.prefs.mk"
6.include "../../lang/python/pyversion.mk" 6.include "../../lang/python/pyversion.mk"
7 7
8# This file should be included to package python "distributions" which 8# This file should be included to package python "distributions" which
9# use setuptools to create an egg. Some distributions use distutils, 9# use setuptools to create an egg. Some distributions use distutils,
10# which creates an egg-info file; those should use distutils.mk 10# which creates an egg-info file; those should use distutils.mk
11 11
12EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g} 12EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g}
13EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info 13EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
14 14
@@ -32,18 +32,19 @@ PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py @@ -32,18 +32,19 @@ PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py
32 "$${EGG_INFODIR}") } 32 "$${EGG_INFODIR}") }
33PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \ 33PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \
34 "$${EGG_NAME}-nspkg.pth") } 34 "$${EGG_NAME}-nspkg.pth") }
35 35
36_PYSETUPTOOLSINSTALLARGS= --single-version-externally-managed 36_PYSETUPTOOLSINSTALLARGS= --single-version-externally-managed
37 37
38DEPENDS+= ${PYPKGPREFIX}-setuptools>=0.8:../../devel/py-setuptools 38DEPENDS+= ${PYPKGPREFIX}-setuptools>=0.8:../../devel/py-setuptools
39 39
40INSTALLATION_DIRS+= ${PYSITELIB} 40INSTALLATION_DIRS+= ${PYSITELIB}
41 41
42privileged-install-hook: fixup-egg-info 42privileged-install-hook: fixup-egg-info
43.PHONY: fixup-egg-info 43.PHONY: fixup-egg-info
44fixup-egg-info: # ensure egg-info directory contents are always 644 44fixup-egg-info: # ensure egg-info directory contents are always 644
45 ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}" && \ 45 if ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}"; then \
46 ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \ 46 ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \
47 -exec ${CHMOD} ${SHAREMODE} '{}' + 47 -exec ${CHMOD} ${SHAREMODE} '{}' +; \
 48 fi
48 49
49.include "../../lang/python/extension.mk" 50.include "../../lang/python/extension.mk"