archlinux: improve pacman proxy implementation

This commit is contained in:
ejose19 2020-10-23 14:46:58 -03:00 committed by ejose19
parent bab3ccb617
commit e09675c2b9
No known key found for this signature in database
GPG Key ID: 09BEDF7CC137762C

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