Home Home > GIT Browse > packaging
diff options
authorBenjamin Poirier <bpoirier@suse.com>2019-04-26 11:06:28 +0900
committerBenjamin Poirier <bpoirier@suse.com>2019-05-02 17:33:21 +0900
commit4f437ad1a664e03ca3925c925861729a547d3b45 (patch)
parent4223e69bddea4ddf3cc2160ccfb90b66f2a87161 (diff)
git-sort: qcp: Create subdir of quilt's .pc if needed
qcp.py creates a ~refresh file under a subdirectory of quilt's ".pc" directory. If there haven't been other patches applied yet which are in the same subdirectory (ex: "patches.fixes"), that directory does not exist. This situation can also occur in other scenarios when using `rapidquilt`. change qcp to create the directory if needed, instead of failing. Reported-by: Gary Lin <glin@suse.com>
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/git_sort/qcp.py b/scripts/git_sort/qcp.py
index 1b69943372..34ab8b35f5 100755
--- a/scripts/git_sort/qcp.py
+++ b/scripts/git_sort/qcp.py
@@ -51,7 +51,10 @@ def format_import(references, tmpdir, dstdir, rev, poi=[]):
subprocess.check_call(("quilt", "import", "-P", dst, src,))
# This will remind the user to run refresh_patch.sh
- lib.touch(".pc/%s~refresh" % (dst,))
+ target_dir = os.path.join(".pc", dstdir)
+ if not os.path.isdir(target_dir):
+ os.mkdir(target_dir)
+ lib.touch(os.path.join(".pc", "%s~refresh" % (dst,)))
return 0