summaryrefslogtreecommitdiff
path: root/tools/patman/patchstream.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-04-18 19:24:13 -0400
committerTom Rini <trini@konsulko.com>2015-04-18 19:24:13 -0400
commitb8d7652c81689a69bc6eaa206cf875bbe632831c (patch)
tree07dfe799746a81e14b939e3d52157d4aaa319881 /tools/patman/patchstream.py
parent9efaca3e847696ed40fca1dbbc621fcc35b8d94c (diff)
parent35ce2dc4d1148b66ce9271d15879dbfec5dd57f4 (diff)
Merge branch 'buildman' of git://git.denx.de/u-boot-x86
Diffstat (limited to 'tools/patman/patchstream.py')
-rw-r--r--tools/patman/patchstream.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 8c3a0ec9eee..6d3c41f49ec 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -3,6 +3,7 @@
# SPDX-License-Identifier: GPL-2.0+
#
+import math
import os
import re
import shutil
@@ -468,8 +469,10 @@ def InsertCoverLetter(fname, series, count):
prefix = series.GetPatchPrefix()
for line in lines:
if line.startswith('Subject:'):
- # TODO: if more than 10 patches this should save 00/xx, not 0/xx
- line = 'Subject: [%s 0/%d] %s\n' % (prefix, count, text[0])
+ # if more than 10 or 100 patches, it should say 00/xx, 000/xxx, etc
+ zero_repeat = int(math.log10(count)) + 1
+ zero = '0' * zero_repeat
+ line = 'Subject: [%s %s/%d] %s\n' % (prefix, zero, count, text[0])
# Insert our cover letter
elif line.startswith('*** BLURB HERE ***'):