Commit 4239c35b authored by Robin Sonnabend's avatar Robin Sonnabend

Fix applying patch

parent b8d1b9c2
Pipeline #590 passed with stage
in 13 minutes and 30 seconds
......@@ -3,12 +3,12 @@ maintainer:
mail: admin@fsmpi.rwth-aachen.de
upload_target: repo@web.fsmpi.rwth-aachen.de:/srv/repo/incoming/
packages:
- name: adcli
version: 0.8.2-1.1-fsmpi
changelog: Apply the unreleased upstream-patches, fixing RT#100
additional_content:
- patch_dir: patches/adcli
target_dir: debian
#- name: adcli
# version: 0.8.2-1.1-fsmpi
# changelog: Apply the unreleased upstream-patches, fixing RT#100
# additional_content:
# - patch_dir: patches/adcli
# target_dir: debian
- name: nginx
changelog: Add libnginx-mod-http-shibboleth
additional_content:
......
......@@ -25,15 +25,12 @@ EXTRACT_PATTERN = (r"extracting (?P<name>{pkg_name}) in (?P<dir>{pkg_name}-{vers
def run_checked(command, **kwargs):
print(command)
print(os.getcwd(), command)
try:
result = sp.run(
return sp.run(
command, check=True,
stdout=sp.PIPE, stderr=sp.PIPE, universal_newlines=True,
**kwargs)
print(result.stdout)
print(result.stderr)
return result
except sp.CalledProcessError as error:
print(error.stdout)
print(error.stderr)
......@@ -71,7 +68,6 @@ def build_package(repo_dir, package_dir, name,
workdir = os.path.join(tempdir, pkg_dir)
if additional_content is not None:
for content in additional_content:
target_dir = content["target_dir"]
......@@ -82,7 +78,9 @@ def build_package(repo_dir, package_dir, name,
apply_patches(abs_patch_dir)
elif "patch" in content:
abs_patch_dir = os.path.join(repo_dir, content["patch"])
run_checked(["patch", "-d", ".", "-p0", abs_patch_dir])
with open(abs_patch_dir, "r") as patch_file:
run_checked(["patch", "-d", ".", "-p0"],
input=patch_file.read())
elif "git_url" in content:
run_checked(["git", "clone", content["git_url"]])
elif "copy" in content:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment