Age | Commit message (Collapse) | Author |
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This fixes a missed unimplemented!() in the codebase.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This fixes the relative pathes for the patch files by not joining it with the
root directory path.
The exists-check was removed, because the filtering before that already does
that.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
A quick test showed that the parallel approach here reduced the loading time by
approx 10%.
Not good, but better than before.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
The last few refactorings did not fix the indentation (on purpose), so
that the actual diff of the refactoring is more visible.
This commit now cleans up on that by fixing _only_ the indentation.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Split closure into two distinct map calls, to reduce nesting here and
improve readability.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Use `Result::or_else()` and match for error kinds instead of matching the
whole `Result`, for less nesting.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Move mapping into `String` one level up for less nesting.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This fix was actually buggy.
The problem here is that the `Package` struct is used to fill variables in the
script. If we overwrite the patch pathes with their absolute variant, the script
gets interpolated with the absolute paths, resulting in things like
patch -p0 < /patches//home/user/package_repository/software/p.patch
but the copy-to-container process copies (should copy) the patch file to
/patches/software/p.patch
This reverts commit dcc8b42810d34b2b906f0307c26c4826d16ad997.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch changes the patch-path collecting to make the pathes to patches
absolute.
This fixes a bug where executing butido from a sub directory of the package
repository failed to find the patch files when loading the repository files.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Because commit 5c36c119f9448baf6bfe5245c6ebac1aa09d5b43 was not enough and was
actually buggy, this fixes the patch-file-finding algorithm _again_.
The approach changed a bit. It actually introduces even more overhead to the
loading algorithm, because of constant type-conversions. But it's as good as it
can be right now.
So first of all, we're collecting the patches before the merge into a
Vec<PathBuf>. Each of those are existing.
Then we check whether the new patch exists, and if it not does, we check whether
the file actually exists in the patches from before the merge (by filename). If
it does, it seems that we dragged the entry from the previous recursion. In
this case, the patches from before the merge were valid, and the recursion
invalidated the path.
I.E.:
/pkg.toml with patches = [ "a" ]
/a
/sub/pkg.toml with no patches=[]
in the recursion for /sub/pkg.toml, we get a ["a"] in the patches array, because
that's how the layered configuration works.
But because the path is invalid, we check whether before the merge (so, the
patches array from /pkg.toml) has a file named equally - which it does. So the
array before the merge is the correct one.
I did some tests on this and it seems to work correctly, but more edge-cases may
exist.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
Fixes: 5c36c119f9448baf6bfe5245c6ebac1aa09d5b43 ("Fix: Error out if a patch file is missing")
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch fixes a bug where a patch file is not there.
Before this patch, we were simply ignoring non-existing files in the iterator,
because during development of this algorithm, it seemed to be the right idea
because of the recursion that is happending.
The patch-branch-patching that is happening in the recursion, that rewrites the
pathes to the patches during the recursive loading of the packages, used to
yield invalid pathes at some point, which simply could be ignored. That happened
before that patch.
But because during the development of the recursive loading, the scheme how this
all works was changed, it does not yield invalid pathes anymore.
Hence, we can be sure that either the file is here or it is not - which is an
error then.
I have to say that I'm not particularly good with recursion, but as far as my
tests go, this seems to work as intended now.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch rewrites patch post-processing with a new setter in the config-rs
crate:
Config::set_once()
That is introduced on a PR I've written for the crate.
The PR: https://github.com/mehcode/config-rs/pull/172
The new function is more likely to land on the config-rs master branch than the
old one, as it does not introduce more exported types from the config-rs crate.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
This patch ensures that pathes for patches are always relative to the repository
root, when loading the packages layered from the repository.
The problem is well described in the comment in the code, so this commit message
ends here.
This patch was written using an proposed feature for the config-rs dependency:
https://github.com/mehcode/config-rs/pull/165
This PR added a `Config::get_value_mut()` function and exported the
`config::value::ValueKind` type in config-rs public API.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Tested-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch fixes a behaviour where non-package files were not ignored,
which resulted in error messages where a directory was tried to parse
(which of course is not valid).
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
This patch removes the idea of "version constraints" except for the
equality constraint. This is due to the fact, that everything else
might result in impurities.
This might be reverted in the future and actual operators ("<" or ">" or
ranges...) might be implemented. Thus, we keep the "=" equality sign as
prefix for a version string, to be extensible here.
This commit also fixes (automatically, because the implementation
changed from the ground up) the issue that there was no difference
between a version string and a version constraint string.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
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>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|
|
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
|