pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pbulk pbulk-0.47:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a93e0a042cd8
branches:  trunk
changeset: 576643:a93e0a042cd8
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Jun 15 21:11:43 2010 +0000

description:
pbulk-0.47:
- Explicitly call make create-usergroup if USERGROUP_PHASE is specified
  and DESTDIR is active
- If the current user is not root, don't use su.
- Skip lines starting with # in the limited bulk build list.

diffstat:

 pkgtools/pbulk/Makefile                      |   4 +-
 pkgtools/pbulk/files/pbulk/scripts/pkg-build |  33 ++++++++++++++++++++++++---
 pkgtools/pbulk/files/pbulk/scripts/scan      |   4 +-
 3 files changed, 33 insertions(+), 8 deletions(-)

diffs (100 lines):

diff -r e65a37a57441 -r a93e0a042cd8 pkgtools/pbulk/Makefile
--- a/pkgtools/pbulk/Makefile   Tue Jun 15 21:09:31 2010 +0000
+++ b/pkgtools/pbulk/Makefile   Tue Jun 15 21:11:43 2010 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.60 2010/02/24 22:54:54 joerg Exp $
+# $NetBSD: Makefile,v 1.61 2010/06/15 21:11:43 joerg Exp $
 
-DISTNAME=      pbulk-0.46
+DISTNAME=      pbulk-0.47
 COMMENT=       Modular bulk build framework
 
 PKG_DESTDIR_SUPPORT=   user-destdir
diff -r e65a37a57441 -r a93e0a042cd8 pkgtools/pbulk/files/pbulk/scripts/pkg-build
--- a/pkgtools/pbulk/files/pbulk/scripts/pkg-build      Tue Jun 15 21:09:31 2010 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/pkg-build      Tue Jun 15 21:11:43 2010 +0000
@@ -1,5 +1,5 @@
 #!@SH@
-# $NetBSD: pkg-build,v 1.20 2010/02/24 22:51:37 joerg Exp $
+# $NetBSD: pkg-build,v 1.21 2010/06/15 21:11:43 joerg Exp $
 #
 # Copyright (c) 2007, 2008 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
 # All rights reserved.
@@ -69,6 +69,21 @@
 
 }
 
+run_usergroup() {
+       [ "${use_destdir}" != no ] || return 0
+       case "${usergroup_phase}" in
+       *configure)
+               [ "$1" != "configure" ] || ${make} create-usergroup
+               ;;
+       *build)
+               [ "$1" != "build" ] || ${make} create-usergroup
+               ;;
+       pre-install)
+               [ "$1" != "install" ] || ${make} create-usergroup
+               ;;
+       esac
+}
+
 while read build_info_line; do
        case "${build_info_line}" in
        PKGNAME=*)
@@ -89,6 +104,8 @@
        BOOTSTRAP_PKG=*)
                is_bootstrap=${build_info_line#BOOTSTRAP_PKG=}
                ;;
+       USERGROUP_PHASE=*)
+               usergroup_phase=${build_info_line#USERGROUP_PHASE=}
        esac
 done
 
@@ -107,6 +124,11 @@
        ;;
 esac
 
+if [ `whoami` != "root" ]; then
+       run_build=run_direct
+       run_install=run_direct
+fi
+
 ${pkg_up_to_date_script} ${pkgname} ${dependencies} && exit 0
 
 set -e
@@ -157,9 +179,12 @@
 fi
 # Build package, create a separate log file for each major phase
 run_make run_direct checksum  > ${bulklog}/${pkgname}/checksum.log 2>&1 || cleanup
-run_make ${run_build} configure  > ${bulklog}/${pkgname}/configure.log 2>&1 || cleanup
-run_make ${run_build} all  > ${bulklog}/${pkgname}/build.log 2>&1 || cleanup
-run_make ${run_install} stage-install  > ${bulklog}/${pkgname}/install.log 2>&1 || cleanup
+run_usergroup configure > ${bulklog}/${pkgname}/configure.log 2>&1 || cleanup
+run_make ${run_build} configure >> ${bulklog}/${pkgname}/configure.log 2>&1 || cleanup
+run_usergroup build> ${bulklog}/${pkgname}/build.log 2>&1 || cleanup
+run_make ${run_build} all >> ${bulklog}/${pkgname}/build.log 2>&1 || cleanup
+run_usergroup install > ${bulklog}/${pkgname}/install.log 2>&1 || cleanup
+run_make ${run_install} stage-install >> ${bulklog}/${pkgname}/install.log 2>&1 || cleanup
 run_make run_direct package  > ${bulklog}/${pkgname}/package.log 2>&1 || cleanup
 
 # When using DESTDIR build, add the package once to test install rules.
diff -r e65a37a57441 -r a93e0a042cd8 pkgtools/pbulk/files/pbulk/scripts/scan
--- a/pkgtools/pbulk/files/pbulk/scripts/scan   Tue Jun 15 21:09:31 2010 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/scan   Tue Jun 15 21:11:43 2010 +0000
@@ -1,5 +1,5 @@
 #!@SH@
-# $NetBSD: scan,v 1.6 2009/12/30 21:14:43 joerg Exp $
+# $NetBSD: scan,v 1.7 2010/06/15 21:11:43 joerg Exp $
 #
 # Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
 # All rights reserved.
@@ -72,7 +72,7 @@
 else
        initial=1
        mkdir -p ${loc}
-       cp "${limited_list}" ${loc}/missing
+       grep -v '^#' "${limited_list}" > ${loc}/missing
 
        while [ -s ${loc}/missing ]; do
                sort -u ${loc}/missing > ${loc}/missing.s



Home | Main Index | Thread Index | Old Index