diff options
author | joerg <joerg@pkgsrc.org> | 2016-12-18 22:59:35 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2016-12-18 22:59:35 +0000 |
commit | 04f60e016bc28e90aba988add428a2e5583be982 (patch) | |
tree | 62067277fc1e74165d7ffbdb06687141bdce646c /pkgtools | |
parent | 9b32f4f96636e99d75fc865476219f6990e4d59e (diff) | |
download | pkgsrc-04f60e016bc28e90aba988add428a2e5583be982.tar.gz |
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 (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pbulk/Makefile | 6 | ||||
-rw-r--r-- | pkgtools/pbulk/files/pbulk/pbulk.conf | 3 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/build-client-start | 15 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/client-prepare | 15 | ||||
-rwxr-xr-x | pkgtools/pbulk/files/pbulk/scripts/scan-client-start | 17 |
5 files changed, 45 insertions, 11 deletions
diff --git a/pkgtools/pbulk/Makefile b/pkgtools/pbulk/Makefile index 2c44225f03f..c429d341346 100644 --- a/pkgtools/pbulk/Makefile +++ b/pkgtools/pbulk/Makefile @@ -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 @@ SUBST_VARS.tools= AWK BZIP2 CHOWN DIGEST GZIP_CMD ID MAIL_CMD NEATO \ 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 --git a/pkgtools/pbulk/files/pbulk/pbulk.conf b/pkgtools/pbulk/files/pbulk/pbulk.conf index dbf77c81d4c..ae4a4ce24fb 100644 --- a/pkgtools/pbulk/files/pbulk/pbulk.conf +++ b/pkgtools/pbulk/files/pbulk/pbulk.conf @@ -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 @@ keep_prefix=no 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 --git a/pkgtools/pbulk/files/pbulk/scripts/build-client-start b/pkgtools/pbulk/files/pbulk/scripts/build-client-start index 8aa8a98ba88..77056948247 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/build-client-start +++ b/pkgtools/pbulk/files/pbulk/scripts/build-client-start @@ -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 @@ fi 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 --git a/pkgtools/pbulk/files/pbulk/scripts/client-prepare b/pkgtools/pbulk/files/pbulk/scripts/client-prepare index ae447c207b0..3123969969d 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/client-prepare +++ b/pkgtools/pbulk/files/pbulk/scripts/client-prepare @@ -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 @@ done 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 --git a/pkgtools/pbulk/files/pbulk/scripts/scan-client-start b/pkgtools/pbulk/files/pbulk/scripts/scan-client-start index 28e0d9ae0c4..158e71f31f5 100755 --- a/pkgtools/pbulk/files/pbulk/scripts/scan-client-start +++ b/pkgtools/pbulk/files/pbulk/scripts/scan-client-start @@ -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 @@ fi ${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 |