2013-07-12 16:11:14 +02:00
|
|
|
--- ./build/pack.c.orig 2013-06-10 15:55:10.000000000 +0000
|
|
|
|
+++ ./build/pack.c 2013-07-12 11:59:37.000000000 +0000
|
|
|
|
@@ -540,6 +540,63 @@ static rpmRC checkPackages(char *pkgchec
|
2009-08-28 15:54:03 +02:00
|
|
|
return RPMRC_OK;
|
|
|
|
}
|
2008-09-12 20:37:28 +02:00
|
|
|
|
2011-05-16 18:07:44 +02:00
|
|
|
+static void trimChangelog(Header h)
|
2008-09-12 20:37:28 +02:00
|
|
|
+{
|
|
|
|
+ static int oneshot;
|
|
|
|
+ static int cuttime, minnum, maxnum;
|
|
|
|
+ int * times;
|
|
|
|
+ char ** names = 0, ** texts = 0;
|
|
|
|
+ int i, keep, count = 0;
|
|
|
|
+
|
|
|
|
+ if (!oneshot) {
|
|
|
|
+ char *binarychangelogtrim = rpmExpand("%{?_binarychangelogtrim}", NULL);
|
|
|
|
+ oneshot = 1;
|
2009-08-28 15:54:03 +02:00
|
|
|
+ if (binarychangelogtrim && *binarychangelogtrim) {
|
2008-09-12 20:37:28 +02:00
|
|
|
+ maxnum = atoi(binarychangelogtrim);
|
|
|
|
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
|
|
|
|
+ if (binarychangelogtrim)
|
|
|
|
+ binarychangelogtrim++;
|
|
|
|
+ }
|
2009-08-28 15:54:03 +02:00
|
|
|
+ if (binarychangelogtrim && *binarychangelogtrim) {
|
2008-09-12 20:37:28 +02:00
|
|
|
+ cuttime = atoi(binarychangelogtrim);
|
|
|
|
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
|
|
|
|
+ if (binarychangelogtrim)
|
|
|
|
+ binarychangelogtrim++;
|
|
|
|
+ }
|
2009-08-28 15:54:03 +02:00
|
|
|
+ if (binarychangelogtrim && *binarychangelogtrim) {
|
2008-09-12 20:37:28 +02:00
|
|
|
+ minnum = atoi(binarychangelogtrim);
|
|
|
|
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!cuttime && !minnum && !maxnum) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) ×, &count))
|
2009-08-28 15:54:03 +02:00
|
|
|
+ return;
|
2008-09-12 20:37:28 +02:00
|
|
|
+ if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ keep = count;
|
|
|
|
+ if (maxnum && keep > maxnum)
|
2009-08-28 15:54:03 +02:00
|
|
|
+ keep = maxnum;
|
2008-09-12 20:37:28 +02:00
|
|
|
+ if (cuttime) {
|
|
|
|
+ for (i = 0; i < keep; i++) {
|
|
|
|
+ if (i >= minnum && times[i] < cuttime)
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ keep = i;
|
|
|
|
+ }
|
|
|
|
+ if (keep >= count)
|
|
|
|
+ return;
|
|
|
|
+ headerGetEntry(h, RPMTAG_CHANGELOGNAME, NULL, (void **) &names, &count);
|
|
|
|
+ headerGetEntry(h, RPMTAG_CHANGELOGTEXT, NULL, (void **) &texts, &count);
|
|
|
|
+ headerModifyEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, times, keep);
|
|
|
|
+ headerModifyEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, names, keep);
|
|
|
|
+ headerModifyEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, texts, keep);
|
|
|
|
+ free(names);
|
|
|
|
+ free(texts);
|
|
|
|
+}
|
|
|
|
+
|
2011-05-16 18:07:44 +02:00
|
|
|
rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
|
2008-09-12 20:37:28 +02:00
|
|
|
{
|
2013-07-12 16:11:14 +02:00
|
|
|
rpmRC rc;
|
|
|
|
@@ -547,6 +604,7 @@ rpmRC packageBinaries(rpmSpec spec, cons
|
2008-09-12 20:37:28 +02:00
|
|
|
Package pkg;
|
2009-08-28 15:54:03 +02:00
|
|
|
char *pkglist = NULL;
|
2008-09-12 20:37:28 +02:00
|
|
|
|
|
|
|
+ trimChangelog(spec->packages->header);
|
|
|
|
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
|
2009-08-28 15:54:03 +02:00
|
|
|
char *fn;
|
2007-11-23 01:38:16 +01:00
|
|
|
|
2013-07-12 16:11:14 +02:00
|
|
|
--- ./build/parseChangelog.c.orig 2012-11-18 08:21:06.000000000 +0000
|
|
|
|
+++ ./build/parseChangelog.c 2013-07-12 11:59:37.000000000 +0000
|
|
|
|
@@ -183,6 +183,11 @@ static rpmRC addChangelog(Header h, ARGV
|
2013-01-09 10:46:46 +01:00
|
|
|
goto exit;
|
2011-05-16 18:07:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ /* workaround old suse oddity */
|
|
|
|
+ if (*s == '-' && s[1] == ' ') {
|
|
|
|
+ s += 2;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
/* name */
|
|
|
|
name = s;
|
|
|
|
while (*s != '\0') s++;
|