From 7accdb6dab38f0ecb49669b7ddc04dc4f5facd14 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sun, 10 Jun 2018 00:03:03 +0300 Subject: Allow to ignore arch in PKGBUILD --- doc/pakku.conf.5.txt | 4 ++++ pakku.conf | 1 + src/config.nim | 7 +++++-- src/feature/syncinstall.nim | 11 ++++++----- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/doc/pakku.conf.5.txt b/doc/pakku.conf.5.txt index 3357aa8..bc840e2 100644 --- a/doc/pakku.conf.5.txt +++ b/doc/pakku.conf.5.txt @@ -35,6 +35,10 @@ Options Check ignored packages for updates in AUR. Pakku will be able to warn about ignored package upgrade. +*IgnoreArch*:: + Ignore a missing or incomplete arch field in the build script. Pakku + will pass '\--ignorearch' option to linkman:makepkg[8]. + *PrintAurNotFound*:: Print warnings during upgrade operation when foreign packages were not found in AUR. diff --git a/pakku.conf b/pakku.conf index c09f454..72b5240 100644 --- a/pakku.conf +++ b/pakku.conf @@ -7,6 +7,7 @@ AurComments CheckIgnored +#IgnoreArch PrintAurNotFound #SudoExec #ViewNoDefault diff --git a/src/config.nim b/src/config.nim index a0c8281..1937ed3 100644 --- a/src/config.nim +++ b/src/config.nim @@ -45,6 +45,7 @@ type aurRepo*: string aurComments*: bool checkIgnored*: bool + ignoreArch*: bool printAurNotFound*: bool sudoExec*: bool viewNoDefault*: bool @@ -152,6 +153,7 @@ proc obtainConfig*(config: PacmanConfig): Config = let aurRepo = options.opt("AurRepo").get("aur") let aurComments = options.hasKey("AurComments") let checkIgnored = options.hasKey("CheckIgnored") + let ignoreArch = options.hasKey("IgnoreArch") let printAurNotFound = options.hasKey("PrintAurNotFound") let sudoExec = options.hasKey("SudoExec") let viewNoDefault = options.hasKey("ViewNoDefault") @@ -176,8 +178,9 @@ proc obtainConfig*(config: PacmanConfig): Config = root: root, db: db, cache: cache, userCacheInitial: userCacheInitial, userCacheCurrent: userCacheCurrent, tmpRootInitial: tmpRootInitial, tmpRootCurrent: tmpRootCurrent, color: color, aurRepo: aurRepo, aurComments: aurComments, - checkIgnored: checkIgnored, printAurNotFound: printAurNotFound, sudoExec: sudoExec, - viewNoDefault: viewNoDefault, preserveBuilt: preserveBuilt, preBuildCommand: preBuildCommand) + checkIgnored: checkIgnored, ignoreArch: ignoreArch, 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 = diff --git a/src/feature/syncinstall.nim b/src/feature/syncinstall.nim index 7b5bd5d..137d095 100644 --- a/src/feature/syncinstall.nim +++ b/src/feature/syncinstall.nim @@ -430,12 +430,13 @@ proc buildLoop(config: Config, pkgInfos: seq[PackageInfo], skipDeps: bool, removeDirQuiet(buildPath & "src") let optional: seq[tuple[arg: string, cond: bool]] = @[ - ("-e", noextract), - ("-m", not config.color), - ("-d", skipDeps) + ("--noextract", noextract), + ("--nocolor", not config.color), + ("--ignorearch", config.ignoreArch), + ("--nodeps", skipDeps) ] - execResult(@[makepkgCmd, "--config", workConfFile, "-f"] & + execResult(@[makepkgCmd, "--config", workConfFile, "--force"] & optional.filter(o => o.cond).map(o => o.arg))) discard unlink(workConfFile) @@ -550,7 +551,7 @@ proc installGroupFromSources(config: Config, commonArgs: seq[Argument], let (buildResults, buildCode) = buildNext(0, nil) proc formatArchiveFile(pkgInfo: PackageInfo, ext: string): string = - let arch = if config.arch in pkgInfo.archs: config.arch else: "any" + let arch = if pkgInfo.archs.len > 0: config.arch else: "any" config.tmpRootInitial & "/" & pkgInfo.name & "-" & pkgInfo.version & "-" & arch & ext let allFiles = lc[(r.name, formatArchiveFile(r.pkgInfo, br.ext)) | -- cgit v1.2.3-70-g09d2