Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use curl instead of wget. #144

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions apt-cyg
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,6 @@ The MIT License (MIT)
Copyright (c) 2005-9 Stephen Jungels
"

function wget {
if command wget -h &>/dev/null
then
command wget "$@"
else
warn wget is not installed, using lynx as fallback
set "${*: -1}"
lynx -source "$1" > "${1##*/}"
fi
}

function find-workspace {
# default working directory and mirror

Expand Down Expand Up @@ -168,7 +157,7 @@ function find-workspace {
function get-setup {
touch setup.ini
mv setup.ini setup.ini-save
wget -N $mirror/$arch/setup.bz2
rkitover marked this conversation as resolved.
Show resolved Hide resolved
curl -sRLO $mirror/$arch/setup.bz2
if [ -e setup.bz2 ]
then
bunzip2 setup.bz2
Expand Down Expand Up @@ -388,7 +377,7 @@ function download {
cd "$cache/$mirrordir/$dn"
if ! test -e $bn || ! $hash -c <<< "$digest $bn"
then
wget -O $bn $mirror/$dn/$bn
curl -sLo $bn $mirror/$dn/$bn
$hash -c <<< "$digest $bn" || exit
fi

Expand Down Expand Up @@ -424,7 +413,7 @@ function apt-searchall {
for pkg in "${pks[@]}"
do
printf -v qs 'text=1&arch=%s&grep=%s' $arch "$pkg"
wget -O matches cygwin.com/cgi-bin2/package-grep.cgi?"$qs"
curl -sLo matches cygwin.com/cgi-bin2/package-grep.cgi?"$qs"
awk '
NR == 1 {next}
mc[$1]++ {next}
Expand Down Expand Up @@ -488,7 +477,7 @@ function apt-install {
echo Package $package is already installed, skipping
continue
fi
apt-cyg install --noscripts $package || (( wr++ ))
"$0" install --noscripts $package || (( wr++ ))
done
fi
if (( wr ))
Expand Down