From 905140c24604cf9d213387b53ec5bc9cb1bffc73 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 18 Aug 2021 03:42:46 +0000 Subject: [PATCH] Bug 1726117 - Add hack for new versions of apt. r=taskgraph-reviewers,bhearsum to work around issues with redirections. Differential Revision: https://phabricator.services.mozilla.com/D122829 --- taskcluster/docker/debian-raw/Dockerfile | 5 +++++ taskcluster/docker/debian-raw/taskcluster-hack.sh | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100755 taskcluster/docker/debian-raw/taskcluster-hack.sh diff --git a/taskcluster/docker/debian-raw/Dockerfile b/taskcluster/docker/debian-raw/Dockerfile index 3ddfee34a7f7..1734caaae0b9 100644 --- a/taskcluster/docker/debian-raw/Dockerfile +++ b/taskcluster/docker/debian-raw/Dockerfile @@ -10,6 +10,8 @@ CMD ["/bin/bash", "--login"] # %include taskcluster/docker/recipes/setup_packages.sh COPY topsrcdir/taskcluster/docker/recipes/setup_packages.sh /usr/local/sbin/ +COPY taskcluster-hack.sh /usr/local/sbin + ARG DIST ARG SNAPSHOT ARG TASKCLUSTER_ROOT_URL @@ -32,6 +34,9 @@ RUN if [ -n "$SNAPSHOT" -a -n "$DIST" ]; then for s in debian_$DIST debian_$DIST echo 'APT::Install-Recommends "false";'; \ echo 'Acquire::Check-Valid-Until "false";'; \ echo 'Acquire::Retries "5";'; \ + if dpkg --compare-versions $(apt --version | awk '{print $2}') ge 2.1.15; then \ + echo 'dir::bin::methods::https "/usr/local/sbin/taskcluster-hack.sh";'; \ + fi; \ ) > /etc/apt/apt.conf.d/99taskcluster && \ ( echo 'Package: *'; \ echo 'Pin: origin "'$TASKCLUSTER_ROOT_URL'"' | sed 's,https://,,'; \ diff --git a/taskcluster/docker/debian-raw/taskcluster-hack.sh b/taskcluster/docker/debian-raw/taskcluster-hack.sh new file mode 100755 index 000000000000..eecac021ecba --- /dev/null +++ b/taskcluster/docker/debian-raw/taskcluster-hack.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# APT version 2.1.15 and newer changed how they handle quoting in redirections +# in a way that breaks the setup for APT repos in taskcluster artifacts +# (unfortunately, there's also no setup on the taskcluster end that would work +# with both old and newer versions of APT, short of removing redirections +# entirely). +/usr/lib/apt/methods/https | sed -u '/^New-URI:/s/+/%2b/g'