Compare commits
3 Commits
6d2e371500
...
master
Author | SHA1 | Date | |
---|---|---|---|
ed150e0433 | |||
2fb7387cf8 | |||
6af405ca14 |
@@ -1,3 +1,7 @@
|
||||
# Deprecation notice
|
||||
|
||||
This was replaced with [ALHP.GO](https://git.harting.dev/anonfunc/ALHP.GO), please open any issues or PRs there.
|
||||
|
||||
# alhp
|
||||
|
||||
Build script for archlinux instructionset enabled repos.
|
||||
|
16
master.py
16
master.py
@@ -29,6 +29,7 @@ regex_pkg_repo = re.compile(r"^(.*)-.*-.*-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)
|
||||
fp = None
|
||||
update_last = time.time()
|
||||
copy_l = Lock()
|
||||
failed_l = Lock()
|
||||
repos = []
|
||||
|
||||
|
||||
@@ -59,7 +60,7 @@ def build(pkgbuild: str, repo: str) -> None:
|
||||
logging.warning("[%s/%s/%s] Build failed. Check repo/logs for more information.", process_name, repo, name)
|
||||
|
||||
# write packagename to failed list
|
||||
with open(os.path.join(config["basedir"]["repo"], repo + "_failed.txt"), "a") as f:
|
||||
with failed_l, open(os.path.join(config["basedir"]["repo"], repo + "_failed.txt"), "a") as f:
|
||||
f.write(name + "==" + str(parse_pkgbuild_ver(parsed=parsed)) + "\n")
|
||||
|
||||
# write logs
|
||||
@@ -194,6 +195,13 @@ def is_package_failed(package: str, ver: LegacyVersion, repo: str):
|
||||
|
||||
if s[0] == package:
|
||||
if ver > LegacyVersion(s[1]):
|
||||
with failed_l, open(os.path.join(config["basedir"]["repo"], repo + "_failed.txt"), "r+") as f:
|
||||
d = f.readlines()
|
||||
f.seek(0)
|
||||
f.truncate()
|
||||
for i in d:
|
||||
if i.strip("\n") != p:
|
||||
f.write(i)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
@@ -202,8 +210,8 @@ def is_package_failed(package: str, ver: LegacyVersion, repo: str):
|
||||
|
||||
def get_failed_packages(repo: str) -> list:
|
||||
if os.path.exists(os.path.join(config["basedir"]["repo"], repo + "_failed.txt")):
|
||||
with open(os.path.join(config["basedir"]["repo"], repo + "_failed.txt")) as p:
|
||||
return p.read().splitlines()
|
||||
with failed_l, open(os.path.join(config["basedir"]["repo"], repo + "_failed.txt")) as p:
|
||||
return p.readlines()
|
||||
else:
|
||||
return []
|
||||
|
||||
@@ -383,7 +391,7 @@ if __name__ == '__main__':
|
||||
time.sleep(300)
|
||||
do_repo_work()
|
||||
except KeyboardInterrupt:
|
||||
with copy_l:
|
||||
with copy_l, failed_l:
|
||||
pool.close()
|
||||
pool.terminate()
|
||||
q.close()
|
||||
|
2
utils.py
2
utils.py
@@ -32,8 +32,8 @@ def increase_pkgrel(pkgbuild_file: str, parsed: dict = None) -> None:
|
||||
parsed = parse_pkgbuild(pkgbuild_file)
|
||||
with open(pkgbuild_file, "r+", errors='ignore') as p:
|
||||
pkgbuild_str = p.read()
|
||||
p.seek(0)
|
||||
p.truncate(0)
|
||||
p.seek(0, 0)
|
||||
|
||||
pkgbuild_str = regex_pkgrel.sub("pkgrel=" + parsed["pkgrel"] + ".1", pkgbuild_str)
|
||||
p.write(pkgbuild_str)
|
||||
|
Reference in New Issue
Block a user