WIP: Some refactoring

This commit is contained in:
Nikolai Rodionov
2023-10-12 13:23:50 +02:00
parent 6a7e541b82
commit c67a9c84e4
7 changed files with 127 additions and 79 deletions

View File

@ -81,10 +81,13 @@ func DiffReleases(src, dest release.Releases) (*Diff, error) {
func (diff *Diff) Resolve(repositories repository.Repositories, path string) (lockfile.LockFile, error) {
lockfile := lockfile.LockFile{}
reposWished := repository.Repositories{}
for _, p := range diff.PreservedReleases {
logrus.Infof("preserving %s", p.Release)
lockfile = append(lockfile, p.LockEntry())
reposWished = append(reposWished, p.RepositoryObj)
}
for _, a := range diff.AddedReleases {
logrus.Infof("adding %s", a.Release)
lockfile = append(lockfile, a.LockEntry())
@ -97,7 +100,11 @@ func (diff *Diff) Resolve(repositories repository.Repositories, path string) (lo
reposWished = append(reposWished, u.RepositoryObj)
}
// Repo Wished is the list of all repos that are required by the current setup, we need to
for _, d := range diff.DeletedReleases {
logrus.Infof("removing %s", d.Release)
}
// Repo Wished is the list of all repos that are required by the current setup
// Existing repos are all the repos in the lockfile
for _, repoExisting := range repositories {