From c878da206452b3839c3fd180633d2d20be69e58f Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Wed, 9 Jun 2021 11:28:54 -0400 Subject: Fix for recent function API changes Returning a simple list of messages from get_am_ready broke a few other auxiliary functions invoked when run with -o- or -Q. Reported-by: Greg Kroah-Hartman Signed-off-by: Konstantin Ryabitsev --- b4/mbox.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/b4/mbox.py b/b4/mbox.py index c0ada06..eeccaf2 100644 --- a/b4/mbox.py +++ b/b4/mbox.py @@ -130,7 +130,7 @@ def make_am(msgs, cmdargs, msgid): else: am_filename = None am_cover = None - b4.save_git_am_mbox([x[1] for x in am_msgs], sys.stdout.buffer) + b4.save_git_am_mbox(am_msgs, sys.stdout.buffer) logger.info('---') @@ -341,7 +341,9 @@ def save_as_quilt(am_msgs, q_dirname): return pathlib.Path(q_dirname).mkdir(parents=True) patch_filenames = list() - for slug, msg in am_msgs: + for msg in am_msgs: + lsubj = b4.LoreSubject(msg.get('subject', '')) + slug = '%04d_%s' % (lsubj.counter, re.sub(r'\W+', '_', lsubj.subject).strip('_').lower()) patch_filename = f'{slug}.patch' patch_filenames.append(patch_filename) quilt_out = os.path.join(q_dirname, patch_filename) -- cgit v1.2.3