crosstool-ng-001-wget-instead-of-curl.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Use wget instead of curl
  2. While crosstool-NG did support either curl or wget in the past, it now
  3. only supports curl. Unfortunately, Buildroot uses wget for all its
  4. downloads, so wget is a hard dependency of Buildroot, while curl
  5. isn't.
  6. Instead of adding curl as a new Buildroot dependency, or building curl
  7. for the host, we simply tweak crosstool-NG to use wget instead of
  8. curl.
  9. The script/functions change has been provided by Yann E. Morin.
  10. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  11. Index: crosstool-ng-1.13.0/configure
  12. ===================================================================
  13. --- crosstool-ng-1.13.0.orig/configure
  14. +++ crosstool-ng-1.13.0/configure
  15. @@ -496,7 +496,7 @@
  16. ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)' \
  17. err="'libtoolize' 1.5.26 or above was not found"
  18. has_or_abort prog=stat
  19. -has_or_abort prog="curl"
  20. +has_or_abort prog="wget"
  21. has_or_abort prog=patch
  22. has_or_abort prog=tar
  23. has_or_abort prog=gzip
  24. Index: crosstool-ng-1.13.0/scripts/functions
  25. ===================================================================
  26. --- crosstool-ng-1.13.0.orig/scripts/functions
  27. +++ crosstool-ng-1.13.0/scripts/functions
  28. @@ -456,13 +456,12 @@
  29. # Some company networks have firewalls to connect to the internet, but it's
  30. # not easy to detect them, so force a global ${CT_CONNECT_TIMEOUT}-second
  31. # timeout.
  32. - # For curl, no good progress indicator is available. So, be silent.
  33. - if CT_DoExecLog ALL curl --ftp-pasv \
  34. - --retry 3 \
  35. - --connect-timeout ${CT_CONNECT_TIMEOUT} \
  36. - --location --fail --silent \
  37. - --output "${tmp}" \
  38. - "${url}"
  39. + if CT_DoExecLog ALL wget --passive-ftp --tries=3 -nc \
  40. + -T ${CT_CONNECT_TIMEOUT} \
  41. + -O "${tmp}" \
  42. + "${url}"
  43. +
  44. +
  45. then
  46. # Success, we got it, good!
  47. mv "${tmp}" "${dest}"