pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Add two variables to control whether make package a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2f46ce7ff169
branches:  trunk
changeset: 519763:2f46ce7ff169
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Oct 09 11:44:06 2006 +0000

description:
Add two variables to control whether make package and make clean
are run with elevated privileges. Remove MAKE_PACKAGE_AS_ROOT
for now, since it is not sure whether the functionality in the current
form will stay and developers should spend time on the destdir support
instead.

diffstat:

 mk/bsd.pkg.clean.mk       |  12 +++++++++---
 mk/bsd.prefs.mk           |   7 ++++++-
 mk/package/bsd.package.mk |  16 +---------------
 mk/package/package.mk     |  10 +++++-----
 4 files changed, 21 insertions(+), 24 deletions(-)

diffs (110 lines):

diff -r 84ecc1ce2ca3 -r 2f46ce7ff169 mk/bsd.pkg.clean.mk
--- a/mk/bsd.pkg.clean.mk       Mon Oct 09 11:34:09 2006 +0000
+++ b/mk/bsd.pkg.clean.mk       Mon Oct 09 11:44:06 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.clean.mk,v 1.8 2006/08/09 15:31:01 jlam Exp $
+# $NetBSD: bsd.pkg.clean.mk,v 1.9 2006/10/09 11:44:06 joerg Exp $
 #
 # This Makefile fragment is included to bsd.pkg.mk and defines the
 # relevant variables and targets for the "clean" phase.
@@ -50,7 +50,14 @@
 
 .PHONY: do-clean
 .if !target(do-clean)
-do-clean:
+.  if !empty(_MAKE_CLEAN_AS_ROOT:M[Yy][Ee][Ss])
+do-clean: su-target
+.  else
+do-clean: su-do-clean
+.  endif
+.endif
+
+su-do-clean:
        @${PHASE_MSG} "Cleaning for ${PKGNAME}"
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        if ${TEST} -d ${WRKDIR:Q}; then                                 \
@@ -65,7 +72,6 @@
        ${RMDIR} ${BUILD_DIR} 2>/dev/null || ${TRUE};                   \
        ${RM} -f ${WRKDIR_BASENAME} 2>/dev/null || ${TRUE}
 .  endif
-.endif
 
 _CLEAN_TARGETS+=       pre-clean
 .if empty(CLEANDEPENDS:M[nN][oO])
diff -r 84ecc1ce2ca3 -r 2f46ce7ff169 mk/bsd.prefs.mk
--- a/mk/bsd.prefs.mk   Mon Oct 09 11:34:09 2006 +0000
+++ b/mk/bsd.prefs.mk   Mon Oct 09 11:44:06 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.238 2006/10/06 14:51:36 joerg Exp $
+# $NetBSD: bsd.prefs.mk,v 1.239 2006/10/09 11:44:06 joerg Exp $
 #
 # Make file, included to get the site preferences, if any.  Should
 # only be included by package Makefiles before any .if defined()
@@ -326,6 +326,11 @@
 
 PKGDIRMODE?=           755
 
+_MAKE_CLEAN_AS_ROOT?=  no
+# Whether to run the clean target as root.
+_MAKE_PACKAGE_AS_ROOT?=        yes
+# Whether to run the package target as root.
+
 PKG_INSTALLATION_TYPES?= overwrite
 # This is a whitespace-separated list of installation types supported
 # by the package.
diff -r 84ecc1ce2ca3 -r 2f46ce7ff169 mk/package/bsd.package.mk
--- a/mk/package/bsd.package.mk Mon Oct 09 11:34:09 2006 +0000
+++ b/mk/package/bsd.package.mk Mon Oct 09 11:44:06 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.package.mk,v 1.8 2006/10/08 20:31:38 rillig Exp $
+# $NetBSD: bsd.package.mk,v 1.9 2006/10/09 11:44:07 joerg Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to binary packages.
@@ -6,20 +6,6 @@
 # The following are the "public" targets provided by this module:
 #
 #    package, repackage
-#
-# The following variables may be set by the package:
-#
-# MAKE_PACKAGE_AS_ROOT: YesNo
-#      When this variable is set to "no", the package is created by
-#      the user that also built the package. Since most packages don't
-#      need root privileges to create the package, the default value
-#      is "no". Packages that install unreadable files (for example
-#      with mode 4111) need to set this variable to "yes".
-#
-#      Default value: "yes", but this will change to "no" after most
-#      packages that really need this option have been identified.
-
-MAKE_PACKAGE_AS_ROOT?= yes
 
 _COOKIE.package=       ${WRKDIR}/.package_done
 
diff -r 84ecc1ce2ca3 -r 2f46ce7ff169 mk/package/package.mk
--- a/mk/package/package.mk     Mon Oct 09 11:34:09 2006 +0000
+++ b/mk/package/package.mk     Mon Oct 09 11:44:06 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: package.mk,v 1.16 2006/10/08 20:31:38 rillig Exp $
+# $NetBSD: package.mk,v 1.17 2006/10/09 11:44:07 joerg Exp $
 
 ######################################################################
 ### package (PUBLIC)
@@ -83,12 +83,12 @@
 _PACKAGE_ALL_TARGETS+= error-check
 
 .PHONY: package-all su-package-all
-.if !empty(MAKE_PACKAGE_AS_ROOT:M[Yy][Ee][Ss])
+.if !empty(_MAKE_PACKAGE_AS_ROOT:M[Yy][Ee][Ss])
 package-all: su-target
+.else
+package-all: su-package-all
+.endif
 su-package-all: ${_PACKAGE_ALL_TARGETS}
-.else
-package-all: ${_PACKAGE_ALL_TARGETS}
-.endif
 
 ######################################################################
 ### package-check-installed (PRIVATE, override)



Home | Main Index | Thread Index | Old Index