add pkgrel increase, fixed some bugs related to relative paths
This commit is contained in:
@@ -124,7 +124,7 @@ DBGSRCDIR="/usr/src/debug"
|
|||||||
#-- Log files: specify a fixed directory where all log files will be placed
|
#-- Log files: specify a fixed directory where all log files will be placed
|
||||||
#LOGDEST=/home/makepkglogs
|
#LOGDEST=/home/makepkglogs
|
||||||
#-- Packager: name/email of the person or organization building packages
|
#-- Packager: name/email of the person or organization building packages
|
||||||
#PACKAGER="John Doe <john@doe.com>"
|
PACKAGER="ALHP Buildbot"
|
||||||
#-- Specify a key to use for package signing
|
#-- Specify a key to use for package signing
|
||||||
#GPGKEY=""
|
#GPGKEY=""
|
||||||
|
|
||||||
|
29
master.py
29
master.py
@@ -36,12 +36,15 @@ def build(pkgbuild, repo):
|
|||||||
# import pgp keys
|
# import pgp keys
|
||||||
import_keys(pkgbuild)
|
import_keys(pkgbuild)
|
||||||
|
|
||||||
|
# increase pkgrel
|
||||||
|
increase_pkgrel(pkgbuild)
|
||||||
|
|
||||||
# build with devtools
|
# build with devtools
|
||||||
os.chdir(pathlib.Path(pkgbuild).parent)
|
os.chdir(pathlib.Path(pkgbuild).parent)
|
||||||
res = subprocess.run(
|
res = subprocess.run(
|
||||||
["makechrootpkg", "-D", os.path.join(sys.path[0], config["basedir"]["makepkg"]), "-l", process_name, "-r",
|
["makechrootpkg", "-D", os.path.join(config["basedir"]["makepkg"]), "-l", process_name, "-r",
|
||||||
os.path.join(sys.path[0], config["basedir"]["chroot"]), "--", "--config",
|
os.path.join(config["basedir"]["chroot"]), "--", "--config",
|
||||||
os.path.join(sys.path[0], config["basedir"]["makepkg"]) + "makepkg-" + '-'.join(
|
os.path.join(config["basedir"]["makepkg"]) + "makepkg-" + '-'.join(
|
||||||
repo.split("-")[1:]) + ".conf"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
repo.split("-")[1:]) + ".conf"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
if res.returncode:
|
if res.returncode:
|
||||||
logging.warning("[%s/%s] Build failed. Check repo/logs for more information.", repo, name)
|
logging.warning("[%s/%s] Build failed. Check repo/logs for more information.", repo, name)
|
||||||
@@ -52,8 +55,8 @@ def build(pkgbuild, repo):
|
|||||||
|
|
||||||
# write logs
|
# write logs
|
||||||
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)):
|
||||||
pathlib.Path(os.path.join(sys.path[0], config["basedir"]["repo"], "logs", repo)).mkdir(parents=True,
|
pathlib.Path(os.path.join(config["basedir"]["repo"], "logs", repo)).mkdir(parents=True,
|
||||||
exist_ok=True)
|
exist_ok=True)
|
||||||
with open(os.path.join(config["basedir"]["repo"], "logs", repo, name + ".log"), "w") as log:
|
with open(os.path.join(config["basedir"]["repo"], "logs", repo, name + ".log"), "w") as log:
|
||||||
log.write(res.stdout.decode())
|
log.write(res.stdout.decode())
|
||||||
|
|
||||||
@@ -142,8 +145,6 @@ def get_failed_packages(repo):
|
|||||||
|
|
||||||
|
|
||||||
def build_cleanup():
|
def build_cleanup():
|
||||||
logging.debug("[GIT] %s", subprocess.run(["git", "clean", "-xdf"], check=True, stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT).stdout.decode())
|
|
||||||
os.chdir(sys.path[0])
|
os.chdir(sys.path[0])
|
||||||
|
|
||||||
|
|
||||||
@@ -167,7 +168,7 @@ def setup_makepkg(repo):
|
|||||||
c_all = conf.read()
|
c_all = conf.read()
|
||||||
c_all = c_all.replace("-mtune=generic", "")
|
c_all = c_all.replace("-mtune=generic", "")
|
||||||
c_all = c_all.replace("-O2", "-O3")
|
c_all = c_all.replace("-O2", "-O3")
|
||||||
c_all = regex_march.sub(r"\1" + '-'.join(repo.split("-")[1:]) + " ", c_all)
|
c_all = regex_march.sub(r"\1" + '-'.join(repo.split("-")[1:]), c_all)
|
||||||
with open(makepkg_repo, "w") as conf:
|
with open(makepkg_repo, "w") as conf:
|
||||||
conf.write(c_all)
|
conf.write(c_all)
|
||||||
|
|
||||||
@@ -211,6 +212,8 @@ def update_git2svn():
|
|||||||
os.chdir(git_dir)
|
os.chdir(git_dir)
|
||||||
logging.debug("[GIT] %s", subprocess.run(["git", "clean", "-xdf"], check=True, stdout=subprocess.PIPE,
|
logging.debug("[GIT] %s", subprocess.run(["git", "clean", "-xdf"], check=True, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT).stdout.decode())
|
stderr=subprocess.STDOUT).stdout.decode())
|
||||||
|
logging.debug("[GIT] %s", subprocess.run(["git", "reset", "--hard"], check=True, stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT).stdout.decode())
|
||||||
logging.debug("[GIT] %s", subprocess.run(["git", "pull"], check=True, stdout=subprocess.PIPE,
|
logging.debug("[GIT] %s", subprocess.run(["git", "pull"], check=True, stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT).stdout.decode())
|
stderr=subprocess.STDOUT).stdout.decode())
|
||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
@@ -229,6 +232,16 @@ def parse_pkgbuild(pkgbuild_file):
|
|||||||
return version.parse("{}-{}".format(pkgver[0], pkgrel[0]))
|
return version.parse("{}-{}".format(pkgver[0], pkgrel[0]))
|
||||||
|
|
||||||
|
|
||||||
|
def increase_pkgrel(pkgbuild_file):
|
||||||
|
with open(pkgbuild_file, errors='ignore') as p:
|
||||||
|
pkgbuild_str = p.read()
|
||||||
|
|
||||||
|
pkgbuild_str = regex_pkgrel.sub(r"pkgrel=\1.1", pkgbuild_str)
|
||||||
|
|
||||||
|
with open(pkgbuild_file, "w") as pkg:
|
||||||
|
pkg.write(pkgbuild_str)
|
||||||
|
|
||||||
|
|
||||||
def parse_repo(name, repo):
|
def parse_repo(name, repo):
|
||||||
ver_split = find_all_files_for_pkg(name, repo)[0].split("-")
|
ver_split = find_all_files_for_pkg(name, repo)[0].split("-")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user