Skip to content

Commit

Permalink
[install][tests] Use 'curl'
Browse files Browse the repository at this point in the history
instead of 'wget' for the Pacman XferCommand.

Related #775
Related #802
  • Loading branch information
LukeShortCloud committed Mar 30, 2024
1 parent 577cae8 commit 44fa2ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Change Mac hardware workarounds to happen during the first-time setup.
- Change install to allow using a single HTTP mirror for caching purposes.
- Add ability to upgrade firmware during the first-time setup.
- Change Pacman to use 'curl' instead of 'wget' for downloads.

## 4.0.0 - The Conversion Update

Expand Down
13 changes: 8 additions & 5 deletions scripts/winesapos-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,13 @@ echo "Setting up Pacman parallel package downloads on live media..."
sed -i s'/\#ParallelDownloads.*/ParallelDownloads=5/'g /etc/pacman.conf
echo "Setting up Pacman parallel package downloads on live media complete."

echo "Configuring Pacman to use 'wget' for more reliable downloads on slow internet connections..."
echo "Install wget to help download packages..."
pacman -S --needed --noconfirm wget
sed -i s'/\[options\]/\[options\]\nXferCommand = \/usr\/bin\/wget --passive-ftp -c -O %o %u/'g /etc/pacman.conf
echo "Configuring Pacman to use 'wget' for more reliable downloads on slow internet connections complete."
echo "Install wget to help download packages complete."

echo "Configuring Pacman to use 'curl' for more reliable downloads on slow internet connections..."
sed -i s'/\[options\]/\[options\]\nXferCommand = \/usr\/bin\/curl --connect-timeout 60 --retry 10 --retry-delay 5 -L -C - -f -o %o %u/'g /etc/pacman.conf
echo "Configuring Pacman to use 'curl' for more reliable downloads on slow internet connections complete."

echo "Updating all system packages on the live media before starting the build..."
pacman -S -y -y -u --noconfirm --config <(echo -e "[options]\nArchitecture = auto\nSigLevel = Never\n[core]\nInclude = /etc/pacman.d/mirrorlist\n[extra]\nInclude = /etc/pacman.d/mirrorlist")
Expand All @@ -269,14 +272,14 @@ echo "Installing Arch Linux installation tools on the live media complete."

echo "Installing ${WINESAPOS_DISTRO}..."

pacstrap -i ${WINESAPOS_INSTALL_DIR} base base-devel fwupd wget --noconfirm
pacstrap -i ${WINESAPOS_INSTALL_DIR} base base-devel curl fwupd --noconfirm

# When building winesapOS using a container, ${WINESAPOS_INSTALL_DIR}/etc/pacman.conf does not get created.
# https://github.com/LukeShortCloud/winesapOS/issues/631
if [ ! -f "${WINESAPOS_INSTALL_DIR}/etc/pacman.conf" ]; then
cp /etc/pacman.conf ${WINESAPOS_INSTALL_DIR}/etc/pacman.conf
else
sed -i s'/\[options\]/\[options\]\nXferCommand = \/usr\/bin\/wget --passive-ftp -c -O %o %u/'g ${WINESAPOS_INSTALL_DIR}/etc/pacman.conf
sed -i s'/\[options\]/\[options\]\nXferCommand = \/usr\/bin\/curl --connect-timeout 60 --retry 10 --retry-delay 5 -L -C - -f -o %o %u/'g ${WINESAPOS_INSTALL_DIR}/etc/pacman.conf
fi

echo "Adding the winesapOS repository..."
Expand Down
4 changes: 2 additions & 2 deletions scripts/winesapos-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,8 @@ else
fi
echo "Testing that ParallelDownloads is enabled in Pacman complete."

echo -n "Testing that Pacman is configured to use 'wget'..."
grep -q 'XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u' ${WINESAPOS_INSTALL_DIR}/etc/pacman.conf
echo -n "Testing that Pacman is configured to use 'curl'..."
grep -q 'XferCommand = /usr/bin/curl --connect-timeout 60 --retry 10 --retry-delay 5 -L -C - -f -o %o %u' ${WINESAPOS_INSTALL_DIR}/etc/pacman.conf
if [ $? -eq 0 ]; then
echo PASS
else
Expand Down

0 comments on commit 44fa2ba

Please sign in to comment.