fixed truncate
This commit is contained in:
parent
6af405ca14
commit
2fb7387cf8
@ -195,7 +195,7 @@ 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")) as f:
|
||||
with failed_l, open(os.path.join(config["basedir"]["repo"], repo + "_failed.txt"), "r+") as f:
|
||||
d = f.readlines()
|
||||
f.seek(0)
|
||||
f.truncate()
|
||||
|
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.truncate(0)
|
||||
p.seek(0)
|
||||
p.truncate(0)
|
||||
|
||||
pkgbuild_str = regex_pkgrel.sub("pkgrel=" + parsed["pkgrel"] + ".1", pkgbuild_str)
|
||||
p.write(pkgbuild_str)
|
||||
|
Reference in New Issue
Block a user