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

scripts/download.pl: Make the download tool configurable #10291

Merged
merged 3 commits into from
Oct 21, 2022

Conversation

1582130940
Copy link
Contributor

Q:你知道这是pull request吗?(使用 "x" 选择)

  • 我知道

Ansuel and others added 3 commits October 21, 2022 12:28
Move DOWNLOAD_CHECK_CERTIFICATE to include/download.mk as it's a better
place than exporting it in the global rules.mk makefile.

Signed-off-by: Christian Marangi <[email protected]>
Introduce a new option in the "Advanced configuration options" to
configure a custom download tool.

By declaring a string in "Use custom download tool" an user can force
what command to use to download package. With the string empty the
default tool used is curl, with wget as a fallback if not available.

download.pl supports 3 tools officially aria2c, curl and wget.
If one of the tool is used in this config, download.pl will use the
default args to make use of them.

If the provided string is different than aria2c, curl or wget, the command
is used as is and the download url will be appended at the end of such command.

While at it also tweak the tool selection logic and chose the tool only
once when the script is called and move aria2c specific variables in the
relevant section.

Signed-off-by: Christian Marangi <[email protected]>
The aria2c command tries to load config from
${XDG_CONFIG_HOME:-${HOME}/.config}/aria2/aria2.conf by default,
which may result unexpected behavior.

As a replacement, people can use environment variable ARIA2C_OPTIONS
to custom arguments passed to aria2c like curl and wget below.
Including --conf-path=/path/to/config.conf in ARIA2C_OPTIONS can
also set a custom config file path easily if needed.

