]>
Commit | Line | Data |
---|---|---|
685ff051 ER |
1 | # vim:ts=8:sw=4 |
2 | --- rpm-4.4.6/build/parseChangelog.c~ 2006-04-30 17:34:40.334393487 +0300 | |
3 | +++ rpm-4.4.6/build/parseChangelog.c 2006-05-02 19:46:06.357193264 +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 | @@ -222,6 +223,42 @@ | |
15 | /* backup to end of description */ | |
16 | while ((s > text) && xisspace(*s)) | |
17 | *s-- = '\0'; | |
18 | + | |
19 | + if (numchangelog && (s = strstr(text, CVS_RCSID))) { | |
20 | + /* find end of line */ | |
21 | + while(*s && *s != '\n') s++; | |
22 | + if (!*s) { | |
23 | + goto out; | |
24 | + } | |
25 | + s++; | |
26 | + if (!*s) { | |
27 | + goto out; | |
28 | + } | |
29 | + | |
30 | + /* we reached place where first Revisions should be */ | |
31 | + i = 0; | |
32 | + while (1) { | |
33 | + if (strncmp(s, CVS_REVISION, sizeof(CVS_REVISION) - 1) == 0) { | |
34 | + if (i++ == numchangelog) { | |
35 | + break; | |
36 | + } | |
37 | + } | |
38 | + while(*s && *s != '\n') s++; | |
39 | + if (!*s) { | |
40 | + break; | |
41 | + } | |
42 | + s++; | |
43 | + } | |
44 | + | |
45 | + if (*s) { | |
46 | + s--; | |
47 | + /* backup to the beginning of line */ | |
48 | + while ((s > text) && (*s == '\n' || xisspace(*s))) { | |
49 | + *s-- = '\0'; | |
50 | + } | |
51 | + } | |
52 | + } | |
53 | +out: | |
54 | ||
55 | /* Add entry if not truncated. */ | |
56 | nentries++; |