From 0a4567a7b683c808c34697c908ed703f77dca1d7 Mon Sep 17 00:00:00 2001 From: udeved Date: Tue, 24 Nov 2015 16:58:40 +0100 Subject: [PATCH] deployiso: tweal args and limit opt --- README.md | 28 ++++++++++++++++++++++++++++ bin/deployiso.in | 10 ++++------ conf/manjaro-tools.conf | 3 +++ lib/util-publish.sh | 2 +- lib/util.sh | 2 ++ 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ef5066f..ef88266 100644 --- a/README.md +++ b/README.md @@ -326,3 +326,31 @@ manjaro-chroot -a ~~~ manjaro-chroot /mnt /bin/bash ~~~ + +###7. deployiso + +deployiso is a script to upload a specific iso or a buiildset to SF. +It needs to be run inside the iso-profiles directory. + +~~~ +$ deployiso -h +Usage: deployiso [options] + -p Source folder to upload [default:default] + -c Create new remote edition_type with subtree + -u Update remote iso (diff only) + -l Limit bandwidth in kB/s + -q Query settings and pretend upload + -h This help +~~~ + +######* upload official buildset + +~~~ +deployiso -p official -c +~~~ + +######* upload xfce + +~~~ +deployiso -p xfce -c +~~~ diff --git a/bin/deployiso.in b/bin/deployiso.in index 65a22ec..4b4dc98 100644 --- a/bin/deployiso.in +++ b/bin/deployiso.in @@ -48,10 +48,8 @@ display_settings(){ msg2 "buildset_iso: ${buildset_iso}" msg2 "is_buildset: ${is_buildset}" - if [[ -n ${limit} ]];then - msg "OPTIONS:" - msg2 "limit: ${limit} kB/s" - fi + msg "OPTIONS:" + msg2 "limit: ${limit} kB/s" msg "ARGS:" msg2 "update: ${update}" @@ -80,13 +78,13 @@ pretend=false remote_create=false update=false -rsync_args=(-aP --progress -e ssh) +rsync_args=(-av --progress -e ssh) usage() { echo "Usage: ${0##*/} [options]" echo " -p Source folder to upload [default:${buildset_iso}]" echo ' -c Create new remote edition_type with subtree' - echo ' -u Update remote iso (diff only)' + echo ' -u Update remote iso' echo ' -l Limit bandwidth in kB/s' echo ' -q Query settings and pretend upload' echo ' -h This help' diff --git a/conf/manjaro-tools.conf b/conf/manjaro-tools.conf index a1629a6..f47074e 100644 --- a/conf/manjaro-tools.conf +++ b/conf/manjaro-tools.conf @@ -85,3 +85,6 @@ # the server user # remote_user=[SetUser] + +# set upload bandwidth limit in kB/s +# limit=100 diff --git a/lib/util-publish.sh b/lib/util-publish.sh index 84d4a03..08e076d 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -21,7 +21,7 @@ sync_dir(){ rsync ${rsync_args[*]} /dev/null ${sf_url}/${edition_type}/ rsync ${rsync_args[*]} /dev/null ${sf_url}/${remote_tree}/ fi - rsync ${rsync_args[*]} -v ${cache_dir_iso}/ ${sf_url}/${remote_tree}/$1 + rsync ${rsync_args[*]} ${cache_dir_iso}/ ${sf_url}/${remote_tree}/$1 msg "Done upload [$1]" msg3 "Time ${FUNCNAME}: $(elapsed_time ${timer_start}) minutes" diff --git a/lib/util.sh b/lib/util.sh index c51787a..f1ec30a 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -453,6 +453,8 @@ init_deployiso(){ [[ -z ${remote_user} ]] && remote_user="[SetUser]" [[ -z ${remote_url} ]] && remote_url="sourceforge.net" + + [[ -z ${limit} ]] && limit=100 } load_config(){