diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-09-23 01:17:05 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-09-23 01:17:05 +0200 |
commit | 5840a4815fb4e34c957a0edca4d0563f5b06d8ff (patch) | |
tree | 7b32a28ff2bdecb6353a376578cb8cfc7d5ecd18 /.travis | |
parent | 170b830d22fffe1073f3cfc32a8c08e89b4a6cdd (diff) | |
download | alpine_aports-5840a4815fb4e34c957a0edca4d0563f5b06d8ff.tar.bz2 alpine_aports-5840a4815fb4e34c957a0edca4d0563f5b06d8ff.tar.xz alpine_aports-5840a4815fb4e34c957a0edca4d0563f5b06d8ff.zip |
travis: use only repositories at same or higher level than target repo
Diffstat (limited to '.travis')
-rwxr-xr-x | .travis/build-pkgs | 20 | ||||
-rw-r--r-- | .travis/common.sh | 1 | ||||
-rwxr-xr-x | .travis/install-alpine | 2 | ||||
-rw-r--r-- | .travis/repositories | 3 |
4 files changed, 22 insertions, 4 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() { | |||
31 | ap builddirs -d "$(pwd)/$repo" $aports 2>/dev/null | xargs -I% basename % | 31 | ap builddirs -d "$(pwd)/$repo" $aports 2>/dev/null | xargs -I% basename % |
32 | } | 32 | } |
33 | 33 | ||
34 | # Replaces /etc/apk/repositories with repositories at $MIRROR_URI that are on | ||
35 | # the same or higher level than the given repo (main > community > testing) | ||
36 | # and after that runs `apk update`. | ||
37 | # | ||
38 | # $1: the target repository; main, community, or testing | ||
39 | set_repositories_for() { | ||
40 | local target_repo="$1" | ||
41 | local repos_file='/etc/apk/repositories' | ||
42 | |||
43 | printf '' > $repos_file | ||
44 | local repo; for repo in main community testing; do | ||
45 | printf '%s\n' "$MIRROR_URI/$repo" >> $repos_file | ||
46 | [ "$repo" = "$target_repo" ] && break | ||
47 | done | ||
48 | |||
49 | apk update | ||
50 | } | ||
51 | |||
34 | 52 | ||
35 | cd "$CLONE_DIR" | 53 | cd "$CLONE_DIR" |
36 | 54 | ||
@@ -53,6 +71,8 @@ echo 'Diffstat:' | |||
53 | git --no-pager diff --color --stat "$commit_range" | 71 | git --no-pager diff --color --stat "$commit_range" |
54 | 72 | ||
55 | for repo in $(changed_repos "$commit_range"); do | 73 | for repo in $(changed_repos "$commit_range"); do |
74 | set_repositories_for "$repo" | ||
75 | |||
56 | for pkgname in $(changed_abuilds "$repo" "$commit_range"); do | 76 | for pkgname in $(changed_abuilds "$repo" "$commit_range"); do |
57 | qname="$repo/$pkgname" | 77 | qname="$repo/$pkgname" |
58 | 78 | ||
diff --git a/.travis/common.sh b/.travis/common.sh index bf4b2ff945..27260128aa 100644 --- a/.travis/common.sh +++ b/.travis/common.sh | |||
@@ -3,6 +3,7 @@ | |||
3 | readonly ALPINE_ROOT='/mnt/alpine' | 3 | readonly ALPINE_ROOT='/mnt/alpine' |
4 | readonly ALPINE_USER='alpine' | 4 | readonly ALPINE_USER='alpine' |
5 | readonly CLONE_DIR="${CLONE_DIR:-$(pwd)}" | 5 | readonly CLONE_DIR="${CLONE_DIR:-$(pwd)}" |
6 | readonly MIRROR_URI='http://dl-cdn.alpinelinux.org/alpine/edge' | ||
6 | 7 | ||
7 | # Runs commands inside the Alpine chroot. | 8 | # Runs commands inside the Alpine chroot. |
8 | alpine_run() { | 9 | alpine_run() { |
diff --git a/.travis/install-alpine b/.travis/install-alpine index 756bbd8baf..a9ac855529 100755 --- a/.travis/install-alpine +++ b/.travis/install-alpine | |||
@@ -21,8 +21,8 @@ title 'Installing Alpine Linux' | |||
21 | mkdir -p "$ALPINE_ROOT"/etc/apk | 21 | mkdir -p "$ALPINE_ROOT"/etc/apk |
22 | cd "$ALPINE_ROOT" | 22 | cd "$ALPINE_ROOT" |
23 | 23 | ||
24 | echo "$MIRROR_URI/main" > etc/apk/repositories | ||
24 | cp -R "$CLONE_DIR"/.travis/keys etc/apk/keys | 25 | cp -R "$CLONE_DIR"/.travis/keys etc/apk/keys |
25 | cp "$CLONE_DIR"/.travis/repositories etc/apk/repositories | ||
26 | cp /etc/resolv.conf etc/resolv.conf | 26 | cp /etc/resolv.conf etc/resolv.conf |
27 | 27 | ||
28 | /tmp/sbin/apk.static \ | 28 | /tmp/sbin/apk.static \ |
diff --git a/.travis/repositories b/.travis/repositories deleted file mode 100644 index 4bfbbae6ef..0000000000 --- a/.travis/repositories +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | http://dl-cdn.alpinelinux.org/alpine/edge/main | ||
2 | http://dl-cdn.alpinelinux.org/alpine/edge/community | ||
3 | http://dl-cdn.alpinelinux.org/alpine/edge/testing | ||