]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-truncate-cvslog.patch
This commit was manufactured by cvs2git to create branch 'rpm-4_4_2'.
[packages/rpm.git] / rpm-truncate-cvslog.patch
CommitLineData
538a3775 1# vim:ts=8:sw=4
2--- rpm-4.4.2/build/parseChangelog.c 2006-04-26 22:34:05.263994598 +0300
3+++ rpm-4.4.2-truncate-changelog/build/parseChangelog.c 2006-04-26 22:32:50.622329157 +0300
4@@ -8,6 +8,9 @@
5 #include "rpmbuild.h"
6 #include "debug.h"
7
8+#define CVS_RCSID "$""Log: "
9+#define CVS_REVISION "Revision "
10+
11 void addChangelogEntry(Header h, time_t time, const char *name, const char *text)
12 {
13 int_32 mytime = time; /* XXX convert to header representation */
14@@ -116,6 +119,7 @@
15 time_t time;
16 time_t lastTime = 0;
17 char *date, *name, *text, *next;
18+ int numchangelog = rpmExpandNumeric("%{?_buildchangelogtruncate}");
19
20 s = getStringBuf(sb);
21
22@@ -197,6 +202,42 @@
23 while ((s > text) && xisspace(*s)) {
24 *s-- = '\0';
25 }
26+
27+ if (numchangelog && (s = strstr(text, CVS_RCSID))) {
28+ /* find end of line */
29+ while(*s && *s != '\n') s++;
30+ if (!*s) {
31+ goto out;
32+ }
33+ s++;
34+ if (!*s) {
35+ goto out;
36+ }
37+
38+ /* we reached place where first Revisions should be */
39+ i = 0;
40+ while (1) {
41+ if (strncmp(s, CVS_REVISION, sizeof(CVS_REVISION) - 1) == 0) {
42+ if (i++ == numchangelog) {
43+ break;
44+ }
45+ }
46+ while(*s && *s != '\n') s++;
47+ if (!*s) {
48+ break;
49+ }
50+ s++;
51+ }
52+
53+ if (*s) {
54+ s--;
55+ /* backup to the beginning of line */
56+ while ((s > text) && (*s == '\n' || xisspace(*s))) {
57+ *s-- = '\0';
58+ }
59+ }
60+ }
61+out:
62
63 addChangelogEntry(h, time, name, text);
64 s = next;
This page took 0.059406 seconds and 4 git commands to generate.