Don't check file conflicts while running installops

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 commit is contained in:
Ettore Di Giacinto
2021-08-11 10:31:09 +02:00
parent 220f8700ce
commit 16bb93e165

View File

@@ -290,6 +290,7 @@ func (l *LuetInstaller) swap(o Option, syncedRepos Repositories, toRemove pkg.Pa
NoDeps: false,
OnlyDeps: o.OnlyDeps,
RunFinalizers: false,
CheckFileConflicts: false,
}, o, syncedRepos, packages, assertions, allRepos)
err = l.runOps(ops, s)
@@ -313,6 +314,8 @@ type Option struct {
FullCleanUninstall bool
OnlyDeps bool
RunFinalizers bool
CheckFileConflicts bool
}
type operation struct {
@@ -521,6 +524,7 @@ func (l *LuetInstaller) Install(cp pkg.Packages, s *System) error {
NoDeps: l.Options.NoDeps,
Force: l.Options.Force,
OnlyDeps: l.Options.OnlyDeps,
CheckFileConflicts: true,
RunFinalizers: true,
}
match, packages, assertions, allRepos, err := l.computeInstall(o, syncedRepos, cp, s)
@@ -814,6 +818,7 @@ func (l *LuetInstaller) install(o Option, syncedRepos Repositories, toInstall ma
return errors.Wrap(err, "Downloading packages")
}
if o.CheckFileConflicts {
// Check file conflicts
if err := l.checkFileconflicts(toInstall, true, s); err != nil {
if !l.Options.Force {
@@ -822,6 +827,7 @@ func (l *LuetInstaller) install(o Option, syncedRepos Repositories, toInstall ma
Warning("file conflict found", err.Error())
}
}
}
if l.Options.DownloadOnly {
return nil