SHA256
3
0
forked from pool/rpm
rpm/rpm-shorten-changelog.diff
Andreas Jaeger 0a1fcefb6d 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 09:46:46 +00:00

89 lines
2.4 KiB
Diff

--- build/pack.c
+++ build/pack.c
@@ -573,6 +573,63 @@
return RPMRC_OK;
}
+static void trimChangelog(Header h)
+{
+ 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;
+ 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 (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) &times, &count))
+ return;
+ if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) {
+ return;
+ }
+ keep = count;
+ if (maxnum && keep > maxnum)
+ keep = maxnum;
+ 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);
+}
+
rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
{
struct cpioSourceArchive_s csabuf;
@@ -582,6 +639,7 @@
Package pkg;
char *pkglist = NULL;
+ trimChangelog(spec->packages->header);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
char *fn;
--- build/parseChangelog.c
+++ build/parseChangelog.c
@@ -168,6 +168,11 @@
goto exit;
}
+ /* workaround old suse oddity */
+ if (*s == '-' && s[1] == ' ') {
+ s += 2;
+ }
+
/* name */
name = s;
while (*s != '\0') s++;