aboutsummaryrefslogtreecommitdiffstats
path: root/.travis/build-pkgs
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-09-23 01:17:05 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-09-23 01:17:05 +0200
commit5840a4815fb4e34c957a0edca4d0563f5b06d8ff (patch)
tree7b32a28ff2bdecb6353a376578cb8cfc7d5ecd18 /.travis/build-pkgs
parent170b830d22fffe1073f3cfc32a8c08e89b4a6cdd (diff)
downloadaports-5840a4815fb4e34c957a0edca4d0563f5b06d8ff.tar.gz
aports-5840a4815fb4e34c957a0edca4d0563f5b06d8ff.tar.bz2
aports-5840a4815fb4e34c957a0edca4d0563f5b06d8ff.tar.xz
travis: use only repositories at same or higher level than target repo
Diffstat (limited to '.travis/build-pkgs')
-rwxr-xr-x.travis/build-pkgs20
1 files changed, 20 insertions, 0 deletions
diff --git a/.travis/build-pkgs b/.travis/build-pkgs
index b1dd9cca4e..57bbadd9f3 100755
--- a/.travis/build-pkgs
+++ b/.travis/build-pkgs
@@ -31,6 +31,24 @@ changed_abuilds() {
ap builddirs -d "$(pwd)/$repo" $aports 2>/dev/null | xargs -I% basename %
}
+# Replaces /etc/apk/repositories with repositories at $MIRROR_URI that are on
+# the same or higher level than the given repo (main > community > testing)
+# and after that runs `apk update`.
+#
+# $1: the target repository; main, community, or testing
+set_repositories_for() {
+ local target_repo="$1"
+ local repos_file='/etc/apk/repositories'
+
+ printf '' > $repos_file
+ local repo; for repo in main community testing; do
+ printf '%s\n' "$MIRROR_URI/$repo" >> $repos_file
+ [ "$repo" = "$target_repo" ] && break
+ done
+
+ apk update
+}
+
cd "$CLONE_DIR"
@@ -53,6 +71,8 @@ echo 'Diffstat:'
git --no-pager diff --color --stat "$commit_range"
for repo in $(changed_repos "$commit_range"); do
+ set_repositories_for "$repo"
+
for pkgname in $(changed_abuilds "$repo" "$commit_range"); do
qname="$repo/$pkgname"