From 90a195b47ee2d25ba52b5f22dd863d91ae1e83f9 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Tue, 2 Jun 2020 19:31:16 +0000 Subject: [PATCH 1/3] Use curl instead of wget. curl now comes with windows, and will work in a default cygwin install. Signed-off-by: Rafael Kitover --- apt-cyg | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/apt-cyg b/apt-cyg index 84a2d5f..022de17 100755 --- a/apt-cyg +++ b/apt-cyg @@ -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 @@ -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 + curl -RLO $mirror/$arch/setup.bz2 if [ -e setup.bz2 ] then bunzip2 setup.bz2 @@ -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 -L -o $bn $mirror/$dn/$bn $hash -c <<< "$digest $bn" || exit fi @@ -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 -L -o matches cygwin.com/cgi-bin2/package-grep.cgi?"$qs" awk ' NR == 1 {next} mc[$1]++ {next} From c76f41642a25b705425b946bf2b2d1b47dfa67e7 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 2 Jan 2022 23:35:40 +0000 Subject: [PATCH 2/3] Fix requiring self in PATH, pass -s to curl. Use "$0" instead of "apt-cyg" to call self, thus not requiring self in PATH. Pass -s to all curl commands to make output less noisy. Signed-off-by: Rafael Kitover --- apt-cyg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apt-cyg b/apt-cyg index 022de17..93f564f 100755 --- a/apt-cyg +++ b/apt-cyg @@ -157,7 +157,7 @@ function find-workspace { function get-setup { touch setup.ini mv setup.ini setup.ini-save - curl -RLO $mirror/$arch/setup.bz2 + curl -sRLO $mirror/$arch/setup.bz2 if [ -e setup.bz2 ] then bunzip2 setup.bz2 @@ -377,7 +377,7 @@ function download { cd "$cache/$mirrordir/$dn" if ! test -e $bn || ! $hash -c <<< "$digest $bn" then - curl -L -o $bn $mirror/$dn/$bn + curl -sLo $bn $mirror/$dn/$bn $hash -c <<< "$digest $bn" || exit fi @@ -413,7 +413,7 @@ function apt-searchall { for pkg in "${pks[@]}" do printf -v qs 'text=1&arch=%s&grep=%s' $arch "$pkg" - curl -L -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} @@ -477,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 )) From 89691fa34244ade7647728d886c80ba5290ecc34 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Tue, 5 Sep 2023 09:45:20 +0000 Subject: [PATCH 3/3] Add --ssl-no-revoke to curl args Signed-off-by: Rafael Kitover --- apt-cyg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apt-cyg b/apt-cyg index 93f564f..c223506 100755 --- a/apt-cyg +++ b/apt-cyg @@ -157,7 +157,7 @@ function find-workspace { function get-setup { touch setup.ini mv setup.ini setup.ini-save - curl -sRLO $mirror/$arch/setup.bz2 + curl --ssl-no-revoke -sRLO $mirror/$arch/setup.bz2 if [ -e setup.bz2 ] then bunzip2 setup.bz2 @@ -377,7 +377,7 @@ function download { cd "$cache/$mirrordir/$dn" if ! test -e $bn || ! $hash -c <<< "$digest $bn" then - curl -sLo $bn $mirror/$dn/$bn + curl --ssl-no-revoke -sLo $bn $mirror/$dn/$bn $hash -c <<< "$digest $bn" || exit fi @@ -413,7 +413,7 @@ function apt-searchall { for pkg in "${pks[@]}" do printf -v qs 'text=1&arch=%s&grep=%s' $arch "$pkg" - curl -sLo matches cygwin.com/cgi-bin2/package-grep.cgi?"$qs" + curl --ssl-no-revoke -sLo matches cygwin.com/cgi-bin2/package-grep.cgi?"$qs" awk ' NR == 1 {next} mc[$1]++ {next}