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

98 lines
2.9 KiB
Diff
Raw Normal View History

--- ./build/pack.c.orig 2020-09-30 12:49:33.397074156 +0000
+++ ./build/pack.c 2020-09-30 12:51:34.628805840 +0000
@@ -728,6 +728,71 @@ static rpmRC packageBinary(rpmSpec spec,
return rc;
}
+static void trimChangelog(Header h)
+{
+ static int oneshot;
+ static int cuttime, minnum, maxnum;
+ rpm_count_t i, keep;
+ struct rpmtd_s timestd, namestd, textstd;
+ rpm_count_t count;
+
+ if (!oneshot) {
+ char *binarychangelogtrim = rpmExpand("%{?_binarychangelogtrim}", NULL);
+ oneshot = 1;
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ maxnum = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ if (binarychangelogtrim)
+ binarychangelogtrim++;
+ }
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ cuttime = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ if (binarychangelogtrim)
+ binarychangelogtrim++;
+ }
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ minnum = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ }
+ }
+ if (!cuttime && !minnum && !maxnum) {
+ return;
+ }
+
+ if (!headerGet(h, RPMTAG_CHANGELOGTIME, &timestd, HEADERGET_MINMEM))
+ return;
+ count = rpmtdCount(&timestd);
+ if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) {
+ rpmtdFreeData(&timestd);
+ return;
+ }
+ keep = count;
+ if (maxnum && keep > maxnum)
+ keep = maxnum;
+ if (cuttime) {
+ for (i = 0; i < keep; i++) {
+ uint32_t *tp = rpmtdNextUint32(&timestd);
+ if (i >= minnum && tp && *tp < cuttime)
+ break;
+ }
+ keep = i;
+ }
+ if (keep >= count) {
+ rpmtdFreeData(&timestd);
+ return;
+ }
+ headerGet(h, RPMTAG_CHANGELOGNAME, &namestd, HEADERGET_MINMEM);
+ headerGet(h, RPMTAG_CHANGELOGTEXT, &textstd, HEADERGET_MINMEM);
+ timestd.count = namestd.count = textstd.count = keep;
+ headerMod(h, &timestd);
+ headerMod(h, &namestd);
+ headerMod(h, &textstd);
+ rpmtdFreeData(&textstd);
+ rpmtdFreeData(&namestd);
+ rpmtdFreeData(&timestd);
+}
+
static int compareBinaries(const void *p1, const void *p2) {
Package pkg1 = *(Package *)p1;
Package pkg2 = *(Package *)p2;
@@ -751,6 +816,8 @@ rpmRC packageBinaries(rpmSpec spec, cons
Package *tasks;
int npkgs = 0;
+ trimChangelog(spec->packages->header);
+
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next)
npkgs++;
tasks = xcalloc(npkgs, sizeof(Package));
--- ./build/parseChangelog.c.orig 2020-08-31 09:14:07.991087349 +0000
+++ ./build/parseChangelog.c 2020-09-30 12:49:33.401074147 +0000
@@ -267,6 +267,11 @@ static rpmRC addChangelog(Header h, ARGV
Accepting request 147491 from devel:Factory:ARM - Update to 4.10.2 - Update to 4.10.2 - update to 4.10.2 (bnc#796375): * Fix missing error code on unparseable signature in packages, regression introduced in rpm 4.10.0. This could result in packages with malformed signature falling through signature checking. * Fix missing error code on --import on bogus key file (RhBug:869667) * Fix installation of packages containing skipped hardlinks (RhBug:864622) * Fix --setperms regression introduced in rpm 4.10.0 (RhBug:881835) * Fix locale dependent behavior in rpm2cpio.sh (RhBug:878363) * Add --undefine cli switch for undefining macros (related to RhBug:876308) * Fix warnings when building with gcc >= 4.7 * Permit key imports on transactions where signature checking is disabled, regression of sorts introduced in 4.10.0 (RhBug:856225) * Fix RPMPROB_FILTER_FORCERELOCATE aka --badreloc, regression introduced in 4.9.0 (RhBug:828784) * Verify files from non-installed packages again, regression introduced in 4.9.0 (RhBug:826589) * Fix large (> 4GB) package support, regression introduced in 4.9.0 (RhBug:844936) * Only create the first instance of a file shared between multiple packages on install (speedup + improved verification timestamp behavior) * Report config and missinok flags too in deptype format extension * Fix relative path handling in --whatprovides query * Add --noclean and --nocheck options to rpmbuild (RhBug:756531) * Permit non-existent %ghost directories to be packaged (RhBug:839656) * Dont silence patch by default (RhBug:678000, RhBug:773503) * Accept "owner" as an alias to "user" %verify attribute (RhBug:838657) OBS-URL: https://build.opensuse.org/request/show/147491 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=245
2013-01-09 10:46:46 +01:00
goto exit;
}
+ /* workaround old suse oddity */
+ if (*s == '-' && s[1] == ' ') {
+ s += 2;
+ }
+
/* name */
name = s;
while (*s != '\0') s++;