From e2e77e7cb056f353a6189a53df6e10952d2036d4 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 20 Jun 2013 00:17:23 +0200 Subject: new option for remote mode '-n' to mount local builds (remote/builds/) to /export/builds --- mltk | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'mltk') diff --git a/mltk b/mltk index a42f46f0..b0243c8d 100755 --- a/mltk +++ b/mltk @@ -133,7 +133,7 @@ read_params() { case "$1" in server) MODE="SERVER" - [ "$#" -lt "2" ] && perror "Missing argument to -s (expecting remote host)" + [ "$#" -lt "2" ] && perror "Missing argument to server-mode flag 'server' (expecting remote host)" REMOTE_IP="$2" shift ;; @@ -149,11 +149,11 @@ read_params() { shift # A target represents a set of modules to be build for a specific stage. - # i.e. a very basic stage31 includes: + # i.e. a very basic stage31 target should includes: # - busybox # - kernel # - rootfs-stage31 - # a basic stage32 would also contain these and additionally: + # a basic stage32 target could add: # - systemd # - dbus # - pam @@ -165,7 +165,7 @@ read_params() { if [[ $1 != "-"* ]]; then TARGET=$1 shift - elif [[ $1 != "-s" ]]; then + elif [[ $1 != "-s" ]] && [[ $1 != "-n" ]]; then perror "A target is required. None given." fi @@ -205,13 +205,20 @@ read_params() { ;; -e) [ "$#" -lt "1" ] && perror "Missing argument to -e" - [ "$MODE" != "SERVER" ] && perror "-e can only be used in server mode" [[ "stage31|stage32|addons" != *"$1"* ]] && perror "Wrong type specified. Muste be either 'stage31', 'stage32' or 'addons'" SERVER_EXPORT="1" SERVER_EXPORT_TYPE="$1" shift continue ;; + -n) + if [ "$MODE" == "REMOTE" ]; then + [ "x" != "x$1" ] && perror "'-n' accepts no parameters. Given: $1" + REMOTE_EXPORT="1" + fi + shift + continue + ;; *) pwarning "Unknown flag to target: $PARAM" print_usage @@ -230,15 +237,16 @@ read_params() { # exit if no command - [[ $SERVER_CLEAN == 0 && $SERVER_EXPORT == 0 && $REMOTE_CLEAN == 0 && $REMOTE_BUILD == 0 && $SERVER_SYNC == 0 ]] && print_usage && exit 1 + [[ $SERVER_CLEAN == 0 && $SERVER_EXPORT == 0 && $REMOTE_CLEAN == 0 && $REMOTE_BUILD == 0 && $SERVER_SYNC == 0 && $REMOTE_EXPORT == 0 ]] && print_usage && exit 1 } run() { - if [[ $REMOTE_CLEAN == 1 || $REMOTE_BUILD == 1 ]]; then + if [[ $REMOTE_CLEAN == 1 || $REMOTE_BUILD == 1 || $REMOTE_EXPORT == 1 ]]; then [[ $REMOTE_DEBUG == 1 ]] && unset_quiet || set_quiet . "${REMOTE_SETUP_TARGET}" || perror "Cannot source ${REMOTE_SETUP_TARGET}" [[ $REMOTE_CLEAN == 1 ]] && clean_modules $TARGET $REMOTE_LIST_CLEAN [[ $REMOTE_BUILD == 1 ]] && generate_target $TARGET $REMOTE_LIST_BUILD + [[ $REMOTE_EXPORT == 1 ]] && export_builds fi if [[ $SERVER_CLEAN == 1 || $SERVER_EXPORT == 1 || $SERVER_SYNC == 1 ]]; then [[ $SERVER_DEBUG == 1 ]] && unset_quiet || set_quiet -- cgit v1.2.3-55-g7522