Show More
@@ -57,18 +57,50 sed -e "s,^Version:.*,Version: $version, | |||||
57 | -e "s,^Release:.*,Release: $release," \ |
|
57 | -e "s,^Release:.*,Release: $release," \ | |
58 | $specfile > $rpmspec |
|
58 | $specfile > $rpmspec | |
59 |
|
59 | |||
60 |
|
|
60 | echo >> $rpmspec | |
61 | %changelog |
|
61 | echo "%changelog" >> $rpmspec | |
62 | * `LANG=en_US date +'%a %b %d %Y'` `$HG showconfig ui.username` $version-$release |
|
62 | ||
63 | - Automatically built via $0 |
|
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 |
|
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 | ||||
66 | $HG log \ |
|
89 | $HG log \ | |
67 |
--template ' |
|
90 | --template '{date|hgdate}\t{author}\t{desc|firstline}\n' \ | |
68 | .hgtags \ |
|
91 | .hgtags | python -c ' | |
69 | | sed -e 's/^\(\* [MTWFS][a-z][a-z]\), \([0-3][0-9]\) \([A-Z][a-z][a-z]\) /\1 \3 \2 /' \ |
|
92 | import sys, time | |
70 | -e '/^\* [MTWFS][a-z][a-z] /{s/ [012][0-9]:[0-9][0-9]:[0-9][0-9] [+-][0-9]\{4\}//}' \ |
|
93 | ||
71 | >> $rpmspec |
|
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 | rpmbuild --define "_topdir $rpmdir" -ba $rpmspec --clean |
|
105 | rpmbuild --define "_topdir $rpmdir" -ba $rpmspec --clean | |
74 | if [ $? = 0 ]; then |
|
106 | if [ $? = 0 ]; then |
General Comments 0
You need to be logged in to leave comments.
Login now