Skip to content

Latest commit

 

History

History
136 lines (95 loc) · 3.49 KB

README.md

File metadata and controls

136 lines (95 loc) · 3.49 KB

Install

This project is still under development and there are no official releases. To install it, you have to clone the repository, compile (setup Rust first if you haven't) and install locally.

cargo install --path .

Use

sprd example

❯ sprd --help
sprd 0.1.0
Gajo Petrovic <gajopetrovic@gmail.com>
Rapid client

USAGE:
    sprd [OPTIONS] <SUBCOMMAND>

OPTIONS:
    -h, --help
            Print help information

    -r, --root-folder <ROOT_FOLDER>


    -V, --version
            Print version information

SUBCOMMANDS:
    check-sdp
            Check if SDP is fully downloaded
    download
            Download the specified rapid tag
    download-registry
            Download the registry metadata
    download-repo
            Download the repository metadata
    download-sdp
            Download SDP
    fix
            Fix
    help
            Print this message or the help of the given subcommand(s)
    validate
            Validate by fullname

Examples

Download latest Beyond All Reason:

cargo run -- --root-folder ~/projects/spring-dir download byar:test

Update metadata:

cargo run -- --root-folder ~/projects/spring-dir download-registry
cargo run -- --root-folder ~/projects/spring-dir download-repo

Development

Install Rust and then build as normal:

cargo build

Running tests

To run tests you will need to also have pr-downloader installed - it's used to verify that sprd and pr-downloader output is the same.

If you are on Linux, you can get it as so:

wget https://github.com/gajop/spring-launcher/blob/master/bin/pr-downloader\?raw\=true -O pr-downloader
chmod +x pr-downloader

Tests can only be run in single-threaded mode (the rapid filesystem isn't multi-thread safe yet).

cargo test -- --test-threads=1

🚧 WIP

This project is under construction and not ready for use.

Below you can see my very rough roadmap:

🚧 In progress:

  • Add tests for various types of downloads

🔖 Dev release:

  • Pool downloader autofix files
  • Check validity of other metadata files too: save size & gz validity
  • Auto-retry

📝 Backlog:

Pool downloader:

  • pool downloader tests without internet connectivity (save downloads to files)
  • Back to fully async IO (file): use tokio::fs, figure out what was causing the partial write issue despite write_all

Commands:

  • Refactor commands out of lib.rs, they're only sensible to have for the binary. We don't want library authors to use the command API

Downloader:

  • Option to not commit metadata downloads until pool finishes
    • don't override versions.gz until pool has been fully downloaded. otherwise users who've updated their versions.gz won't be able to play with :test until pool has been updated
  • Option to download in parallel (?)
    • ability to async (parallel) query all repos of interest on launcher (lobby?) start (with some sensible caching?)
  • Make it possible to specify the server URLs

License

sprd is dual licensed under either:

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.