Signed-off-by: Zhang Hua <[email protected]>
@coolsnowwolf coolsnowwolf merged commit 6c4e5d7 into coolsnowwolf:master Oct 21, 2022
github-actions bot added a commit to DeakeyTan/openwrt that referenced this pull request Oct 21, 2022
* https://github.com/coolsnowwolf/lede:
  scripts/download.pl: Make the download tool configurable (coolsnowwolf#10291)
  rockchip: Add Rongpin King3399 support (coolsnowwolf#10292)
  kernel: mtd: add en25qx128a spi nor support
  toolchain: musl: disable crypt size hack by default
  toolchain: gcc: improve patch handling by introducing major version
  build: remove GCC9 support
  build: remove GCC7 support
  toolchain/binutils: remove old versions
github-actions bot added a commit to Kin-Chi/lede that referenced this pull request Oct 21, 2022
* https://github.com/coolsnowwolf/lede:
  scripts/download.pl: Make the download tool configurable (coolsnowwolf#10291)
  rockchip: Add Rongpin King3399 support (coolsnowwolf#10292)
github-actions bot added a commit to chingxuds/lede-custom that referenced this pull request Oct 21, 2022
* https://github.com/coolsnowwolf/lede:
  scripts/download.pl: Make the download tool configurable (coolsnowwolf#10291)
  rockchip: Add Rongpin King3399 support (coolsnowwolf#10292)
github-actions bot pushed a commit to zesming/lede that referenced this pull request Oct 22, 2022
* https://github.com/coolsnowwolf/lede:
  scripts/download.pl: Make the download tool configurable (coolsnowwolf#10291)
  rockchip: Add Rongpin King3399 support (coolsnowwolf#10292)
yjh126yjh pushed a commit to yjh126yjh/lede that referenced this pull request Oct 22, 2022
* https://github.com/coolsnowwolf/lede: (49 commits)
  Revert "toolchain: gcc: improve patch handling by introducing major version"
  iwlwifi: edit package/firmware/linux-firmware/intel.mk for support inter-ax201 (coolsnowwolf#10303)
  libselinux: sync with upstream (coolsnowwolf#10300)
  kernel: bump 6.0 to 6.0.3 (coolsnowwolf#10299)
  scripts/download.pl: Make the download tool configurable (coolsnowwolf#10291)
  rockchip: Add Rongpin King3399 support (coolsnowwolf#10292)
  kernel: mtd: add en25qx128a spi nor support
  toolchain: musl: disable crypt size hack by default
  toolchain: gcc: improve patch handling by introducing major version
  build: remove GCC9 support
  build: remove GCC7 support
  toolchain/binutils: remove old versions
  download.pl: use more Chinese mirrors (coolsnowwolf#10281)
  build: move Build/copy-file to image-commands.mk
  mt76: add MediaTek Filogic 630 (MT7916) support
  build: switch default target to x64
  scripts: sync with upstream
  wireless-regdb: unlock WIFI6E channel and txpower
  rockchip: add rockchip-crypto support for rk3568/rk3588
  toolchain: glibc: Update to glibc 2.35 (coolsnowwolf#10276)
  ...
github-actions bot added a commit to HongJie-Master/lede that referenced this pull request Oct 23, 2022
* https://github.com/coolsnowwolf/lede: (28 commits)
  Revert "toolchain: gcc: improve patch handling by introducing major version"
  iwlwifi: edit package/firmware/linux-firmware/intel.mk for support inter-ax201 (coolsnowwolf#10303)
  libselinux: sync with upstream (coolsnowwolf#10300)
  kernel: bump 6.0 to 6.0.3 (coolsnowwolf#10299)
  scripts/download.pl: Make the download tool configurable (coolsnowwolf#10291)
  rockchip: Add Rongpin King3399 support (coolsnowwolf#10292)
  kernel: mtd: add en25qx128a spi nor support
  toolchain: musl: disable crypt size hack by default
  toolchain: gcc: improve patch handling by introducing major version
  build: remove GCC9 support
  build: remove GCC7 support
  toolchain/binutils: remove old versions
  download.pl: use more Chinese mirrors (coolsnowwolf#10281)
  build: move Build/copy-file to image-commands.mk
  mt76: add MediaTek Filogic 630 (MT7916) support
  build: switch default target to x64
  scripts: sync with upstream
  wireless-regdb: unlock WIFI6E channel and txpower
  rockchip: add rockchip-crypto support for rk3568/rk3588
  toolchain: glibc: Update to glibc 2.35 (coolsnowwolf#10276)
  ...
desmondc9 pushed a commit to desmondc9/lede that referenced this pull request Oct 26, 2022
…f#10291)

* rules.mk: Move DOWNLOAD_CHECK_CERTIFICATE to include/download.mk

Move DOWNLOAD_CHECK_CERTIFICATE to include/download.mk as it's a better
place than exporting it in the global rules.mk makefile.

Signed-off-by: Christian Marangi <[email protected]>

* scripts/download.pl: Make the download tool configurable

Introduce a new option in the "Advanced configuration options" to
configure a custom download tool.

By declaring a string in "Use custom download tool" an user can force
what command to use to download package. With the string empty the
default tool used is curl, with wget as a fallback if not available.

download.pl supports 3 tools officially aria2c, curl and wget.
If one of the tool is used in this config, download.pl will use the
default args to make use of them.

If the provided string is different than aria2c, curl or wget, the command
is used as is and the download url will be appended at the end of such command.

While at it also tweak the tool selection logic and chose the tool only
once when the script is called and move aria2c specific variables in the
relevant section.

Signed-off-by: Christian Marangi <[email protected]>

* scripts/download.pl: Pass aria2 config in ENV only

The aria2c command tries to load config from
${XDG_CONFIG_HOME:-${HOME}/.config}/aria2/aria2.conf by default,
which may result unexpected behavior.

As a replacement, people can use environment variable ARIA2C_OPTIONS
to custom arguments passed to aria2c like curl and wget below.
Including --conf-path=/path/to/config.conf in ARIA2C_OPTIONS can
also set a custom config file path easily if needed.

Signed-off-by: Zhang Hua <[email protected]>

Signed-off-by: Christian Marangi <[email protected]>
Signed-off-by: Zhang Hua <[email protected]>
Co-authored-by: Christian Marangi <[email protected]>
Co-authored-by: Zhang Hua <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants