Merge remote-tracking branch 'origin/pr/254'

* origin/pr/254:
  archlinux: improve pacman proxy implementation
This commit is contained in:
Marek Marczykowski-Górecki 2020-10-29 04:19:02 +01:00
commit 0fd872f717
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -119,21 +119,26 @@ fi
# Pacman (archlinux) also
if [ -d /etc/pacman.d ]; then
if [ -n "$PROXY_ADDR" ]; then
cat > /etc/pacman.d/01-qubes-proxy.conf <<EOF
mkdir -p /run/qubes/bin
cat > /run/qubes/bin/pacman <<EOF
#!/bin/bash
### This file is automatically generated by Qubes ($0 script).
### All modifications here will be lost.
### If you want to override some of this settings, create another file under
### /etc/pacman.d
[options]
# Use Qubes Update Proxy
XferCommand = /usr/bin/env ALL_PROXY=$PROXY_ADDR /usr/bin/curl -C - -f -o %o %u
exec env ALL_PROXY=$PROXY_ADDR /usr/bin/pacman "\$@"
EOF
chmod +x /run/qubes/bin/pacman
cat > /etc/profile.d/qubes-proxy.sh << EOF
### This file is automatically generated by Qubes ($0 script).
### All modifications here will be lost.
export PATH=/run/qubes/bin:\$PATH
EOF
else
rm -r /etc/pacman.d/01-qubes-proxy.conf
rm -f /run/qubes/bin/pacman
rm -f /etc/profile.d/qubes-proxy.sh
fi
fi
# DNF configuration doesn't support including other files
# https://bugzilla.redhat.com/show_bug.cgi?id=1352234
if [ -e /etc/dnf/dnf.conf ]; then