summaryrefslogtreecommitdiffstats
path: root/src/commands/source.rs
AgeCommit message (Collapse)Author
2021-02-02Add bytes written/total bytes to status bar messageMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-02-02Fix: Download bar should be joined in blocking tokio taskMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-02-02Add trace output which packages will be verifiedMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-02-02Fix: wait properly for multibar joinMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-30Update tokio: 0.2 -> 1.0, shipliftMatthias Beyer
Because tokio 1.0 does not ship with the Stream trait, this patch also introduces tokio_stream as new dependency. For more information, look here: https://docs.rs/tokio/1.0.3/tokio/stream/index.html Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-01-25Reimplement hash verification using streamingMatthias Beyer
This patch re-implements hashing using streams and buffered readers instead of reading a full file to RAM before hashing it. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-19Merge branch 'verification-colored'Matthias Beyer
2021-01-19Add some color in the hash verification routineMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-19Fix: Hash verification not asyncMatthias Beyer
Because we continuously get blocking filesystem operations when the implementation of the verification is async, simply remove the asyncness here now. This does not decrease performance (yet), because the function is called concurrently with other calls anyways. It blocks the tokio worker thread tho, thus maximum parallelism might be = number of cores. :-( Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-18Run `cargo fmt`Matthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-18Add comments on subcommand implementationsMatthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-15Fix clippy: using `writeln!(outlock, "")`Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-01-15Fix clippy: `.map().collect()` can be replaced with `.try_for_each()`Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-01-15Fix clippy: `.map().collect()` can be replaced with `.try_for_each()`Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-01-15Add feature to mark a source entry as manual downloadMatthias Beyer
This patch adds a feature where a source entry in a package can be marked for manual download. This gives us the ability to mask downloads which are hidden behind cruel JavaScript bullshit bloat where a `curl` cannot access the remote file. Signed-off-by: Matthias Beyer <matthias.beyer@atos.net> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-01-13Add LICENSE file and license headersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Add some more trace outputMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Fix weird rendering bug of progress barsMatthias Beyer
Apparently, this fixes the rendering bug we had with indicatif. The issue was, that we called `indicatif::ProgressBar::set_message()` before the bar was added to the `indicatif::MultiProgress` object. This caused the bar to be rendered, and as soon we added it to the MultiProgress object and re-called set_message(), it was rendered again. This is of course a bug / inconveniance in indicatif. Either way, the issue was solved by not calling `set_message()` in our `ProgressBars` helper object, but only return a preconfigured bar object. Because not calling the set_message() function yields the whole bunch of helper functions as unnecessary, these were removed and the interface was boiled down to `pub fn ProgressBars::bar(&self) -> indicatif::ProgressBar` which in turn results in a few modifications all over the place. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Add progress spinners for source verification routines.Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Fix command implementation for source verification to log errors properlyMatthias Beyer
This patch fixes the verify_impl() to log the errors properly. Before this patch, the first error was reported (which we did not mean to implement this way, so it was a bug). Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-09Add more log output in case of error when downloading sourcesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Make sources namedMatthias Beyer
This patch changes the sources to be named. This is required for nice interpolation when layering pkg.toml files. Before this, we had to make sure that the `[[sources]]` array element was on the right position. For example, consider two files: /pkg.toml /package/pkg.toml in the first: [[sources]] url = "some/thing" in the second: [[sources] hash.type = "sha1" hash.value = "asdf..." When merged: [[sources] url = "some/thing" hash.type = "sha1" hash.value = "asdf..." but because the _position_ was responsible for merging these elements, adding a new source file _before_ the existing on in /pkg.toml would yield the /package/pkg.toml incomplete when merged onto /pkg.toml, thus resulting in an error. With named source entries, this is less likely. The source file name includes the source name as well, of course. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Fix: Source cache root can be a PathBuf in the configurationMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Deny macro_use from external crateMatthias Beyer
Diesel is an exception here, because the generated src/schema.rs file does not automatically contain the necessary imports. All imports were added where necessary. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Cleanup: Add missing "dyn" keywordMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-07Remove unused variableMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Remove variable interpolation in config fileMatthias Beyer
This was unused anyways, and I am not even sure what we implemented it for. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Move verification implementation to dedicated functionMatthias Beyer
This patch also changes the implementation of the hash verification to fail _late_ instead of early. This means that all hashes are computed and compared and errors are reported after that, not as soon as the first hash comparison fails. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Allow multiple sources per packageMatthias Beyer
This patch implements multiple (unnamed) sources per package. This means that a package can have an array of sources. What was adapted to allow multiple sources per package: * Downloads are made in parallel now * The cache structure was changed to /<package>-<version>/<hash>.source * The UI was changed to contain the full `Package` struct (as JSON object) in a UI format string Tests were adapted. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-03Cleanup importsMatthias Beyer
This patch cleans the imports, removes the unused ones and moves imports, wherever possible, to the outer scope. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-26Update dependency: clap: 3.0.0-beta.1 -> 3.0.0-beta.2Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Fix: Flush file buffer after download completedMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Add subcommand "source download"Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Add optional version filtering for "source" subcommandsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Add "source url" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Add "source list-missing" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-11Move to have "source" subcommandMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>