|
|
|
@ -12,6 +12,7 @@ script_name=$(basename $0) |
|
|
|
|
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
|
|
|
|
push=0 |
|
|
|
|
push_repo=0 |
|
|
|
|
push_testing_repo=0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ! source ${script_dir}/lib.sh; then |
|
|
|
@ -32,6 +33,7 @@ usage() { |
|
|
|
|
echo " -n: Dryrun; Output commands, but don't do anything." |
|
|
|
|
echo " -d: Show debug info." |
|
|
|
|
echo " -r: Push the archzfs repositories." |
|
|
|
|
echo " -t: Push the archzfs testing repositories." |
|
|
|
|
echo " -p: Commit changes and push." |
|
|
|
|
echo |
|
|
|
|
echo "Modes:" |
|
|
|
@ -73,6 +75,8 @@ for (( a = 0; a < $#; a++ )); do |
|
|
|
|
push=1 |
|
|
|
|
elif [[ ${args[$a]} == "-r" ]]; then |
|
|
|
|
push_repo=1 |
|
|
|
|
elif [[ ${args[$a]} == "-t" ]]; then |
|
|
|
|
push_testing_repo=1 |
|
|
|
|
elif [[ ${args[$a]} == "-h" ]]; then |
|
|
|
|
usage |
|
|
|
|
else |
|
|
|
@ -82,7 +86,7 @@ for (( a = 0; a < $#; a++ )); do |
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ ${#modes[@]} -eq 0 && ${push_repo} -eq 0 ]]; then |
|
|
|
|
if [[ ${#modes[@]} -eq 0 && ${push_repo} -eq 0 && ${push_testing_repo} -eq 0 ]]; then |
|
|
|
|
echo |
|
|
|
|
error "A mode must be selected!" |
|
|
|
|
usage |
|
|
|
@ -138,8 +142,19 @@ push_repo() { |
|
|
|
|
run_cmd_check 1 "Could not push packages to remote repo!" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
push_testing_repo() { |
|
|
|
|
if [[ ${dry_run} -eq 1 ]]; then |
|
|
|
|
dry="-n" |
|
|
|
|
elif [[ ${push_testing_repo} -ne 1 ]]; then |
|
|
|
|
return |
|
|
|
|
fi |
|
|
|
|
run_cmd "rsync -vrtlh --delete-before ${repo_basepath}/${repo_basename}-testing ${repo_basepath}/archive_${repo_basename}-testing ${remote_login}:${repo_remote_basepath}/ ${dry}" |
|
|
|
|
run_cmd_check 1 "Could not push packages to remote testing repo!" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
push_repo |
|
|
|
|
push_testing_repo |
|
|
|
|
if [[ ${#modes[@]} -eq 0 ]]; then |
|
|
|
|
exit |
|
|
|
|
fi |
|
|
|
|