summaryrefslogtreecommitdiffstats
path: root/src/package/package.rs
AgeCommit message (Collapse)Author
2021-01-18Merge branch 'rustfmt'Matthias Beyer
Merge formatting, but do not enforce it because that'd be a too high hurdle for possible contributors.
2021-01-18Run `cargo fmt`Matthias Beyer
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-18Add a "meta" field for the Package structMatthias Beyer
This field may be used by the packager to define meta information on a package and later use that meta-information in their packaging scripts. For example: meta.description = "A simple package" and later use that to write a RPM spec file: echo "Description: {{this.meta.description}}" >> specfile Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
2021-01-15Fix clippy: explicit lifetimes given in parameter types where they could be ↵Matthias Beyer
elided Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-01-15Fix clippy: you are using an explicit closure for cloning elementsMatthias Beyer
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-14Refactor: Move phase module to packageMatthias Beyer
This is the right scope anyways. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Rename for consistency: deny_images -> denied_imagesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Add allowlist featureMatthias Beyer
This patch adds the "allowlist" feature for packages. A package can have a list of allowed images to be built on - butido will not execute the submit if one package is not allowed on the image passed to butido. This is the opposite of the denylist, of course. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-11Fix: Test must pass hashmap of sources to packageMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-08Merge 'check-env' into masterMatthias Beyer
2020-12-08Fix: build and runtime deps should be uniqueMatthias Beyer
Before this patch, if a package had the following dependencies: build = ["other =1"] runtime = ["other =1"] the package "other" in version "1" was built twice. This is not necessary, we only need to build "other" once. This patch fixes this bug. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-12-08Use EnvironmentVariableName type for names of ENV variablesMatthias Beyer
This makes the typing a bit more helpful by using a type for the name of environment variables. 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-03Remove the idea of "system dependencies"Matthias Beyer
Because we want to be able to work on different distros, we cannot have a concept of "system dependencies", because each distro names their packages differently. The concept of installing stuff from a distro image can still be accomplished easily via environment variables. 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-11-08Remove unused imports, sort importsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-11-05Derive Serialize for all typesMatthias Beyer
Because we want to write the whole Tree object into the database as JSON, we need to be able to serialize all these types. Some of them (which had no implementation of Deserialize) also got an implementation of Deserialize, because we also want to be able to read them from the database and print them to the user. Signed-off-by: Matthias Beyer <mail@beyermatthias.de> (cherry picked from commit 3170c9ed14e22c5baa41618326a4db02389da445)
2020-11-04Change ParseDependency trait to take reference in parsing functionMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-30Change dependency getter functions to return IteratorMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-30Split dependency getter functionsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-30Remove "Executor"Matthias Beyer
The Executor type was supposed to execute the dependency scripts and return a list of dependencies the script(s) printed. As we removed the idea of dependency-scripts, we can remove the Executor type as well. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-30Change Package::get_all_dependencies() to actually get all dependenciesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-30Remove idea of "dependency scripts"Matthias Beyer
We don't even know anymore which problem we wanted to solve with this, so remove it. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-26Add tests for Tree typeMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-26Move helper functions to appropriate moduleMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-26Implement tests for Repository typeMatthias Beyer
This patch also implements helper functions (cfg(test)-gated) on various types so we can instantiate them properly in the tests. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-14Phases are not optionalMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-13Differentiate between system-buildtime and system-runtime dependenciesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-13Hand-implement Debug for PackageMatthias Beyer
Because the derived Debug implementation has way too much information to keep the log readable. This way, the log stays readable. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-13Split files for more structureMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-13Remove VersionParser, which is implemented with a simple TryInto<>Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Let types derive Clone for simplicity for nowMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Remove unused importsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Remove declaration because it has no effect anywaysMatthias Beyer
(Because none of the types implement Serialize) Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Outsource dependencies into subtype for better structuring of package ↵Matthias Beyer
definitions Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Extract Source to own type for better structured pkg filesMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Implement dependency getting properly, including version parsingMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Add Executor for executing things on the systemMatthias Beyer
This adds an Executor trait, which can be used to execute things on the system for finding, for example, dependency specifications. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Make Package type more powerfulMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-12Initial importMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>