2017-12-05 11:46:24 +01:00
|
|
|
--- ./build/pack.c.orig 2017-10-11 12:39:53.009897937 +0000
|
|
|
|
+++ ./build/pack.c 2017-12-04 16:02:29.299440578 +0000
|
|
|
|
@@ -641,6 +641,71 @@ 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;
|
2017-12-05 11:46:24 +01:00
|
|
|
+ rpm_count_t i, keep;
|
|
|
|
+ struct rpmtd_s timestd, namestd, textstd;
|
|
|
|
+ rpm_count_t count;
|
2008-09-12 20:37:28 +02:00
|
|
|
+
|
|
|
|
+ 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;
|
|
|
|
+ }
|
2017-12-05 11:46:24 +01:00
|
|
|
+
|
|
|
|
+ if (!headerGet(h, RPMTAG_CHANGELOGTIME, ×td, HEADERGET_MINMEM))
|
2009-08-28 15:54:03 +02:00
|
|
|
+ return;
|
2017-12-05 11:46:24 +01:00
|
|
|
+ count = rpmtdCount(×td);
|
2008-09-12 20:37:28 +02:00
|
|
|
+ if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) {
|
2017-12-05 11:46:24 +01:00
|
|
|
+ rpmtdFreeData(×td);
|
2008-09-12 20:37:28 +02:00
|
|
|
+ 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++) {
|
2017-12-05 11:46:24 +01:00
|
|
|
+ uint32_t *tp = rpmtdNextUint32(×td);
|
|
|
|
+ if (i >= minnum && tp && *tp < cuttime)
|
2008-09-12 20:37:28 +02:00
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ keep = i;
|
|
|
|
+ }
|
2017-12-05 11:46:24 +01:00
|
|
|
+ if (keep >= count) {
|
|
|
|
+ rpmtdFreeData(×td);
|
2008-09-12 20:37:28 +02:00
|
|
|
+ return;
|
2017-12-05 11:46:24 +01:00
|
|
|
+ }
|
|
|
|
+ headerGet(h, RPMTAG_CHANGELOGNAME, &namestd, HEADERGET_MINMEM);
|
|
|
|
+ headerGet(h, RPMTAG_CHANGELOGTEXT, &textstd, HEADERGET_MINMEM);
|
|
|
|
+ timestd.count = namestd.count = textstd.count = keep;
|
|
|
|
+ headerMod(h, ×td);
|
|
|
|
+ headerMod(h, &namestd);
|
|
|
|
+ headerMod(h, &textstd);
|
|
|
|
+ rpmtdFreeData(&textstd);
|
|
|
|
+ rpmtdFreeData(&namestd);
|
|
|
|
+ rpmtdFreeData(×td);
|
2008-09-12 20:37:28 +02:00
|
|
|
+}
|
|
|
|
+
|
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;
|
2017-12-05 11:46:24 +01:00
|
|
|
@@ -648,6 +713,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
|
|
|
|
2017-12-05 11:46:24 +01:00
|
|
|
--- ./build/parseChangelog.c.orig 2017-10-05 10:04:56.859602170 +0000
|
|
|
|
+++ ./build/parseChangelog.c 2017-12-04 14:47:41.249346774 +0000
|
|
|
|
@@ -255,6 +255,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++;
|