core/sync-up-nodb.sh

60 lines
1.5 KiB
Bash
Raw Normal View History

2010-03-22 01:35:58 +08:00
#!/bin/bash
2010-03-24 04:48:27 +08:00
# 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; either version 2 of the License, or
# (at your option) any later version.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
2010-03-22 01:35:58 +08:00
#
# setup
#
2010-03-27 03:48:44 +08:00
_script_name="UPLOAD PACKAGES"
2010-03-22 01:35:58 +08:00
_build_arch="$_arch"
_cur_repo=`pwd | awk -F '/' '{print $NF}'`
2010-03-27 03:48:44 +08:00
_needed_functions="config_handling helpers messages"
2010-03-22 01:35:58 +08:00
# load functions
for subroutine in ${_needed_functions}
do
source _buildscripts/functions/${subroutine}
done
#
# main
#
2010-03-27 03:48:44 +08:00
sync_up()
{
export RSYNC_PASSWORD=`echo $_rsync_pass`
# move new packages from $ROOT/repos/$REPO/build into thr repo dir
title2 "adding new packages"
mv -v _repo/local/*.pkg.tar.gz _repo/remote/
# sync local -> server
title2 "upload pkgs to server"
rsync -avh --progress --delay-updates _repo/remote/ $_rsync_user@$_rsync_server::$_rsync_dir
2010-03-22 01:35:58 +08:00
}
#
# startup
#
2010-03-27 03:48:44 +08:00
title "${_script_name} - $_cur_repo"
2010-03-22 01:35:58 +08:00
check_configs
load_configs
2010-03-27 03:48:44 +08:00
check_rsync
check_accounts
time sync_up
2010-03-22 01:35:58 +08:00
title "All done"
newline