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

improve pak downloader script #1133

Merged
merged 1 commit into from Nov 19, 2019
Merged

Conversation

@illwieckz
Copy link
Member

illwieckz commented Nov 19, 2019

  • rename download-dpk to download-paks as it can also download older version with pk3

  • do torrent download by default or fallback to http if aria2c is missing

  • be able to use aria2c, curl or wget for http download

  • resume partial http downloaded files instead of restarting entirely their download

  • fix a lot of bugs, did you know that a mistake in former torrent downloader
    prevented another bug to wipe your source repository?

  • cycle through HTTP mirrors when one is unavailable

  • properly wipe cache directory

  • do not clean-up yet files from previous releases

  • as a side work, improve the update-version-number script

  • script extensions considered harmful

@illwieckz

This comment has been minimized.

Copy link
Member Author

illwieckz commented Nov 19, 2019

This is part of a huge work I'm doing on scripts, this is first shipping.

Note that the pak downloader is now able to download 0.51.1 paks even if we mistakenly shipped an empty md5sums file, since default download mode is the bittorrent one and this one does not require the md5sums file to work.

@illwieckz illwieckz force-pushed the illwieckz:download-paks branch from be3ffdd to 369f644 Nov 19, 2019
xdgHomeDir="${XDG_DATA_HOME:-${HOME}/.local/share}/unvanquished"

# Version of Unvanquished for which this script is built
version=0.51.1

This comment has been minimized.

Copy link
@DolceTriade

DolceTriade Nov 19, 2019

Member

Can we not hard code this? Maybe fetch from latest tag or something?

This comment has been minimized.

Copy link
@illwieckz

illwieckz Nov 19, 2019

Author Member

This is rewritten by update-version-number in any way.

Note that this script was shipped by debian package in the past, and it may be used outside of source dir in a legit way (at least downloaded by direct download).

What we can do is to read the git tag if exists or fallback on this hardcoded one.

@illwieckz illwieckz force-pushed the illwieckz:download-paks branch 7 times, most recently from b3746d4 to ba4d27a Nov 19, 2019
- rename download-dpk to download-paks as it can also download older version with pk3
- do torrent download by default or fallback to http if aria2c is missing
- be able to use aria2c, curl or wget for http download
- resume partial http downloaded files instead of restarting entirely their download
- fix a lot of bugs, did you know that a mistake in former torrent downloader
  prevented another bug to wipe your source repository?
- cycle through HTTP mirrors when one is unavailable
- properly wipe cache directory
- do not clean-up yet files from previous releases

- as a side work, improve the update-version-number script
- script extensions considered harmful
@illwieckz illwieckz force-pushed the illwieckz:download-paks branch 2 times, most recently from 4987ccc to 02c4b06 Nov 19, 2019
@illwieckz

This comment has been minimized.

Copy link
Member Author

illwieckz commented Nov 19, 2019

This is current output of: ./download-paks --help

download-paks: download Unvanquished game files

Usage: download-paks [option] [destination directory] [cache directory]

Options:
	--help             Print this help
	--http             Download using HTTP (requires aria2c or curl or wget)
	--torrent          Download using BitTorrent (requires aria2c, default if aria2c is available)
	--no-check         Do not verify downloaded files
	--no-download      Do not download files (only perform file verification)
	--mirror=MIRROR    Download from MIRROR (will not cycle through known mirrors)
	--version=VERSION  Download this VERSION

Default destination directory is /home/illwieckz/.local/share/unvanquished/pkg
Default cache directory is destination directory (files are always downloaded in a .cache subdirectory)

Default version to download:
	0.51.1

Mirror URL examples:
	http://cdn.unvanquished.net
	http://unvcdn.viech.name
	http://cdn.illwieckz.net/unvanquished
@illwieckz illwieckz merged commit 2d8e5a7 into Unvanquished:master Nov 19, 2019
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.