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
This commit is contained in:
Mike Hommey 2021-08-18 03:42:46 +00:00
Родитель fb8c00012f
Коммит 905140c246
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -10,6 +10,8 @@ CMD ["/bin/bash", "--login"]
# %include taskcluster/docker/recipes/setup_packages.sh # %include taskcluster/docker/recipes/setup_packages.sh
COPY topsrcdir/taskcluster/docker/recipes/setup_packages.sh /usr/local/sbin/ COPY topsrcdir/taskcluster/docker/recipes/setup_packages.sh /usr/local/sbin/
COPY taskcluster-hack.sh /usr/local/sbin
ARG DIST ARG DIST
ARG SNAPSHOT ARG SNAPSHOT
ARG TASKCLUSTER_ROOT_URL 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 'APT::Install-Recommends "false";'; \
echo 'Acquire::Check-Valid-Until "false";'; \ echo 'Acquire::Check-Valid-Until "false";'; \
echo 'Acquire::Retries "5";'; \ 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 && \ ) > /etc/apt/apt.conf.d/99taskcluster && \
( echo 'Package: *'; \ ( echo 'Package: *'; \
echo 'Pin: origin "'$TASKCLUSTER_ROOT_URL'"' | sed 's,https://,,'; \ echo 'Pin: origin "'$TASKCLUSTER_ROOT_URL'"' | sed 's,https://,,'; \

Просмотреть файл

@ -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'