diff options
| author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-12-20 13:34:19 (GMT) |
|---|---|---|
| committer | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-12-20 14:09:08 (GMT) |
| commit | 2b185f0b25aede6e2f40a678647c78bb8e7f8638 (patch) | |
| tree | 865c291f251c37233db2af53ad6777863905ad19 | |
| parent | 3bae7863e235559ceefb7b4e0c9bcf65dba76c00 (diff) | |
| download | swift-2b185f0b25aede6e2f40a678647c78bb8e7f8638.zip swift-2b185f0b25aede6e2f40a678647c78bb8e7f8638.tar.bz2 | |
Allow define the debian repositories to upload
This patch uses SWIFT_PACKAGE_PLATFORMS variable and only updates the
repositories that are defined there.
Test-Information
Tested the script on Ubuntu 16.04 when the variable is/not defined
Change-Id: Ie8f65441f558e3ac663eb8493cedd8c0d2630753
| -rw-r--r-- | Swift/Packaging/Debian/update_debian_repo.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Swift/Packaging/Debian/update_debian_repo.sh b/Swift/Packaging/Debian/update_debian_repo.sh index d62a376..26c0d5b 100644 --- a/Swift/Packaging/Debian/update_debian_repo.sh +++ b/Swift/Packaging/Debian/update_debian_repo.sh | |||
| @@ -73,12 +73,23 @@ command -v reprepro >/dev/null 2>&1 || { echo >&2 "This script requires aptly bu | |||
| 73 | 73 | ||
| 74 | mkdir -p $APT_REPO_ROOT | 74 | mkdir -p $APT_REPO_ROOT |
| 75 | 75 | ||
| 76 | if [ -z ${SWIFT_PACKAGE_PLATFORMS+x} ]; then | ||
| 77 | platformsarray=( xenial yakkety jessie sid ) | ||
| 78 | else | ||
| 79 | platformsarray=( $SWIFT_PACKAGE_PLATFORMS ) | ||
| 80 | fi | ||
| 81 | |||
| 76 | # distros | 82 | # distros |
| 77 | for full_distribution_path in $INCOMING_FOLDER/{debian,ubuntu}/*; do | 83 | for full_distribution_path in $INCOMING_FOLDER/{debian,ubuntu}/*; do |
| 78 | distro_version=`basename $full_distribution_path` | 84 | distro_version=`basename $full_distribution_path` |
| 79 | distro_name=$(basename `dirname $full_distribution_path`) | 85 | distro_name=$(basename `dirname $full_distribution_path`) |
| 80 | distro_reprepro_root=${APT_REPO_ROOT}/${distro_name}/${distro_version} | 86 | distro_reprepro_root=${APT_REPO_ROOT}/${distro_name}/${distro_version} |
| 81 | 87 | ||
| 88 | if ! [[ $SWIFT_PACKAGE_PLATFORMS == *"$distro_name"* ]]; then | ||
| 89 | echo "$distro_name was not found in SWIFT_PACKAGE_PLATFORMS. Skipping..." | ||
| 90 | continue | ||
| 91 | fi | ||
| 92 | |||
| 82 | # ensure reprepro diretctory for this distribution version is present | 93 | # ensure reprepro diretctory for this distribution version is present |
| 83 | if [ ! -d "$distro_preprepro_root" ]; then | 94 | if [ ! -d "$distro_preprepro_root" ]; then |
| 84 | echo "Create distribution repository for $distro_name/$distro_version" | 95 | echo "Create distribution repository for $distro_name/$distro_version" |
| @@ -89,7 +100,7 @@ for full_distribution_path in $INCOMING_FOLDER/{debian,ubuntu}/*; do | |||
| 89 | write_reprepo_conf_incoming_to_file "${distro_reprepro_root}/conf/incoming" "$full_distribution_path" | 100 | write_reprepo_conf_incoming_to_file "${distro_reprepro_root}/conf/incoming" "$full_distribution_path" |
| 90 | fi | 101 | fi |
| 91 | 102 | ||
| 92 | # This is workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808558 | 103 | # This is workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808558 |
| 93 | # and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843402 | 104 | # and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843402 |
| 94 | if [ "$distro_name/$distro_version" = "debian/sid" ]; then | 105 | if [ "$distro_name/$distro_version" = "debian/sid" ]; then |
| 95 | sed -i '/dbgsym/ d' $full_distribution_path/*.changes | 106 | sed -i '/dbgsym/ d' $full_distribution_path/*.changes |
Swift