rpm/rpm-shorten-changelog.diff

96 lines
2.7 KiB
Diff
Raw Normal View History

--- ./build/pack.c.orig 2019-06-26 14:17:31.395985720 +0000
+++ ./build/pack.c 2019-10-02 11:31:05.908639084 +0000
@@ -743,11 +743,78 @@ 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);
+}
+
rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
{
rpmRC rc = RPMRC_OK;
Package pkg;
+ trimChangelog(spec->packages->header);
+
/* Run binary creation in parallel */
#pragma omp parallel
#pragma omp single
--- ./build/parseChangelog.c.orig 2019-06-26 14:17:31.395985720 +0000
+++ ./build/parseChangelog.c 2019-10-02 11:29:26.684840735 +0000
@@ -253,6 +253,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++;