fixed parse_pkgbuild not returning anything; some logix fixes

This commit is contained in:
2021-05-31 14:35:19 +02:00
parent ce43b426ac
commit c77a632653
2 changed files with 11 additions and 11 deletions

View File

@@ -5,22 +5,20 @@ import glob
import logging.config
import os
import pathlib
import pprint
import re
import shutil
import signal
import subprocess
import sys
import time
from multiprocessing import Pool, current_process, JoinableQueue, Lock, Manager
import traceback
from multiprocessing import Pool, current_process, JoinableQueue, Lock
import yaml
from humanfriendly import format_timespan
from packaging import version
from packaging.version import LegacyVersion
from srcinfo.parse import parse_srcinfo
from utils import parse_pkgbuild, parse_pkgbuild_ver
from utils import parse_pkgbuild, parse_pkgbuild_ver, import_keys
regex_pkgver = re.compile(r"^_?pkgver\s*=\s*(.+)$", re.MULTILINE)
regex_pkgrel = re.compile(r"^pkgrel\s*=\s*(.+)$", re.MULTILINE)
@@ -109,6 +107,7 @@ def run_worker() -> None:
build(*q.get(block=True))
except Exception as e:
logging.error("Error in worker: %s", e)
traceback.print_exc()
finally:
q.task_done()
os.chdir(sys.path[0])
@@ -229,10 +228,13 @@ def update_svn2git() -> None:
def increase_pkgrel(pkgbuild_file) -> None:
with open(pkgbuild_file, "rw+", errors='ignore') as p:
parsed = parse_pkgbuild(pkgbuild_file)
with open(pkgbuild_file, "r+", errors='ignore') as p:
pkgbuild_str = p.read()
p.truncate(0)
p.seek(0, 0)
pkgbuild_str = regex_pkgrel.sub(r"pkgrel=\1.1", pkgbuild_str)
pkgbuild_str = regex_pkgrel.sub("pkgrel=" + parsed["pkgrel"] + ".1", pkgbuild_str)
p.write(pkgbuild_str)
@@ -284,7 +286,7 @@ def fill_queue() -> None:
parsed = parse_pkgbuild(pkgbuild)
# ignore pkgbuild if in trunk, -any package, not in repos, on blacklist, not for current arch
if path_split[-2] == "trunk" or path_split[-2].split("-")[0] not in config["repos"] or parsed["arch"] == "any" \
if path_split[-2] == "trunk" or path_split[-2].split("-")[0] not in config["repos"] or "any" in parsed["arch"] \
or parsed["pkgbase"] in config["blacklist"] or "i686" in path_split[-2]:
# TODO: delete pkgs not build anymore
pass