Mercurial > hg-stable
comparison contrib/packaging/buildrpm @ 43340:e0812b032bcc stable
packaging: make python snippets in rpm building python3 compatible
Fedora 31 has Python3 at /usr/bin/python, and buildrpm would fail on snippets
that use python2 syntax. Instead of forcing python2, just accept for the future
while staying backwards compatible.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 27 Oct 2019 20:17:33 +0100 |
parents | ae68418cc3a1 |
children | a6dcac6454c1 |
comparison
equal
deleted
inserted
replaced
43339:1a0d419ec763 | 43340:e0812b032bcc |
---|---|
119 for l in sorted(changelog, reverse=True): | 119 for l in sorted(changelog, reverse=True): |
120 title = "* %s %s" % (datestr(l[2], "%a %b %d %Y"), l[1]) | 120 title = "* %s %s" % (datestr(l[2], "%a %b %d %Y"), l[1]) |
121 if prevtitle != title: | 121 if prevtitle != title: |
122 prevtitle = title | 122 prevtitle = title |
123 print | 123 print |
124 print title | 124 print(title) |
125 print "- %s" % l[3].strip() | 125 print("- %s" % l[3].strip()) |
126 ' >> $rpmspec | 126 ' >> $rpmspec |
127 | 127 |
128 else | 128 else |
129 | 129 |
130 $HG log \ | 130 $HG log \ |
136 return time.strftime(format, time.gmtime(float(date[0]) - date[1])) | 136 return time.strftime(format, time.gmtime(float(date[0]) - date[1])) |
137 | 137 |
138 for l in sys.stdin.readlines(): | 138 for l in sys.stdin.readlines(): |
139 tok = l.split("\t") | 139 tok = l.split("\t") |
140 hgdate = tuple(int(v) for v in tok[0].split()) | 140 hgdate = tuple(int(v) for v in tok[0].split()) |
141 print "* %s %s\n- %s" % (datestr(hgdate, "%a %b %d %Y"), tok[1], tok[2]) | 141 print("* %s %s\n- %s" % (datestr(hgdate, "%a %b %d %Y"), tok[1], tok[2])) |
142 ' >> $rpmspec | 142 ' >> $rpmspec |
143 | 143 |
144 fi | 144 fi |
145 | 145 |
146 sed -i \ | 146 sed -i \ |