From 220c977d972821298db64571e553b6c5bc36d374 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sat, 5 May 2018 22:04:45 +0300 Subject: Don't turn dependencies into explicits --- src/feature/syncinstall.nim | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/feature/syncinstall.nim b/src/feature/syncinstall.nim index 1ee40c4..3b61eea 100644 --- a/src/feature/syncinstall.nim +++ b/src/feature/syncinstall.nim @@ -1091,24 +1091,21 @@ proc findSyncTargetsWithInstalled(config: Config, targets: seq[PackageTarget], let installed = lc[($p.name, $p.version, p.groupsSeq, p.reason == AlpmReason.explicit) | (p <- handle.local.packages), Installed] - let foreignUpgrade = if upgradeCount > 0: (block: - proc checkForeignAndIrreplaceable(name: string): bool = - if dbs.filter(d => d[name] != nil).len > 0: - return false - else: - for db in dbs: - for pkg in db.packages: - for replaces in pkg.replaces: - if replaces.name == name: - return false - return true - - installed - .map(i => i.name) - .filter(checkForeignAndIrreplaceable) - .toSet) + proc checkForeignAndIrreplaceable(name: string): bool = + if dbs.filter(d => d[name] != nil).len > 0: + return false else: - initSet[string]() + for db in dbs: + for pkg in db.packages: + for replaces in pkg.replaces: + if replaces.name == name: + return false + return true + + let foreignUpgrade = installed + .map(i => i.name) + .filter(checkForeignAndIrreplaceable) + .toSet let checkAurNamesFull = if noaur: @[] -- cgit v1.2.3-70-g09d2