Skip to content

Commit 219d872

Browse files
authored
Update services/packages/arch/repository.go
1 parent de4db89 commit 219d872

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/packages/arch/repository.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ func buildPackagesIndex(ctx context.Context, ownerID int64, repoVersion *package
245245
return err
246246
}
247247

248+
// here we compare the versions but not using SearchLatestVersions because we shouldn't allow "downgrading" to a older version by "latest" one.
249+
// https://wiki.archlinux.org/title/Downgrading_packages : randomly downgrading can mess up dependencies:
250+
// If a downgrade involves a soname change, all dependencies may need downgrading or rebuilding too.
248251
if old, ok := vpfs[current.Version.PackageID]; ok {
249252
if compareVersions(old.Version.Version, current.Version.Version) == -1 {
250253
vpfs[current.Version.PackageID] = current

0 commit comments

Comments
 (0)