Show More
@@ -57,18 +57,50 b' sed -e "s,^Version:.*,Version: $version,' | |||
|
57 | 57 | -e "s,^Release:.*,Release: $release," \ |
|
58 | 58 | $specfile > $rpmspec |
|
59 | 59 | |
|
60 |
|
|
|
61 | %changelog | |
|
62 | * `LANG=en_US date +'%a %b %d %Y'` `$HG showconfig ui.username` $version-$release | |
|
63 | - Automatically built via $0 | |
|
60 | echo >> $rpmspec | |
|
61 | echo "%changelog" >> $rpmspec | |
|
62 | ||
|
63 | if echo $version | grep '+' > /dev/null 2>&1; then | |
|
64 | latesttag="`echo $version | sed -e 's/+.*//'`" | |
|
65 | $HG log -r .:"$latesttag" -fM \ | |
|
66 | --template '{date|hgdate}\t{author}\t{desc|firstline}\n' | python -c ' | |
|
67 | import sys, time | |
|
68 | ||
|
69 | def datestr(date, format): | |
|
70 | return time.strftime(format, time.gmtime(float(date[0]) - date[1])) | |
|
64 | 71 | |
|
65 | EOF | |
|
66 | $HG log \ | |
|
67 | --template '* {date|rfc822date} {author}\n- {desc|firstline}\n\n' \ | |
|
68 | .hgtags \ | |
|
69 | | sed -e 's/^\(\* [MTWFS][a-z][a-z]\), \([0-3][0-9]\) \([A-Z][a-z][a-z]\) /\1 \3 \2 /' \ | |
|
70 | -e '/^\* [MTWFS][a-z][a-z] /{s/ [012][0-9]:[0-9][0-9]:[0-9][0-9] [+-][0-9]\{4\}//}' \ | |
|
71 | >> $rpmspec | |
|
72 | changelog = [] | |
|
73 | for l in sys.stdin.readlines(): | |
|
74 | tok = l.split("\t") | |
|
75 | hgdate = tuple(int(v) for v in tok[0].split()) | |
|
76 | changelog.append((datestr(hgdate, "%F"), tok[1], hgdate, tok[2])) | |
|
77 | prevtitle = "" | |
|
78 | for l in sorted(changelog, reverse=True): | |
|
79 | title = "* %s %s" % (datestr(l[2], "%a %b %d %Y"), l[1]) | |
|
80 | if prevtitle != title: | |
|
81 | prevtitle = title | |
|
82 | ||
|
83 | print title | |
|
84 | print "- %s" % l[3].strip() | |
|
85 | ' >> $rpmspec | |
|
86 | ||
|
87 | else | |
|
88 | ||
|
89 | $HG log \ | |
|
90 | --template '{date|hgdate}\t{author}\t{desc|firstline}\n' \ | |
|
91 | .hgtags | python -c ' | |
|
92 | import sys, time | |
|
93 | ||
|
94 | def datestr(date, format): | |
|
95 | return time.strftime(format, time.gmtime(float(date[0]) - date[1])) | |
|
96 | ||
|
97 | for l in sys.stdin.readlines(): | |
|
98 | tok = l.split("\t") | |
|
99 | hgdate = tuple(int(v) for v in tok[0].split()) | |
|
100 | print "* %s %s\n- %s" % (datestr(hgdate, "%a %b %d %Y"), tok[1], tok[2]) | |
|
101 | ' >> $rpmspec | |
|
102 | ||
|
103 | fi | |
|
72 | 104 | |
|
73 | 105 | rpmbuild --define "_topdir $rpmdir" -ba $rpmspec --clean |
|
74 | 106 | if [ $? = 0 ]; then |
General Comments 0
You need to be logged in to leave comments.
Login now