From 6220a954ef32fec18258b4feab6494aa016764e0 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Thu, 31 May 2018 09:56:07 +0300 Subject: Simplify alpm initialization --- src/config.nim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/config.nim') diff --git a/src/config.nim b/src/config.nim index f0c8710..2aa9974 100644 --- a/src/config.nim +++ b/src/config.nim @@ -164,3 +164,8 @@ proc obtainConfig*(config: PacmanConfig): Config = aurComments: aurComments, checkIgnored: checkIgnored, printAurNotFound: printAurNotFound, sudoExec: sudoExec, viewNoDefault: viewNoDefault, preserveBuilt: preserveBuilt, preBuildCommand: preBuildCommand) + +template withAlpmConfig*(config: Config, passDbs: bool, + handle: untyped, alpmDbs: untyped, errors: untyped, body: untyped): untyped = + withAlpm(config.root, config.db, if passDbs: config.dbs else: @[], config.arch, + handle, alpmDbs, errors, body) -- cgit v1.2.3-70-g09d2