Skip to content

Commit

Permalink
Update _USE_DESTDIR=full handling to use the new -u/-g code and
Browse files Browse the repository at this point in the history
require pkg_install-20070802 for using it. It is now considered
to work correctly and ready for general consumption.
  • Loading branch information
joerg committed Aug 3, 2007
1 parent 5e516a8 commit 7858d2a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
6 changes: 5 additions & 1 deletion mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
# $NetBSD: bsd.pkg.mk,v 1.1916 2007/07/29 05:19:41 jlam Exp $
# $NetBSD: bsd.pkg.mk,v 1.1917 2007/08/03 14:03:39 joerg Exp $
#
# This file is in the public domain.
#
Expand Down Expand Up @@ -105,6 +105,10 @@ _INSTALL_UNSTRIPPED= # set (flag used by platform/*.mk)

# Latest versions of tools required for correct pkgsrc operation.
PKGTOOLS_REQD= ${_OPSYS_PKGTOOLS_REQD:U20051103}
.if ${_USE_DESTDIR} == "user-destdir" && ${PKGTOOLS_REQD} < 20070802
PKGTOOLS_REQD= 20070802
.endif


##### Transform USE_* into dependencies

Expand Down
5 changes: 4 additions & 1 deletion mk/flavor/pkg/package.mk
@@ -1,4 +1,4 @@
# $NetBSD: package.mk,v 1.8 2007/08/02 18:19:32 joerg Exp $
# $NetBSD: package.mk,v 1.9 2007/08/03 14:03:40 joerg Exp $

PKG_SUFX?= .tgz
PKGFILE?= ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}
Expand Down Expand Up @@ -33,6 +33,9 @@ _PKG_ARGS_PACKAGE+= ${_PKG_CREATE_ARGS}
_PKG_ARGS_PACKAGE+= -p ${PREFIX}
.else
_PKG_ARGS_PACKAGE+= -I ${PREFIX} -p ${DESTDIR}${PREFIX}
. if ${_USE_DESTDIR} == "user-destdir"
_PKG_ARGS_PACKAGE+= -u ${REAL_ROOT_USER} -g ${REAL_ROOT_GROUP}
. endif
.endif
_PKG_ARGS_PACKAGE+= -L ${DESTDIR}${PREFIX} # @src ...
.if ${PKG_INSTALLATION_TYPE} == "pkgviews"
Expand Down
13 changes: 2 additions & 11 deletions mk/plist/plist.mk
@@ -1,4 +1,4 @@
# $NetBSD: plist.mk,v 1.30 2007/07/29 05:19:44 jlam Exp $
# $NetBSD: plist.mk,v 1.31 2007/08/03 14:03:40 joerg Exp $
#
# This Makefile fragment handles the creation of PLISTs for use by
# pkg_create(8).
Expand Down Expand Up @@ -186,13 +186,6 @@ _PLIST_IGNORE_FILES+= ${PLIST_IGNORE_FILES}
.endif
_BUILD_DEFS+= _PLIST_IGNORE_FILES

.if ${_USE_DESTDIR} == "user-destdir"
_SET_OWNER_GROUP= ${ECHO} "@owner ${REAL_ROOT_USER}"; \
${ECHO} "@group ${REAL_ROOT_GROUP}"
.else
_SET_OWNER_GROUP= :
.endif

.if ${PLIST_TYPE} == "dynamic"
_PLIST_IGNORE_CMD= \
( while read i; do \
Expand All @@ -205,7 +198,6 @@ _PLIST_IGNORE_CMD= \
[ "$$ignore" = "yes" ] || ${ECHO} "$$i"; \
done )
_GENERATE_PLIST= \
${_SET_OWNER_GROUP}; \
${FIND} ${DESTDIR}${PREFIX} \! -type d -print | ${SORT} | \
${SED} -e "s|^${DESTDIR}${PREFIX}/||" | \
${_PLIST_IGNORE_CMD}; \
Expand All @@ -215,8 +207,7 @@ _GENERATE_PLIST= \
${SED} -e "s|^${DESTDIR}${PREFIX}/|@unexec ${RMDIR} -p %D/|" \
-e "s,$$, 2>/dev/null || ${TRUE},";
.else
_GENERATE_PLIST= ${_SET_OWNER_GROUP}; \
${CAT} ${PLIST_SRC}; \
_GENERATE_PLIST= ${CAT} ${PLIST_SRC}; \
${GENERATE_PLIST}
.endif

Expand Down

0 comments on commit 7858d2a

Please sign in to comment.