From 766f1120a20ff24bf3ed360e5511ab0a681fdc23 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 26 Nov 2015 12:25:45 +0100 Subject: [PATCH] [lib] change remote_tree path --- lib/util-iso.sh | 7 +++++-- lib/util-publish.sh | 15 +++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/util-iso.sh b/lib/util-iso.sh index f489e6b..3f4c00b 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -571,6 +571,9 @@ check_profile_conf(){ if ! is_valid_init "${initsys}";then die "initsys only accepts openrc/systemd value!" fi + if ! is_valid_edition "${edition_type}";then + die "edition_type only accepts official/community/community-minimal/sonar/netrunner value!" + fi if ! is_valid_bool "${autologin}";then die "autologin only accepts true/false value!" fi @@ -615,9 +618,9 @@ load_profile(){ [[ -d ${work_dir}/root-image ]] && check_chroot_version "${work_dir}/root-image" - remote_tree="${edition_type}/${dist_release}" + remote_tree="${edition_type}/$1/${dist_release}" - cache_dir_iso="${cache_dir}/iso/${remote_tree}/$1" + cache_dir_iso="${cache_dir}/iso/${remote_tree}" prepare_dir "${cache_dir_iso}" } diff --git a/lib/util-publish.sh b/lib/util-publish.sh index a3ddff2..7c8855f 100644 --- a/lib/util-publish.sh +++ b/lib/util-publish.sh @@ -10,21 +10,24 @@ # GNU General Public License for more details. create_subtree_ssh(){ - ssh !${remote_user}@${shell_url} mkdir -pv ${remote_target}/${remote_project}/${remote_tree} + local tree=${remote_target}/${remote_project}/${remote_tree} + ssh !${remote_user}@${shell_url} [[ ! -d $tree ]] && mkdir -pv $tree } create_subtree(){ - rsync ${rsync_args[*]} /dev/null ${sf_url}/${edition_type}/ - rsync ${rsync_args[*]} /dev/null ${sf_url}/${remote_tree}/ + msg "Create ${edition_type}/$1 ..." + rsync ${rsync_args[*]} /dev/null ${sf_url}/${edition_type} + rsync ${rsync_args[*]} /dev/null ${sf_url}/$1 + msg "Done" + msg3 "Time ${FUNCNAME}: $(elapsed_time ${timer_start}) minutes" } sync_dir(){ cd $1 load_profile "$1" + ${remote_create} && create_subtree "$1" msg "Start upload [$1] ..." - ${remote_create} && create_subtree - rsync ${rsync_args[*]} ${cache_dir_iso}/ ${sf_url}/${remote_tree}/$1 - + rsync ${rsync_args[*]} ${cache_dir_iso}/ ${sf_url}/${remote_tree}/ msg "Done upload [$1]" msg3 "Time ${FUNCNAME}: $(elapsed_time ${timer_start}) minutes" cd ..