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.65: Add basic support for speci...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/54875fc1c4ce
branches:  trunk
changeset: 356106:54875fc1c4ce
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Dec 18 22:59:35 2016 +0000

description:
pbulk-0.65: Add basic support for specifying chroot'd clients by
absolute path. Introduce hook for setting up the chroot
(client_prepare_chroot) similar to client_prepare_action for ssh
clients.

diffstat:

 pkgtools/pbulk/Makefile                               |   6 +++---
 pkgtools/pbulk/files/pbulk/pbulk.conf                 |   3 ++-
 pkgtools/pbulk/files/pbulk/scripts/build-client-start |  15 +++++++++++++--
 pkgtools/pbulk/files/pbulk/scripts/client-prepare     |  15 +++++++++++++--
 pkgtools/pbulk/files/pbulk/scripts/scan-client-start  |  17 ++++++++++++++---
 5 files changed, 45 insertions(+), 11 deletions(-)

diffs (150 lines):

diff -r c5e505986768 -r 54875fc1c4ce pkgtools/pbulk/Makefile
--- a/pkgtools/pbulk/Makefile   Sun Dec 18 22:58:34 2016 +0000
+++ b/pkgtools/pbulk/Makefile   Sun Dec 18 22:59:35 2016 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.80 2016/12/18 22:41:12 joerg Exp $
+# $NetBSD: Makefile,v 1.81 2016/12/18 22:59:35 joerg Exp $
 
-PKGNAME=       pbulk-0.64
+PKGNAME=       pbulk-0.65
 COMMENT=       Modular bulk build framework
 
 .include "../../pkgtools/pbulk/Makefile.common"
@@ -39,7 +39,7 @@
 CONF_FILES+=   share/examples/pbulk/pbulk.conf ${PKG_SYSCONFDIR}/pbulk.conf
 
 PBULK_CONFIG=          ${PKG_SYSCONFDIR}/pbulk.conf
-PBULK_CONFIG_VERSION=  0.63
+PBULK_CONFIG_VERSION=  0.65
 
 INSTALLATION_DIRS=     bin libexec/pbulk share/examples/pbulk
 USE_BSD_MAKEFILE=      yes
diff -r c5e505986768 -r 54875fc1c4ce pkgtools/pbulk/files/pbulk/pbulk.conf
--- a/pkgtools/pbulk/files/pbulk/pbulk.conf     Sun Dec 18 22:58:34 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/pbulk.conf     Sun Dec 18 22:59:35 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: pbulk.conf,v 1.23 2016/12/18 22:38:16 joerg Exp $
+# $NetBSD: pbulk.conf,v 1.24 2016/12/18 22:59:35 joerg Exp $
 
 # Version of the configuration file. This is bumped whenever the default
 # config changes to notify the administrator about updates.
@@ -117,6 +117,7 @@
 
 client_prepare=@PREFIX@/libexec/pbulk/client-prepare
 client_prepare_action=@PREFIX@/libexec/pbulk/client-clean
+client_prepare_chroot=:
 pkg_up_to_date_script=@PREFIX@/libexec/pbulk/pkg-up-to-date
 pbuild_script=@PREFIX@/libexec/pbulk/pkg-build
 pbuild_start_script=@PREFIX@/libexec/pbulk/build-client-start
diff -r c5e505986768 -r 54875fc1c4ce pkgtools/pbulk/files/pbulk/scripts/build-client-start
--- a/pkgtools/pbulk/files/pbulk/scripts/build-client-start     Sun Dec 18 22:58:34 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/build-client-start     Sun Dec 18 22:59:35 2016 +0000
@@ -1,5 +1,5 @@
 #!@SH@
-# $NetBSD: build-client-start,v 1.4 2016/12/18 22:41:12 joerg Exp $
+# $NetBSD: build-client-start,v 1.5 2016/12/18 22:59:35 joerg Exp $
 
 . @PBULK_CONFIG@
 
@@ -13,13 +13,24 @@
 
 for client in ${build_clients}; do
        case ${client} in 
+       /*)
+               path=${client}
+               port=
+               client=
+               ;;
        *:*)
+               path=
                port="-p ${client##*:}"
                client=${client%%:*}
                ;;
        *)
+               path=
                port=
                ;;
        esac
-       ssh $port $client "${pbuild} -c ${master_port_build} -b ${pbuild_script}" &
+       if [ -z "$path" ]; then
+               ssh $port $client "${pbuild} -c ${master_port_build} -b ${pbuild_script}" &
+       else
+               chroot "$path" ${pbuild} -c ${master_port_build} -b ${pbuild_script} &
+       fi
 done
diff -r c5e505986768 -r 54875fc1c4ce pkgtools/pbulk/files/pbulk/scripts/client-prepare
--- a/pkgtools/pbulk/files/pbulk/scripts/client-prepare Sun Dec 18 22:58:34 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/client-prepare Sun Dec 18 22:59:35 2016 +0000
@@ -1,5 +1,5 @@
 #!@SH@
-# $NetBSD: client-prepare,v 1.2 2016/12/18 22:41:12 joerg Exp $
+# $NetBSD: client-prepare,v 1.3 2016/12/18 22:59:35 joerg Exp $
 
 . @PBULK_CONFIG@
 
@@ -28,15 +28,26 @@
 
 for client in ${unique_clients}; do
        case ${client} in 
+       /*)
+               port=
+               client=
+               path=${client}
+               ;;
        *:*)
                port="-p ${client##*:}"
                client=${client%%:*}
+               path=
                ;;
        *)
                port=
+               path=
                ;;
        esac
-       ssh $port $client "${client_prepare_action}" &
+       if [ -z "$path" ]; then
+               ssh $port $client "${client_prepare_action}" &
+       else
+               clients_prepare_chroot "$path" &
+       fi
 done
 
 wait
diff -r c5e505986768 -r 54875fc1c4ce pkgtools/pbulk/files/pbulk/scripts/scan-client-start
--- a/pkgtools/pbulk/files/pbulk/scripts/scan-client-start      Sun Dec 18 22:58:34 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/scan-client-start      Sun Dec 18 22:59:35 2016 +0000
@@ -1,5 +1,5 @@
 #!@SH@
-# $NetBSD: scan-client-start,v 1.6 2016/12/18 22:41:12 joerg Exp $
+# $NetBSD: scan-client-start,v 1.7 2016/12/18 22:59:35 joerg Exp $
 
 . @PBULK_CONFIG@
 
@@ -20,14 +20,25 @@
 ${client_prepare}
 
 for client in ${scan_clients}; do
-       case ${client} in 
+       case ${client} in
+       /*)
+               path=${client}
+               port=
+               client=
+               ;;
        *:*)
+               path=
                port="-p ${client##*:}"
                client=${client%%:*}
                ;;
        *)
+               path=
                port=
                ;;
        esac
-       ssh $port $client "${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc}" &
+       if [ -z "$path" ]; then
+               ssh $port $client "${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc}" &
+       else
+               chroot "$path" ${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc} &
+       fi
 done



Home | Main Index | Thread Index | Old Index