7
VERBOSITY=${VERBOSITY:-0}
10
ARCH:arch RELEASE:release REGION:cloud VIRT:virt STORE:root_store
13
error() { echo "$@" 1>&2; }
14
fail() { [ $# -eq 0 ] || error "$@"; exit "$RC_FAIL"; }
16
[ "${VERBOSITY}" -lt "$1" ] && return
24
This program is expected to be called by sstream-sync.
26
sstream-sync "--hook=$0" \\
27
http://cloud-images.ubuntu.com/eightprotons/ streams/v1/index.js
29
It filters output based on environment variables:
30
$(for m in ${MAP[@]}; do echo " ${m}"; done)
33
* VIRT=hvm REGION=us-east-1 ./tools/tenv sstream-sync --max=1 \\
34
"--hook=$0" http://cloud-images.ubuntu.com/eightprotons/ \\
40
local ename iname pair
41
for pair in "${MAP[@]}"; do
44
[ -n "${!ename}" -a -n "${!iname}" -a "${!ename}" != "${!iname}" ] &&
56
[ "$1" = "--help" -o "$1" = "-h" -o "$1" = "usage" ] &&
59
[ $# -eq 0 ] || fail "Unexpected arguments. See --help"
62
{ Usage 1>&2; fail "HOOK not available in environment"; }
66
filter_item|filter_product)
67
is_excluded && return "${RC_FILTER_EXCLUDE}"
68
return "${RC_FILTER_INCLUDE}"
71
case "${content_id}" in
72
*:aws) return "${RC_FILTER_INCLUDE}";;
73
*) return "${RC_FILTER_EXCLUDE}";;
77
echo "$cloud ${id} ${root_store}/${virt}/${pubname}";;
78
filter_*) return "${RC_FILTER_INCLUDE}";;