main() {
local gpgkey
- local tqueue
- local dqueue
+ local iqueue
+ local oqueue
- opt_add_arg "k" "gpgkey" "yes" "" "The GPG key id to use"
- opt_add_arg "t" "task-queue" "yes" "" "The queue to watch for tasks"
- opt_add_arg "d" "done-queue" "yes" "" "The queue to place build artifacts"
+ opt_add_arg "k" "gpgkey" "rv" "" "The GPG key id to use"
+ opt_add_arg "i" "input" "rv" "" "The queue from where build tasks will be taken"
+ opt_add_arg "o" "output" "rv" "" "The queue where build artifacts will be placed"
if ! opt_parse "$@"; then
return 1
fi
gpgkey=$(opt_get "gpgkey")
- tqueue=$(opt_get "task-queue")
- dqueue=$(opt_get "done-queue")
+ iqueue=$(opt_get "input")
+ oqueue=$(opt_get "output")
- if [[ -z "$gpgkey" ]]; then
- log_error "Need a GPG key id"
- return 1
- fi
-
- if [[ -z "$tqueue" ]]; then
- log_error "Need a task queue"
- return 1
- fi
-
- if [[ -z "$dqueue" ]]; then
- log_error "Need a queue for finished tasks"
- return 1
- fi
-
- inst_start dispatch_tasks "$gpgkey" "$tqueue" "$dqueue"
+ inst_start dispatch_tasks "$gpgkey" "$iqueue" "$oqueue"
return 0
}
local gpgkey
local desc
- opt_add_arg "n" "name" "yes" "" "The name of the repository"
- opt_add_arg "p" "path" "yes" "" "The path to the repository"
- opt_add_arg "c" "codename" "yes" "stable" "The codename of the distribution (default: stable)"
- opt_add_arg "a" "arch" "yes" "" "Comma separated list of supported architectures"
- opt_add_arg "k" "gpgkey" "yes" "" "The GPG key used for signing"
- opt_add_arg "d" "description" "yes" "" "Description of the repository"
- opt_add_arg "i" "incoming" "yes" "" "The queue to watch for incoming packages"
+ opt_add_arg "n" "name" "rv" "" "The name of the repository"
+ opt_add_arg "o" "output" "rv" "" "The path to the repository"
+ opt_add_arg "c" "codename" "v" "stable" "The codename of the distribution (default: stable)"
+ opt_add_arg "a" "arch" "rv" "" "Comma separated list of supported architectures"
+ opt_add_arg "k" "gpgkey" "rv" "" "The GPG key used for signing"
+ opt_add_arg "d" "description" "rv" "" "Description of the repository"
+ opt_add_arg "i" "input" "rv" "" "The queue to watch for incoming packages"
if ! opt_parse "$@"; then
return 1
fi
- path=$(opt_get "path")
+ path=$(opt_get "output")
codename=$(opt_get "codename")
- incoming=$(opt_get "incoming")
+ incoming=$(opt_get "input")
name=$(opt_get "name")
arch=$(opt_get "arch")
gpgkey=$(opt_get "gpgkey")
desc=$(opt_get "description")
- if [[ -z "$path" ]] || [[ -z "$incoming" ]] || [[ -z "$name" ]] ||
- [[ -z "$arch" ]] || [[ -z "$gpgkey" ]] || [[ -z "$desc" ]]; then
- log_error "Missing required arguments"
- return 1
- fi
-
if ! [ -d "$path" ]; then
# Create new repository
log_info "Initializing repository $name:$codename in $path"
local queue
local watch
- opt_add_arg "r" "repo" "yes" "" "Repository to watch (format: /repo/path[#branch])" watchlist_add
- opt_add_arg "q" "queue" "yes" "" "Queue used to distribute work"
+ opt_add_arg "i" "input" "rv" "" "Repository to watch (format: /repo/path[#branch])" \
+ watchlist_add
+ opt_add_arg "o" "output" "rv" "" "Queue where output shall be placed"
if ! opt_parse "$@"; then
return 1
fi
- queue=$(opt_get "queue")
-
- if [ -z "$queue" ]; then
- log_error "Need a queue"
- return 1
- fi
-
+ queue=$(opt_get "input")
watches=()
for watch in "${watchlist[@]}"; do