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.63:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c7660151744a
branches:  trunk
changeset: 356103:c7660151744a
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Dec 18 22:38:16 2016 +0000

description:
pbulk-0.63:
Introduce a separate client-prepare script. The default configuration
runs the renamed client_prepare_action for each scan/build client once,
dropping duplicates in the list. Clients are prepared in parallel, but
the master waits for all before starting the actual scan. Make
bulkbuild-restart re-prepare the clients, i.e. in case they have a
pkgsrc tree in a local tmpfs.

diffstat:

 pkgtools/pbulk/Makefile                              |   8 +-
 pkgtools/pbulk/PLIST                                 |   3 +-
 pkgtools/pbulk/files/pbulk/pbulk.conf                |   5 +-
 pkgtools/pbulk/files/pbulk/scripts/Makefile          |   5 +-
 pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart |   8 +++-
 pkgtools/pbulk/files/pbulk/scripts/client-prepare    |  41 ++++++++++++++++++++
 pkgtools/pbulk/files/pbulk/scripts/scan-client-start |   6 +-
 7 files changed, 64 insertions(+), 12 deletions(-)

diffs (177 lines):

diff -r 96cf25c39dcd -r c7660151744a pkgtools/pbulk/Makefile
--- a/pkgtools/pbulk/Makefile   Sun Dec 18 22:08:07 2016 +0000
+++ b/pkgtools/pbulk/Makefile   Sun Dec 18 22:38:16 2016 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.78 2016/12/18 09:36:38 joerg Exp $
+# $NetBSD: Makefile,v 1.79 2016/12/18 22:38:16 joerg Exp $
 
-PKGNAME=       pbulk-0.62
+PKGNAME=       pbulk-0.63
 COMMENT=       Modular bulk build framework
 
 .include "../../pkgtools/pbulk/Makefile.common"
@@ -25,7 +25,7 @@
 SUBST_MESSAGE.tools=   Fixing references to tools
 SUBST_FILES.tools=     pbulk.conf scripts/build scripts/build-client-start \
        scripts/bulkbuild scripts/bulkbuild-rebuild scripts/bulkbuild-restart \
-       scripts/client-clean \
+       scripts/client-clean scripts/client-prepare \
        scripts/pkg-build scripts/pkg-up-to-date scripts/pre-build \
        scripts/report scripts/scan scripts/scan-client-start scripts/upload \
        scripts/compute-packages.awk scripts/create-broken-graph.awk \
@@ -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.54
+PBULK_CONFIG_VERSION=  0.63
 
 INSTALLATION_DIRS=     bin libexec/pbulk share/examples/pbulk
 USE_BSD_MAKEFILE=      yes
diff -r 96cf25c39dcd -r c7660151744a pkgtools/pbulk/PLIST
--- a/pkgtools/pbulk/PLIST      Sun Dec 18 22:08:07 2016 +0000
+++ b/pkgtools/pbulk/PLIST      Sun Dec 18 22:38:16 2016 +0000
@@ -1,10 +1,11 @@
-@comment $NetBSD: PLIST,v 1.5 2009/06/14 18:11:02 joerg Exp $
+@comment $NetBSD: PLIST,v 1.6 2016/12/18 22:38:16 joerg Exp $
 bin/bulkbuild
 bin/bulkbuild-rebuild
 bin/bulkbuild-restart
 libexec/pbulk/build
 libexec/pbulk/build-client-start
 libexec/pbulk/client-clean
+libexec/pbulk/client-prepare
 libexec/pbulk/compute-packages
 libexec/pbulk/create-broken-graph
 libexec/pbulk/create-report
diff -r 96cf25c39dcd -r c7660151744a pkgtools/pbulk/files/pbulk/pbulk.conf
--- a/pkgtools/pbulk/files/pbulk/pbulk.conf     Sun Dec 18 22:08:07 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/pbulk.conf     Sun Dec 18 22:38:16 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: pbulk.conf,v 1.22 2016/10/07 13:22:49 joerg Exp $
+# $NetBSD: pbulk.conf,v 1.23 2016/12/18 22:38:16 joerg Exp $
 
 # Version of the configuration file. This is bumped whenever the default
 # config changes to notify the administrator about updates.
@@ -115,10 +115,11 @@
 keep_wrkdir=no
 keep_prefix=no
 
+client_prepare=@PREFIX@/libexec/pbulk/client-prepare
+client_prepare_action=@PREFIX@/libexec/pbulk/client-clean
 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
