BIGTOP-3136. [Provisioner] Local built repo should have higher priority (#445)
authorEvans Ye <evansye@apache.org>
Fri, 18 Jan 2019 10:00:15 +0000 (18:00 +0800)
committerGitHub <noreply@github.com>
Fri, 18 Jan 2019 10:00:15 +0000 (18:00 +0800)
provisioner/utils/setup-env-debian.sh

index 098155b..b2bd673 100755 (executable)
@@ -25,6 +25,13 @@ service rng-tools start
 
 if [ $enable_local_repo == "true" ]; then
     echo "deb file:///bigtop-home/output/apt bigtop contrib" > /etc/apt/sources.list.d/bigtop-home_output.list
+    # In BIGTOP-2796 repo installed by puppet has priority 900, here we set higher priority for local repo
+    cat > /etc/apt/preferences.d/bigtop-home_output.pref << EOF
+Explanation: apt: bigtop-home_output. set local repo to higher priority.
+Package: *
+Pin: release v=*-SNAPSHOT
+Pin-Priority: 901
+EOF
     apt-get update
 else
     apt-get install -y apt-transport-https