From 0b6c3e6732c5c0d5b6613d2fe450c3b7760c0827 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sat, 9 Jun 2018 22:26:16 +0300 Subject: Add support for "--disable-download-timeout" option --- src/feature/syncinfo.nim | 3 ++- src/feature/syncinstall.nim | 16 +++++++++------- src/feature/syncsearch.nim | 3 ++- src/feature/syncsource.nim | 3 ++- 4 files changed, 15 insertions(+), 10 deletions(-) (limited to 'src/feature') diff --git a/src/feature/syncinfo.nim b/src/feature/syncinfo.nim index 483df3c..546c631 100644 --- a/src/feature/syncinfo.nim +++ b/src/feature/syncinfo.nim @@ -110,7 +110,8 @@ proc handleSyncInfo*(args: seq[Argument], config: Config): int = for e in errors: printError(config.color, e) findSyncTargets(handle, dbs, targets, config.aurRepo, false, false) - let (pkgInfos, _, aerrors) = getAurPackageInfos(checkAurNames, config.aurRepo, config.arch) + let (pkgInfos, _, aerrors) = getAurPackageInfos(checkAurNames, + config.aurRepo, config.arch, config.downloadTimeout) for e in aerrors: printError(config.color, e) let fullTargets = mapAurTargets[PackageInfo](syncTargets, pkgInfos, config.aurRepo) diff --git a/src/feature/syncinstall.nim b/src/feature/syncinstall.nim index b583fe6..7b5bd5d 100644 --- a/src/feature/syncinstall.nim +++ b/src/feature/syncinstall.nim @@ -199,13 +199,13 @@ proc findDependencies(config: Config, handle: ptr AlpmHandle, dbs: seq[ptr AlpmD try: withAur(): let (pkgInfos, additionalPkgInfos, paths) = if printMode: (block: - let (pkgInfos, additionalPkgInfos, aerrors) = - getAurPackageInfos(aurCheck.map(r => r.name), config.aurRepo, config.arch) + let (pkgInfos, additionalPkgInfos, aerrors) = getAurPackageInfos(aurCheck + .map(r => r.name), config.aurRepo, config.arch, config.downloadTimeout) for e in aerrors: printError(config.color, e) (pkgInfos, additionalPkgInfos, newSeq[string]())) else: (block: let (rpcInfos, aerrors) = getRpcPackageInfos(aurCheck.map(r => r.name), - config.aurRepo) + config.aurRepo, config.downloadTimeout) for e in aerrors: printError(config.color, e) let (pkgInfos, additionalPkgInfos, paths, cerrors) = cloneAurReposWithPackageInfos(config, rpcInfos, not printMode, update, true) @@ -1135,11 +1135,12 @@ proc obtainAurPackageInfos(config: Config, rpcInfos: seq[RpcPackageInfo], let (update, terminate) = createCloneProgress(config, fullRpcInfos.len, true, printMode) let (pkgInfos, additionalPkgInfos, paths, errors) = if printMode: (block: - let (pkgInfos, additionalPkgInfos, aerrors) = - getAurPackageInfos(fullRpcInfos.map(i => i.name), config.aurRepo, config.arch) + let (pkgInfos, additionalPkgInfos, aerrors) = getAurPackageInfos(fullRpcInfos + .map(i => i.name), config.aurRepo, config.arch, config.downloadTimeout) (pkgInfos, additionalPkgInfos, newSeq[string](), aerrors.deduplicate)) else: (block: - let (rpcInfos, aerrors) = getRpcPackageInfos(fullRpcInfos.map(i => i.name), config.aurRepo) + let (rpcInfos, aerrors) = getRpcPackageInfos(fullRpcInfos.map(i => i.name), + config.aurRepo, config.downloadTimeout) let (pkgInfos, additionalPkgInfos, paths, cerrors) = cloneAurReposWithPackageInfos(config, rpcInfos, not printMode, update, true) (pkgInfos, additionalPkgInfos, paths, (toSeq(aerrors.items) & cerrors).deduplicate)) @@ -1248,7 +1249,8 @@ proc resolveBuildTargets(config: Config, targets: seq[PackageTarget], if checkAurNames.len > 0: echo(tr"checking AUR database...") - let (rpcInfos, rerrors) = getRpcPackageInfos(checkAurNames, config.aurRepo) + let (rpcInfos, rerrors) = getRpcPackageInfos(checkAurNames, + config.aurRepo, config.downloadTimeout) for e in rerrors: printError(config.color, e) let rpcNotFoundTargets = filterNotFoundSyncTargets(syncTargets, diff --git a/src/feature/syncsearch.nim b/src/feature/syncsearch.nim index 7a9199d..9aa179e 100644 --- a/src/feature/syncsearch.nim +++ b/src/feature/syncsearch.nim @@ -11,7 +11,8 @@ proc handleSyncSearch*(args: seq[Argument], config: Config): int = else: let quiet = args.check(%%%"quiet") - let (aurPackages, aerrors) = findAurPackages(args.targets, config.aurRepo) + let (aurPackages, aerrors) = findAurPackages(args.targets, + config.aurRepo, config.downloadTimeout) for e in aerrors: printError(config.color, e) type Package = tuple[rpcInfo: RpcPackageInfo, installedVersion: Option[string]] diff --git a/src/feature/syncsource.nim b/src/feature/syncsource.nim index df543c7..e0531bc 100644 --- a/src/feature/syncsource.nim +++ b/src/feature/syncsource.nim @@ -168,7 +168,8 @@ proc handleSyncSource*(args: seq[Argument], config: Config): int = for e in errors: printError(config.color, e) findSyncTargets(handle, dbs, targets, config.aurRepo, false, false) - let (rpcInfos, aerrors) = getRpcPackageInfos(checkAurNames, config.aurRepo) + let (rpcInfos, aerrors) = getRpcPackageInfos(checkAurNames, + config.aurRepo, config.downloadTimeout) for e in aerrors: printError(config.color, e) let notFoundTargets = filterNotFoundSyncTargets(syncTargets, -- cgit v1.2.3-70-g09d2