more debug out for pkgbuild parsing

This commit is contained in:
2020-08-13 09:10:56 +02:00
parent acd0f50b1a
commit a14677301b

View File

@@ -65,8 +65,8 @@ def build(pkgbuild, repo):
if not os.path.exists(os.path.join(config["basedir"]["repo"], "logs", repo)): if not os.path.exists(os.path.join(config["basedir"]["repo"], "logs", repo)):
os.mkdir(os.path.join(config["basedir"]["repo"], "logs", repo)) os.mkdir(os.path.join(config["basedir"]["repo"], "logs", repo))
with open(os.path.join(config["basedir"]["repo"], "logs", repo, name + ".log"), "w") as l: with open(os.path.join(config["basedir"]["repo"], "logs", repo, name + ".log"), "w") as log:
l.write(res.stdout.decode()) log.write(res.stdout.decode())
subprocess.run(["git", "clean", "-xdf"], check=True, capture_output=True) subprocess.run(["git", "clean", "-xdf"], check=True, capture_output=True)
os.chdir(sys.path[0]) os.chdir(sys.path[0])
@@ -165,8 +165,11 @@ def update_git2svn():
def parse_pkgbuild(pkgbuild_file): def parse_pkgbuild(pkgbuild_file):
with open(pkgbuild_file) as p: with open(pkgbuild_file) as p:
pkgbuild_str = p.read() pkgbuild_str = p.read()
pkgver = regex_pkgver.findall(pkgbuild_str)
pkgrel = regex_pkgrel.findall(pkgbuild_str) pkgver = regex_pkgver.findall(pkgbuild_str)
pkgrel = regex_pkgrel.findall(pkgbuild_str)
if not pkgver or not pkgrel:
logging.warning("[%s] Failed to parse pkgbuild", pkgbuild_file.split("/")[-4])
return semver.VersionInfo.parse("{}-{}".format(pkgver, pkgrel)) return semver.VersionInfo.parse("{}-{}".format(pkgver, pkgrel))