summaryrefslogtreecommitdiff
path: root/stage-pkg
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-10-15 13:34:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-10-15 13:34:25 +0200
commitc5fcb8bbf8ec50068313ae0a1fe508f648799658 (patch)
treed8bbde91fc7be395e83769522106ea27ca9a2c11 /stage-pkg
parentaee69ba1d21c55b4dbbe3891661361feb1c32a9c (diff)
Staging scripts updates for queue.stage
Diffstat (limited to 'stage-pkg')
-rwxr-xr-xstage-pkg93
1 files changed, 59 insertions, 34 deletions
diff --git a/stage-pkg b/stage-pkg
index 5814d21..fe876c6 100755
--- a/stage-pkg
+++ b/stage-pkg
@@ -10,6 +10,7 @@
#
# -g
# Distribute and regenerate only without publishing the repository.
+# In this mode of no packages is specified, then just regenerate.
#
# -p
# Publish only without distributing and regenerating the repository.
@@ -17,6 +18,13 @@
# -q
# Put packages into the queue instead of staging. Implies -d.
#
+# -Q
+# Put packages into staging queue instead of staging.
+#
+# --min-bpkg-version <ver>
+#
+# Pass --min-bpkg-version to bpkg-rep-create.
+#
usage="usage: etc/stage-pkg [<options>] <group> <dir>..."
rsync_ops="--progress"
@@ -45,6 +53,7 @@ gen_only=
pub_only=
group=
dirs=()
+rep_create_ops=()
while [ $# -gt 0 ]; do
case $1 in
@@ -72,6 +81,17 @@ while [ $# -gt 0 ]; do
dist_only=true
shift
;;
+ -Q)
+ repo_name="QUEUE.STAGE.BUILD2.ORG"
+ repo_dir="staging/queue/1"
+ repo_host1="stage.build2.org:/var/bpkg/queue/1"
+ shift
+ ;;
+ --min-bpkg-version)
+ shift
+ rep_create_ops+=(--min-bpkg-version "$1")
+ shift
+ ;;
*)
if [ -z "$group" ]; then
group="$1"
@@ -85,45 +105,50 @@ done
if [ -z "$pub_only" ]; then
- if [ -z "$group" -o "${#dirs[@]}" -eq 0 ]; then
- error "$usage"
- fi
+ # In the -g mode skip distributing if no packages are specified.
+ #
+ if [ -z "$gen_only" -o -n "$group" ]; then
- mkdir -p /tmp/dist
+ if [ -z "$group" -o "${#dirs[@]}" -eq 0 ]; then
+ error "$usage"
+ fi
- # Dist individual packages into the repository.
- #
- function dist() # <group> <dir>
- {
- local o="$repo_dir/$1"
- local b="$(basename $2)"
- local d="$2-default"
-
- # If *-default/ exists, use that (old style out of tree configuration).
- # Otherwise, use the source directory itself (new style forwarded
- # configuration).
+ mkdir -p /tmp/dist
+
+ # Dist individual packages into the repository.
#
- if ! test -d "$d"; then
- d="$2"
+ function dist() # <group> <dir>
+ {
+ local o="$repo_dir/$1"
+ local b="$(basename $2)"
+ local d="$2-default"
+
+ # If *-default/ exists, use that (old style out of tree configuration).
+ # Otherwise, use the source directory itself (new style forwarded
+ # configuration).
+ #
if ! test -d "$d"; then
- error "neither $2-default nor $2 exist"
+ d="$2"
+ if ! test -d "$d"; then
+ error "neither $2-default nor $2 exist"
+ fi
fi
- fi
- mkdir -p "$o"
+ mkdir -p "$o"
- # Clean up old packages.
- #
- if [ -n "$clean" ]; then
- rm -f "$o/$b"-*
- fi
+ # Clean up old packages.
+ #
+ if [ -n "$clean" ]; then
+ rm -f "$o/$b"-*
+ fi
- b "dist($d/)" config.dist.root=/tmp/dist "config.dist.archives=$owd/$o/tar.gz"
- }
+ b "dist($d/)" config.dist.root=/tmp/dist "config.dist.archives=$owd/$o/tar.gz"
+ }
- for d in "${dirs[@]}"; do
- dist "$group" "$d"
- done
+ for d in "${dirs[@]}"; do
+ dist "$group" "$d"
+ done
+ fi
if [ -n "$dist_only" ]; then
exit 0
@@ -133,10 +158,10 @@ if [ -z "$pub_only" ]; then
#
info "Insert $repo_name signing key and press Enter"
read
- etc/rep-update "$repo_dir/" \
- --openssl-option -engine --openssl-option pkcs11 \
- --openssl-option -keyform --openssl-option engine \
- --key "label_SIGN key"
+ etc/rep-update "$repo_dir/" "${rep_create_ops[@]}" \
+ --openssl-option -engine --openssl-option pkcs11 \
+ --openssl-option -keyform --openssl-option engine \
+ --key "label_SIGN key"
if [ -n "$gen_only" ]; then
exit 0