SHA256
3
0
forked from pool/rpm
rpm/rpm-shorten-changelog.diff

53 lines
1.3 KiB
Diff

--- build/parseChangelog.c
+++ build/parseChangelog.c
@@ -111,10 +111,11 @@ static int dateToTimet(const char * datestr, /*@out@*/ time_t * secs)
static int addChangelog(Header h, StringBuf sb)
/*@modifies h @*/
{
- char *s;
+ char *s, *p;
int i;
time_t time;
time_t lastTime = 0;
+ time_t cutOffTime = 1151704800; /* date -d "2006/07/01" +%s #SLES10-GA */
char *date, *name, *text, *next;
s = getStringBuf(sb);
@@ -167,6 +168,12 @@ static int addChangelog(Header h, StringBuf sb)
return RPMERR_BADSPEC;
}
+ /* workaround old suse oddity */
+ if (*s == '-') {
+ ++s;
+ SKIPSPACE(s);
+ }
+
/* name */
name = s;
while (*s != '\0') s++;
@@ -178,6 +185,13 @@ static int addChangelog(Header h, StringBuf sb)
return RPMERR_BADSPEC;
}
+ /* remove domain part of the email address */
+ p = strstr(name, "@suse");
+ if (!p)
+ p = strstr(name, "@novell");
+ if (p)
+ *p = '\0';
+
/* text */
SKIPSPACE(text);
if (! *text) {
@@ -198,7 +212,8 @@ static int addChangelog(Header h, StringBuf sb)
*s-- = '\0';
}
- addChangelogEntry(h, time, name, text);
+ if (time >= cutOffTime)
+ addChangelogEntry(h, time, name, text);
s = next;
}