Fri Jul 24 06:54:37 2009 UTC ()
Compute +SIZE_ALL as documented in pkg_info(1). Addresses PR 41767.


(joerg)
diff -r1.31 -r1.32 pkgsrc/mk/flavor/pkg/metadata.mk

cvs diff -r1.31 -r1.32 pkgsrc/mk/flavor/pkg/Attic/metadata.mk (expand / switch to unified diff)

--- pkgsrc/mk/flavor/pkg/Attic/metadata.mk 2009/05/02 16:14:37 1.31
+++ pkgsrc/mk/flavor/pkg/Attic/metadata.mk 2009/07/24 06:54:37 1.32
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: metadata.mk,v 1.31 2009/05/02 16:14:37 reed Exp $ 1# $NetBSD: metadata.mk,v 1.32 2009/07/24 06:54:37 joerg Exp $
2 2
3###################################################################### 3######################################################################
4### The targets below are all PRIVATE. 4### The targets below are all PRIVATE.
5###################################################################### 5######################################################################
6 6
7###################################################################### 7######################################################################
8### 8###
9### Temporary package meta-data directory. The contents of this directory 9### Temporary package meta-data directory. The contents of this directory
10### are copied directly into the real package meta-data directory. 10### are copied directly into the real package meta-data directory.
11### 11###
12PKG_DB_TMPDIR= ${WRKDIR}/.pkgdb 12PKG_DB_TMPDIR= ${WRKDIR}/.pkgdb
13 13
14unprivileged-install-hook: ${PKG_DB_TMPDIR} 14unprivileged-install-hook: ${PKG_DB_TMPDIR}
@@ -257,67 +257,70 @@ install-display-message: ${_MESSAGE_FILE @@ -257,67 +257,70 @@ install-display-message: ${_MESSAGE_FILE
257### package unless one "force-deletes" the package. 257### package unless one "force-deletes" the package.
258### 258###
259.if defined(PKG_PRESERVE) 259.if defined(PKG_PRESERVE)
260_PRESERVE_FILE= ${PKG_DB_TMPDIR}/+PRESERVE 260_PRESERVE_FILE= ${PKG_DB_TMPDIR}/+PRESERVE
261_METADATA_TARGETS+= ${_PRESERVE_FILE} 261_METADATA_TARGETS+= ${_PRESERVE_FILE}
262 262
263${_PRESERVE_FILE}: 263${_PRESERVE_FILE}:
264 ${RUN}${MKDIR} ${.TARGET:H} 264 ${RUN}${MKDIR} ${.TARGET:H}
265 ${RUN}${DATE} > ${.TARGET} 265 ${RUN}${DATE} > ${.TARGET}
266.endif 266.endif
267 267
268###################################################################### 268######################################################################
269### 269###
270### +SIZE_ALL - Package size-of-dependencies file 
271### 
272### This is the total size of the dependencies that this package was 
273### built against. 
274### 
275_SIZE_ALL_FILE= ${PKG_DB_TMPDIR}/+SIZE_ALL 
276_METADATA_TARGETS+= ${_SIZE_ALL_FILE} 
277 
278${_SIZE_ALL_FILE}: ${_RDEPENDS_FILE} 
279 ${RUN}${MKDIR} ${.TARGET:H} 
280 ${RUN} \ 
281 ${_FULL_DEPENDS_CMD} | ${SORT} -u | \ 
282 ${XARGS} -n 256 ${PKG_INFO} -qs | \ 
283 ${AWK} 'BEGIN { s = 0 } /^[0-9]+$$/ { s += $$1 } END { print s }' \ 
284 > ${.TARGET} 
285 
286###################################################################### 
287### 
288### +SIZE_PKG - Package size file 270### +SIZE_PKG - Package size file
289### 271###
290### This is the total size of the files contained in the package. 272### This is the total size of the files contained in the package.
291### 273###
292_SIZE_PKG_FILE= ${PKG_DB_TMPDIR}/+SIZE_PKG 274_SIZE_PKG_FILE= ${PKG_DB_TMPDIR}/+SIZE_PKG
293_METADATA_TARGETS+= ${_SIZE_PKG_FILE} 275_METADATA_TARGETS+= ${_SIZE_PKG_FILE}
294 276
295${_SIZE_PKG_FILE}: plist 277${_SIZE_PKG_FILE}: plist
296 ${RUN}${MKDIR} ${.TARGET:H} 278 ${RUN}${MKDIR} ${.TARGET:H}
297 ${RUN} \ 279 ${RUN} \
298 ${CAT} ${PLIST} | \ 280 ${CAT} ${PLIST} | \
299 ${AWK} 'BEGIN { base = "${PREFIX}/" } \ 281 ${AWK} 'BEGIN { base = "${PREFIX}/" } \
300 /^@cwd/ { base = $$2 "/" } \ 282 /^@cwd/ { base = $$2 "/" } \
301 /^@/ { next } \ 283 /^@/ { next } \
302 { print base $$0 }' | \ 284 { print base $$0 }' | \
303 ${SORT} -u | \ 285 ${SORT} -u | \
304 ${SED} -e "s,^/,${DESTDIR}/," -e "s/'/'\\\\''/g" -e "s/.*/'&'/" | \ 286 ${SED} -e "s,^/,${DESTDIR}/," -e "s/'/'\\\\''/g" -e "s/.*/'&'/" | \
305 ${XARGS} -n 256 ${LS} -ld 2>/dev/null | \ 287 ${XARGS} -n 256 ${LS} -ld 2>/dev/null | \
306 ${AWK} 'BEGIN { s = 0 } { s += $$5 } END { print s }' \ 288 ${AWK} 'BEGIN { s = 0 } { s += $$5 } END { print s }' \
307 > ${.TARGET} 289 > ${.TARGET}
308 290
309###################################################################### 291######################################################################
310### 292###
 293### +SIZE_ALL - Package size-of-dependencies file
 294###
 295### This is the total size of the dependencies that this package was
 296### built against and the package itself.
 297###
 298_SIZE_ALL_FILE= ${PKG_DB_TMPDIR}/+SIZE_ALL
 299_METADATA_TARGETS+= ${_SIZE_ALL_FILE}
 300
 301${_SIZE_ALL_FILE}: ${_RDEPENDS_FILE} ${_SIZE_PKG_FILE}
 302 ${RUN}${MKDIR} ${.TARGET:H}
 303 ${RUN} \
 304 { \
 305 ${CAT} ${_SIZE_PKG_FILE} && \
 306 ${_FULL_DEPENDS_CMD} | ${SORT} -u | \
 307 ${XARGS} -n 256 ${PKG_INFO} -qs; \
 308 } | \
 309 ${AWK} 'BEGIN { s = 0 } /^[0-9]+$$/ { s += $$1 } END { print s }' \
 310 > ${.TARGET}
 311
 312######################################################################
 313###
311### +CONTENTS - Package manifest file 314### +CONTENTS - Package manifest file
312### 315###
313### This file contains the list of files and checksums, along with 316### This file contains the list of files and checksums, along with
314### any special "@" commands, e.g. @dirrm. 317### any special "@" commands, e.g. @dirrm.
315### 318###
316_CONTENTS_FILE= ${PKG_DB_TMPDIR}/+CONTENTS 319_CONTENTS_FILE= ${PKG_DB_TMPDIR}/+CONTENTS
317_METADATA_TARGETS+= ${_CONTENTS_FILE} 320_METADATA_TARGETS+= ${_CONTENTS_FILE}
318 321
319_DEPENDS_PLIST= ${WRKDIR}/.PLIST_deps 322_DEPENDS_PLIST= ${WRKDIR}/.PLIST_deps
320 323
321${_DEPENDS_PLIST}: ${PLIST} 324${_DEPENDS_PLIST}: ${PLIST}
322 ${RUN} { \ 325 ${RUN} { \
323 ${ECHO} "@name ${PKGNAME}"; \ 326 ${ECHO} "@name ${PKGNAME}"; \