From 491936cf70c90a739d00714831196acea67c6547 Mon Sep 17 00:00:00 2001 From: Drew Walters Date: Mon, 18 Mar 2019 14:24:49 +0000 Subject: [PATCH] mini-mirror: Ignore src config for publishing Currently, mini-mirror honors per-source configuration files for the creation of mirrors and publishing; however, some options exposed by Aptly have a different impact depending on the operation. This commit removes the per-source configuration file option from the publishing process and defaults to the aptly config file supplied for all sources in order to circumvent this issue. Change-Id: I87659725918e776482aabccb97195216047f4c77 --- mini-mirror/tools/publish_snapshots.sh | 29 +++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/mini-mirror/tools/publish_snapshots.sh b/mini-mirror/tools/publish_snapshots.sh index 0477d38..65b0871 100755 --- a/mini-mirror/tools/publish_snapshots.sh +++ b/mini-mirror/tools/publish_snapshots.sh @@ -55,21 +55,30 @@ for source_prefix in /opt/sources/*; do name="${source}-${component}" mirrors+=("$name") - aptly -config="${conf}" mirror create -filter="${packages}" \ - -filter-with-deps "${name}" "${repo}" "${dist}" "${component}" - aptly -config="${conf}" mirror update "${name}" - aptly -config="${conf}" snapshot create "${name}" from mirror "${name}" + aptly mirror create \ + -config="${conf}" \ + -filter="${packages}" \ + -filter-with-deps \ + "${name}" "${repo}" "${dist}" "${component}" + + aptly mirror update -config="${conf}" "${name}" + aptly snapshot create -config="${conf}" "${name}" from mirror "${name}" done - # Publish snapshot and sign if a key passphrase is provided + # Publish snapshot and sign if a key passphrase is provided. com_list=$(echo "${components[@]}" | tr ' ' ',') if [ ! -z "$1" ]; then - aptly -config="${conf}" publish snapshot -component="${com_list}" \ - -distribution="${dist}" -batch=true -passphrase="${1}" \ - "${mirrors[@]}" "${source_prefix:13}" + aptly publish snapshot \ + -batch=true \ + -component="${com_list}" \ + -distribution="${dist}" \ + -passphrase="${1}" \ + "${mirrors[@]}" "${source_prefix:13}" else - aptly -config="${conf}" publish snapshot -component="${com_list}" \ - -distribution="${dist}" "${mirrors[@]}" "${source_prefix:13}" + aptly publish snapshot \ + -component="${com_list}" \ + -distribution="${dist}" \ + "${mirrors[@]}" "${source_prefix:13}" fi done done