From 635ad7f462419a48e199df698caf09225ca1a52d Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Tue, 13 Mar 2018 21:04:57 +0300 Subject: Don't bisect AUR packages Since .SRCINFO might be changed without version change, bisecting becomes not suitable for finding the commit. Some packagers forget to update pkgrel or even .SRCINFO making changes to PKGBUILD, so bisecting can do more harm than good. --- lib/bisect.nim | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) (limited to 'lib') diff --git a/lib/bisect.nim b/lib/bisect.nim index 53d73f1..55d5a60 100644 --- a/lib/bisect.nim +++ b/lib/bisect.nim @@ -14,42 +14,13 @@ proc getSourceVersion(relativePath: string): seq[string] = else: @[] -proc getSrcInfoVersion(relativePath: string): seq[string] = - var file: File - var epoch = "" - var pkgver = "" - var pkgrel = "" - - if file.open(relativePath & "/.SRCINFO"): - try: - var matches: array[2, string] - while true: - let line = file.readLine() - if line.match(re"[\t\ ]*(\w+)\ =\ (.*)", matches): - case matches[0]: - of "epoch": - epoch = matches[1] - of "pkgver": - pkgver = matches[1] - of "pkgrel": - pkgrel = matches[1] - else: - discard - except: - discard - finally: - file.close() - - @[epoch, pkgver, pkgrel] - -let compareMethod = commandLineParams()[0] -let relativePath = commandLineParams()[1] -let compareVersion = commandLineParams()[2] +let params = commandLineParams() +let compareMethod = params[0] +let relativePath = params[1] +let compareVersion = params[2] let (currentVersion, supported) = if compareMethod == "source": (getSourceVersion(relativePath), true) - elif compareMethod == "srcinfo": - (getSrcInfoVersion(relativePath), true) else: (@[], false) @@ -70,6 +41,7 @@ else: else: pkgver & "-" & pkgrel + # this output is required by main program echo(version) if vercmp(compareVersion, version) > 0: programResult = 0 -- cgit v1.2.3-70-g09d2