Mon Sep 7 11:02:28 2015 UTC ()
Switch to globbing for package symlinks to delete.  This provides significant
performance improvements on at least OSX and SunOS, where each file is stat'd
rather than just the links we are looking for, especially with large package
directories over NFS.


(jperkin)
diff -r1.10 -r1.11 pkgsrc/mk/pkgformat/pkg/package.mk

cvs diff -r1.10 -r1.11 pkgsrc/mk/pkgformat/pkg/package.mk (expand / switch to unified diff)

--- pkgsrc/mk/pkgformat/pkg/package.mk 2015/04/21 17:01:56 1.10
+++ pkgsrc/mk/pkgformat/pkg/package.mk 2015/09/07 11:02:28 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: package.mk,v 1.10 2015/04/21 17:01:56 joerg Exp $ 1# $NetBSD: package.mk,v 1.11 2015/09/07 11:02:28 jperkin Exp $
2 2
3.if defined(PKG_SUFX) 3.if defined(PKG_SUFX)
4WARNINGS+= "PKG_SUFX is deprecated, please use PKG_COMPRESSION" 4WARNINGS+= "PKG_SUFX is deprecated, please use PKG_COMPRESSION"
5. if ${PKG_SUFX} == ".tgz" 5. if ${PKG_SUFX} == ".tgz"
6PKG_COMPRESSION= gzip 6PKG_COMPRESSION= gzip
7. elif ${PKG_SUFX} == ".tbz" 7. elif ${PKG_SUFX} == ".tbz"
8PKG_COMPRESSION= bzip2 8PKG_COMPRESSION= bzip2
9. else 9. else
10WARNINGS+= "Unsupported value for PKG_SUFX" 10WARNINGS+= "Unsupported value for PKG_SUFX"
11. endif 11. endif
12.endif 12.endif
13PKG_SUFX?= .tgz 13PKG_SUFX?= .tgz
14FILEBASE?= ${PKGBASE} 14FILEBASE?= ${PKGBASE}
@@ -127,28 +127,28 @@ package-links: delete-package-links @@ -127,28 +127,28 @@ package-links: delete-package-links
127 ${RUN} [ -d ${_dir_:Q} ] \ 127 ${RUN} [ -d ${_dir_:Q} ] \
128 || ${FAIL_MSG} "Can't create directory "${_dir_:Q}"." 128 || ${FAIL_MSG} "Can't create directory "${_dir_:Q}"."
129 ${RUN} ${RM} -f ${_dir_:Q}/${PKGFILE:T} 129 ${RUN} ${RM} -f ${_dir_:Q}/${PKGFILE:T}
130 ${RUN} ${LN} -s ../${PKGREPOSITORYSUBDIR}/${PKGFILE:T} ${_dir_:Q} 130 ${RUN} ${LN} -s ../${PKGREPOSITORYSUBDIR}/${PKGFILE:T} ${_dir_:Q}
131.endfor 131.endfor
132 132
133###################################################################### 133######################################################################
134### delete-package-links (PRIVATE) 134### delete-package-links (PRIVATE)
135###################################################################### 135######################################################################
136### delete-package-links removes the symlinks to the binary package from 136### delete-package-links removes the symlinks to the binary package from
137### the non-primary categories to which the package belongs. 137### the non-primary categories to which the package belongs.
138### 138###
139delete-package-links: 139delete-package-links:
140 ${RUN} ${FIND} ${PACKAGES} -type l -name ${PKGFILE:T} -print \ 140 ${RUN} ${FIND} ${PACKAGES}/*/${PKGFILE:T} -type l -print \
141 | ${XARGS} ${RM} -f 141 2>/dev/null | ${XARGS} ${RM} -f
142 142
143###################################################################### 143######################################################################
144### tarup (PUBLIC) 144### tarup (PUBLIC)
145###################################################################### 145######################################################################
146### tarup is a public target to generate a binary package from an 146### tarup is a public target to generate a binary package from an
147### installed package instance. 147### installed package instance.
148### 148###
149_PKG_TARUP_CMD= ${LOCALBASE}/bin/pkg_tarup 149_PKG_TARUP_CMD= ${LOCALBASE}/bin/pkg_tarup
150 150
151.PHONY: tarup 151.PHONY: tarup
152tarup: package-remove tarup-pkg package-links 152tarup: package-remove tarup-pkg package-links
153 153
154###################################################################### 154######################################################################