Fixes#259
The bug is caused by
4c725e56bf/progressbar_printer.go (L190)
which is not taking into account when barCurrentLength is <=0.
As a workaround display it only if the terminal width is big enough.
Now the context drives this kind of runtime state, so we keep everything
tight and we inject only that into the workers
This was specific to when s.Target differs from /. The helpers creating
the path were considering the full traversal, instead they should stop
at target.
E.g. our rootfs is in /foo/bar, and while we build the list of paths to
prune for /foo/bar/baz/bar, we should stop looking at /foo/bar.
It holds necessary state plus additional information relative to the
context which we are being run to (e.g. if we are in a terminal or not).
Besides in the future we can use it also as a contextual logger to
provide more smart logging capabilities.
This also replace the general global configuration instance that
previously was share between the core components.
- Ditch multiple libraries for progressbar, spinner, colors and replace
with pterm
- Detect when running on terminal and disable automatically spinner
- Add support for multiple progress bars
- Huge rewrite of the configuration part. No more crazy stuff with viper
CLI commands now correctly overrides default config file as expected
- Limit banner to be displayed on relevant parts
Fixes#211Fixes#105Fixes#247Fixes#233
Instead of merely storing files into disk use a real cache.
This also makes possible finally to reference artifacts in the cache with the
package checksum, which solves the cache hit checksum failures we had
previously.
Introduce an arch field that can be used to filter repositories based on
the local architecture.
If arch is provided and matching with the current GOARCH then the
repository is enabled
It introduces a relaxed way to install packages with loose deps. Default
installation now will by default prefer up-to-date packages during
selection.
Also:
- Upgrade now it's used in install so it have to return the full system view also when there is nothing to upgrade
- Avoid checking upgrade upfront if relaxed is on
When installing a package that has a provides values, the installer only
checks the original package against the resolved package. This leads to
the requires keyword not working as expected as the solved final package
is never gonna match the name of the old/superseeded package.
This patch checks the asked-to-install package name against the list of
names that the matched name provides.
Signed-off-by: Itxaka <igarcia@suse.com>
* Show the package name on uninstall error
Currently there is a generic message of error when uninstalling if one
of the provided packages is not found in the system. This is quite
obnoxious if you are providing luet a big list to uninstall as you dont
know which package is not installed and whats preventing you from
running the uninstall command.
This pathc is a very simple change that prints the packag name along
with the error to provide more info to the end user
Signed-off-by: Itxaka <igarcia@suse.com>
* Update pkg/installer/installer.go
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
We already check at beginning during install/upgrade. Also, better
to not fail while upgrade has already started for a check that we already did.
Signed-off-by: Ettore Di Giacinto <mudler@sabayon.org>
This changeset allows to have shared templates in a static folder
"templates" present in each luet tree. If the directory is present, it
gets scanned and templated accordingly on top of each package. This
allows to use such folder to store custom blocks to share between
packages.
This is still experimental and subject to change, this is just a first
pass version to provide the feature. It needs to be refined still as it
would be more elegant to use the helm engine properly and map our
structure to the engine instead of adapting it roughly.
Fixes#224
grab.NewClient() doesn't set a specific timeout
https://github.com/cavaliercoder/grab/blob/v2.0.0/client.go#L37 even if
the project advertize "default sane settings".
We default to 30, and allow to set it up with HTTP_TIMEOUT
Signed-off-by: Ettore Di Giacinto <mudler@sabayon.org>
Optionally add back privileged extraction which can be enabled with
LUET_PRIVILEGED_EXTRACT=true
Signed-off-by: Ettore Di Giacinto <mudler@sabayon.org>
* Reduce possibility of circular dependency
Just by adding an import for bus to anything in the helper dir, we would
run into a circular dependency due to how things are structured. That
means that we cannot set any events for unpacking or docker helper
pulling an image.
This commit tries to work around this by doing several things.
- Remove full imports of the helper module by segmentating some modules
into their own submodule, like docker or match so just using a small match
function doesnt bring the whole module
- Removing a simple function to check if a dir exists from importing
the full helper module and instead write the function (5 lines)
- Using logrus in the bus module instead of logger, which avoids a
circular dependency
Signed-off-by: Itxaka <igarcia@suse.com>
* Add two new events for unpacking an image
Both pre and post unpacking an image
Signed-off-by: Itxaka <igarcia@suse.com>
Don't force push package metadata with docker repository.
We were pushing regardless .metadata.yaml files even if packages were
not, also when calling create-repo without --force-push.
While uninstalling, we weren't checking if we left any empty dir behind.
Now we walk the full path to the file in the artifact, and check each
subdir if it's empty. If it is, we delete it as it is claimed by the
package
- Fixup search path on metadata spec load. Previously we were reading
the package being passed, and not the one resolved (it failed against
selectors)
- Do inherit first pushrepositories, so they take precedence over pull
- Add test cases to cover build values interpolation by remote
repositories
- Enhance test cases to check image cache repository inheritance when
--from-repositories is passed
- Fix race condition when inheriting buildspec options: Instead of consuming the compiler one, annotate the updates in the
package BuildOption spec which is passed by
- Update vendor
This was a regression in those changeset, don't replicate the info, and
at the same time, write the artifact path containing the name of the
file only (excluding the path)
- Interpolates values from the repositories compilespec if present
- Automatically merge cache images coming from specified repository when
necessary
Fixes#194