From 9c7c88d41a3a4f59602f1e4b42635551379ccc99 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sat, 5 May 2018 21:42:14 +0300 Subject: Copy built packages to package cache directory --- src/feature/syncinstall.nim | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'src/feature') diff --git a/src/feature/syncinstall.nim b/src/feature/syncinstall.nim index 2677570..1ee40c4 100644 --- a/src/feature/syncinstall.nim +++ b/src/feature/syncinstall.nim @@ -534,33 +534,23 @@ proc installGroupFromSources(config: Config, commonArgs: seq[Argument], handleTmpRoot(false) (newSeq[(string, string)](), 1) else: + let pacmanParams = pacmanCmd & pacmanParams(config.color, + commonArgs & ("U", none(string), ArgumentType.short)) let asdeps = install.filter(p => not (p.name in explicits)).map(p => p.file) let asexplicit = install.filter(p => p.name in explicits).map(p => p.file) - proc doInstall(files: seq[string], addArgs: seq[Argument]): int = - if files.len > 0: - pacmanRun(true, config.color, commonArgs & - ("U", none(string), ArgumentType.short) & addArgs & - files.map(f => (f, none(string), ArgumentType.target))) - else: - 0 + let installParams = sudoPrefix & (pkgLibDir & "/install") & config.cache & + $pacmanParams.len & pacmanParams & $asdeps.len & asdeps & $asexplicit.len & asexplicit - let asdepsCode = doInstall(asdeps, - @[("asdeps", none(string), ArgumentType.long)]) - if asdepsCode != 0: + let code = forkWait(() => execResult(installParams)) + if code != 0: handleTmpRoot(false) - (newSeq[(string, string)](), asdepsCode) + (newSeq[(string, string)](), code) else: - let asexplicitCode = doInstall(asexplicit, - @[("asexplicit", none(string), ArgumentType.long)]) - if asexplicitCode != 0: - handleTmpRoot(false) - (newSeq[(string, string)](), asexplicitCode) - else: - handleTmpRoot(true) - let installedAs = lc[(r.name.unsafeGet, r.pkgInfo.name) | (br <- buildResults, - r <- br.replacePkgInfos, r.name.isSome), (string, string)] - (installedAs, 0) + handleTmpRoot(true) + let installedAs = lc[(r.name.unsafeGet, r.pkgInfo.name) | (br <- buildResults, + r <- br.replacePkgInfos, r.name.isSome), (string, string)] + (installedAs, 0) proc deduplicatePkgInfos(pkgInfos: seq[PackageInfo], config: Config, printWarning: bool): seq[PackageInfo] = -- cgit v1.2.3-70-g09d2