Merge "Debian: make_patch prepare update to use hardlinks"

This commit is contained in:
Zuul 2022-11-17 20:10:14 +00:00 committed by Gerrit Code Review
commit 8e880d7764
1 changed files with 4 additions and 4 deletions

8
sw-patch/cgcs-patch/cgcs_make_patch/make_patch.py Normal file → Executable file
View File

@ -1,4 +1,4 @@
#!/bin/python3
#!/usr/bin/env python3
#
# Copyright (c) 2022 Wind River Systems, Inc.
#
@ -541,7 +541,7 @@ class PatchBuilder(object):
"""
commits_from_base = []
cmd = f"ostree --repo={repo} log starlingx | grep commit | sed \"s/.* //\""
cmd = f"ostree --repo={repo} log starlingx | grep \"^commit\" | sed \"s/.* //\""
commits = subprocess.check_output(cmd, shell=True).decode(sys.stdout.encoding).strip().split("\n")
log.info("Patch repo commits %s", commits)
@ -635,8 +635,8 @@ class PatchBuilder(object):
current_sha = open(os.path.join(self.ostree_repo, "refs/heads/starlingx"), "r").read()
log.info("Current SHA: %s", current_sha)
log.info("Cloning the directory...")
# Clone the ostree_repo dir (ignores the .lock file)
subprocess.call(["rsync", "-a", "--exclude", ".lock", self.ostree_repo + "/", clone_dir])
# Clone the ostree_repo dir using hard-links (ignores the .lock file)
subprocess.call(["rsync", "-a", "--exclude", ".lock", "--link-dest", "../ostree_repo", self.ostree_repo + "/", clone_dir])
log.info("Prepared ostree repo clone at %s", clone_dir)
def create_patch(self, patch_data: PatchRecipeData, clone_dir="ostree-clone", formal=False):