pq_rpm: fix the generate patches failed issue.
authorwanchao-xu <wanchao.xu@samsung.com>
Fri, 26 Apr 2024 09:54:57 +0000 (17:54 +0800)
committerwanchao-xu <wanchao.xu@samsung.com>
Fri, 26 Apr 2024 09:54:57 +0000 (17:54 +0800)
Change-Id: If4efc5c060b4dc8c4e9b302872696cb3edd5c50f
Signed-off-by: wanchao-xu <wanchao.xu@samsung.com>
gbp/scripts/common/pq.py
gbp/scripts/pq_rpm.py

index 40b1d9961e2319cf87744c1019339dd7bc1667ef..32f73a5b692ec303b9ec7bec0e776069b97dceed 100644 (file)
@@ -188,8 +188,12 @@ def patch_path_filter(file_status, exclude_regex=None):
         include_paths = []
         for file_list in file_status.values():
             for fname in file_list:
-                if not re.match(exclude_regex, fname):
-                    include_paths.append(fname)
+                if isinstance(fname, bytes):
+                    fname_str = fname.decode()
+                else:
+                    fname_str = fname
+                if not re.match(exclude_regex, fname_str):
+                    include_paths.append(fname_str)
     else:
         include_paths = ['.']
 
index be12de35b45459cbf790b2ad5e863ea68653f6e3..95c60b66381f52f635a9105320c17935e36fdf9a 100755 (executable)
@@ -147,7 +147,7 @@ def generate_patches(repo, start, squash, end, outdir, options):
             patch_fn = format_patch(outdir, repo, info, patches,
                                     numbered=options.patch_numbers,
                                     abbrev=options.abbrev,
-                                    patch_num_prefix_format=options.patch_export_ignore_path)
+                                    path_exclude_regex=options.patch_export_ignore_path)
             if patch_fn:
                 commands[os.path.basename(patch_fn)] = cmds
         else:
@@ -269,7 +269,7 @@ def export_patches(repo, options):
     GitCommand('status')(['--', spec.specdir])
 
     if options.drop:
-        drop_pq(repo, base)
+        drop_pq(repo, base, options.pq_branch, spec.version)
 
 
 def safe_patches(queue):
@@ -464,7 +464,7 @@ def drop_pq_rpm(repo, options):
         spec = parse_spec(options, repo, base)
     else:
         spec = parse_spec(options, repo)
-    drop_pq(repo, current, options, spec.version)
+    drop_pq(repo, current, options.pq_branch, spec.version)
 
 
 def switch_to_pq_branch(repo, branch, options):