From fe3b51fadfd7aed6c45db4ce37e682295b164a2b Mon Sep 17 00:00:00 2001 From: Jerry Date: Thu, 5 Sep 2019 09:28:53 +0800 Subject: [PATCH] some pkgbuild has no quotation mark in arch --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 578dd58..9d74c5f 100644 --- a/utils.py +++ b/utils.py @@ -211,7 +211,7 @@ def get_arch_from_pkgbuild(fpath): with open(fpath, 'r') as f: for line in f.read().split('\n'): if line.startswith('arch='): - matches = re.findall('[\'\"]([^\'\"]+)[\'\"]', line) + matches = re.findall('[()\s\'\"]([\w]+)[()\s\'\"]', line) if not matches: raise TypeError('Unexpected PKGBUILD format') matches = [arch for arch in matches if arch in ARCHS]