-pscan_prepare=@PREFIX@/libexec/pbulk/client-clean
 pscan_start_script=@PREFIX@/libexec/pbulk/scan-client-start
 report_script=@PREFIX@/libexec/pbulk/create-report
 report_html_script=@PREFIX@/libexec/pbulk/create-report-html
diff -r 96cf25c39dcd -r c7660151744a pkgtools/pbulk/files/pbulk/scripts/Makefile
--- a/pkgtools/pbulk/files/pbulk/scripts/Makefile       Sun Dec 18 22:08:07 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/Makefile       Sun Dec 18 22:38:16 2016 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2008/04/04 17:58:59 joerg Exp $
+# $NetBSD: Makefile,v 1.4 2016/12/18 22:38:16 joerg Exp $
 
 SCRIPTS=       build build-client-start bulkbuild bulkbuild-rebuild \
                bulkbuild-restart \
-               client-clean pkg-build pkg-up-to-date pre-build report \
+               client-clean client-prepare \
+               pkg-build pkg-up-to-date pre-build report \
                scan scan-client-start upload \
                compute-packages.awk create-broken-graph.awk \
                create-report-html.awk create-report-txt.awk \
diff -r 96cf25c39dcd -r c7660151744a pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart
--- a/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart      Sun Dec 18 22:08:07 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/bulkbuild-restart      Sun Dec 18 22:38:16 2016 +0000
@@ -1,5 +1,5 @@
 #!@SH@
-# $NetBSD: bulkbuild-restart,v 1.3 2008/10/08 16:43:34 joerg Exp $
+# $NetBSD: bulkbuild-restart,v 1.4 2016/12/18 22:38:16 joerg Exp $
 
 . @PBULK_CONFIG@
 
@@ -36,6 +36,12 @@
 if [ "$restart_build" = "no" ]; then
        ${script_phase_pre_build}
        ${script_phase_scan}
+else
+       case "${master_mode}" in
+       [yY][eE][sS])
+               ${client_prepare}
+               ;;
+       esac
 fi
 ${script_phase_build}
 ${script_phase_report}
diff -r 96cf25c39dcd -r c7660151744a pkgtools/pbulk/files/pbulk/scripts/client-prepare
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/client-prepare Sun Dec 18 22:38:16 2016 +0000
@@ -0,0 +1,41 @@
+#!@SH@
+# $NetBSD: client-prepare,v 1.1 2016/12/18 22:38:16 joerg Exp $
+
+. @PBULK_CONFIG@
+
+set -e
+
+if [ "${config_version}" != "@PBULK_CONFIG_VERSION@" ]; then
+       echo "Your configuration has version ${config_version}."
+       echo "This version of pbulk expects version @PBULK_CONFIG_VERSION@."
+       exit 1
+fi
+
+unique_clients=
+for client in ${scan_clients} ${build_clients}; do
+       case ${unique_clients} in
+       "${client}" | "${client} "* | *" ${client} "* | *" ${client}" )
+               : # exists already
+               ;;
+       *)
+               if [ -n "$unique_clients" ]; then
+                       unique_clients="$unique_clients "
+               fi
+               unique_clients="$unique_clients ${client}"
+               ;;
+       esac
+done
+
+for client in ${unique_clients}; do
+       case ${client} in 
+       *:*)
+               port="-p ${client##*:}"
+               client=${client%%:*}
+               ;;
+       *)
+               ;;
+       esac
+       ssh $port $client "${client_prepare_action}" &
+done
+
+wait
diff -r 96cf25c39dcd -r c7660151744a pkgtools/pbulk/files/pbulk/scripts/scan-client-start
--- a/pkgtools/pbulk/files/pbulk/scripts/scan-client-start      Sun Dec 18 22:08:07 2016 +0000
+++ b/pkgtools/pbulk/files/pbulk/scripts/scan-client-start      Sun Dec 18 22:38:16 2016 +0000
@@ -1,5 +1,5 @@
 #!@SH@
-# $NetBSD: scan-client-start,v 1.4 2015/06/07 22:49:04 joerg Exp $
+# $NetBSD: scan-client-start,v 1.5 2016/12/18 22:38:16 joerg Exp $
 
 . @PBULK_CONFIG@
 
@@ -17,6 +17,8 @@
        extra_pscan_args=""
 fi
 
+${client_prepare}
+
 for client in ${scan_clients}; do
        case ${client} in 
        *:*)
@@ -26,5 +28,5 @@
        *)
                ;;
        esac
-       ssh $port $client "${pscan_prepare} && ${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc}" &
+       ssh $port $client "${pscan} -c ${master_port_scan} -M ${make} ${extra_pscan_args} ${pkgsrc}" &
 done



Home | Main Index | Thread Index | Old Index