2015-11-12 19:03:21 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
2015-11-26 01:21:16 +01:00
|
|
|
create_subtree_ssh(){
|
2015-11-26 12:25:45 +01:00
|
|
|
local tree=${remote_target}/${remote_project}/${remote_tree}
|
|
|
|
ssh !${remote_user}@${shell_url} [[ ! -d $tree ]] && mkdir -pv $tree
|
2015-11-12 19:03:21 +01:00
|
|
|
}
|
|
|
|
|
2015-11-26 01:21:16 +01:00
|
|
|
create_subtree(){
|
2015-11-30 21:35:30 +01:00
|
|
|
msg2 "Create (${edition_type}/$1/${dist_release}) ..."
|
2015-11-26 16:10:34 +01:00
|
|
|
rsync ${rsync_args[*]} /dev/null ${sf_url}/${edition_type}/
|
|
|
|
rsync ${rsync_args[*]} /dev/null ${sf_url}/${edition_type}/$1/
|
2015-11-27 12:22:38 +01:00
|
|
|
rsync ${rsync_args[*]} /dev/null ${sf_url}/${edition_type}/$1/${dist_release}/
|
|
|
|
msg2 "Done"
|
2015-11-26 12:25:45 +01:00
|
|
|
msg3 "Time ${FUNCNAME}: $(elapsed_time ${timer_start}) minutes"
|
2015-11-26 01:21:16 +01:00
|
|
|
}
|
|
|
|
|
2015-11-30 18:59:57 +01:00
|
|
|
prepare_transfer(){
|
|
|
|
remote_tree="${edition_type}/$1/${dist_release}/${arch}"
|
2015-11-30 22:49:48 +01:00
|
|
|
src_tree="${cache_dir_iso}/${remote_tree}"
|
2015-11-30 18:59:57 +01:00
|
|
|
}
|
|
|
|
|
2015-11-17 17:04:04 +01:00
|
|
|
sync_dir(){
|
2015-11-30 18:59:57 +01:00
|
|
|
eval_edition "$1"
|
2015-11-30 21:55:54 +01:00
|
|
|
cd ${edition_type}/$1
|
2015-11-30 18:59:57 +01:00
|
|
|
prepare_transfer "$1"
|
2015-11-26 12:25:45 +01:00
|
|
|
${remote_create} && create_subtree "$1"
|
2015-11-23 22:57:17 +01:00
|
|
|
msg "Start upload [$1] ..."
|
2015-11-30 22:49:48 +01:00
|
|
|
rsync ${rsync_args[*]} ${src_tree}/ ${sf_url}/${remote_tree}/
|
2015-11-23 22:57:17 +01:00
|
|
|
msg "Done upload [$1]"
|
|
|
|
msg3 "Time ${FUNCNAME}: $(elapsed_time ${timer_start}) minutes"
|
2015-11-30 18:59:57 +01:00
|
|
|
cd ../..
|
2015-11-12 19:03:21 +01:00
|
|
|
}
|