From 4bd1526d854822e586d993b931a34ffc53ea7607 Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Tue, 30 Jul 2013 13:01:16 +0400 Subject: [PATCH] LOG Backport some patches for rpmbuild from Desktop Fresh --- ...o-accept-optional-second-version-arg.patch | 13 ++ ...0-postpone_subpackage_build_failures.patch | 73 +++++++++++ rpm-5.4.10-printspec.patch | 114 ++++++++++++++++++ rpm-5.4.10-python3-egg-reqs.patch | 27 +++++ rpm.spec | 18 ++- 5 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 rpm-5.4.10-enhance-rename-macro-to-accept-optional-second-version-arg.patch create mode 100644 rpm-5.4.10-postpone_subpackage_build_failures.patch create mode 100644 rpm-5.4.10-printspec.patch create mode 100644 rpm-5.4.10-python3-egg-reqs.patch diff --git a/rpm-5.4.10-enhance-rename-macro-to-accept-optional-second-version-arg.patch b/rpm-5.4.10-enhance-rename-macro-to-accept-optional-second-version-arg.patch new file mode 100644 index 0000000..ad0f067 --- /dev/null +++ b/rpm-5.4.10-enhance-rename-macro-to-accept-optional-second-version-arg.patch @@ -0,0 +1,13 @@ +--- rpm-5.4.10/macros/mandriva.in.rename~ 2013-02-24 23:17:05.947081929 +0100 ++++ rpm-5.4.10/macros/mandriva.in 2013-02-25 00:33:33.342514014 +0100 +@@ -47,8 +47,8 @@ + %EVRD %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}%{?distepoch::%{distepoch}} + + %rename() \ +-Obsoletes: %{1} < %{EVRD} \ +-Provides: %{1} = %{EVRD} ++Obsoletes: %{1} < %{?2}%{!?2:%{EVRD}} \ ++Provides: %{1} = %{?2}%{!?2:%{EVRD}} + + + %_default_patch_flags -s -U diff --git a/rpm-5.4.10-postpone_subpackage_build_failures.patch b/rpm-5.4.10-postpone_subpackage_build_failures.patch new file mode 100644 index 0000000..ad35b24 --- /dev/null +++ b/rpm-5.4.10-postpone_subpackage_build_failures.patch @@ -0,0 +1,73 @@ +--- ./build/files.c.subpackage_failures~ 2013-05-22 18:56:03.629212893 +0400 ++++ ./build/files.c 2013-05-22 19:07:50.697775045 +0400 +@@ -2513,8 +2513,8 @@ + + files = argvFree(files); + +- if (fl.processingFailed) +- goto exit; ++/* if (fl.processingFailed) ++ goto exit;*/ + + /* Verify that file attributes scope over hardlinks correctly. */ + if (checkHardLinks(&fl)) +@@ -3147,6 +3147,7 @@ + HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); + Package pkg; + rpmRC res = RPMRC_OK; ++ short failed_once = 0; + + char *buildroot = rpmExpand("%{?buildroot}", NULL); + size_t buildrootL = strlen(buildroot); +@@ -3167,22 +3168,23 @@ + he->p.ptr = _free(he->p.ptr); + + if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) { +- res = RPMRC_FAIL; +- (void) headerMacrosUnload(pkg->header); +- break; ++ failed_once = 1; + } + + /* Finalize package scriptlets before extracting dependencies. */ + if ((rc = processScriptFiles(spec, pkg))) { + res = rc; + (void) headerMacrosUnload(pkg->header); +- break; ++ if (res == RPMRC_FAIL) { ++ failed_once = 1; ++ } ++ else { ++ break; ++ } + } + + if ((rc = rpmfcGenerateDepends(spec, pkg))) { +- res = RPMRC_FAIL; +- (void) headerMacrosUnload(pkg->header); +- break; ++ failed_once = 1; + } + + /* XXX this should be earlier for deps to be entirely sorted. */ +@@ -3191,7 +3193,10 @@ + (void) headerMacrosUnload(pkg->header); + } + +- if (res == RPMRC_OK) { ++ if (failed_once == 1) ++ res = RPMRC_FAIL; ++ ++/* if (res == RPMRC_OK) {*/ + int _duplicate_files_terminate_build = + rpmExpandNumeric("%{?_duplicate_files_terminate_build}"); + int _unpackaged_subdirs_terminate_build = +@@ -3204,7 +3209,7 @@ + if (checkUnpackagedSubdirs(spec, buildrootL, _unpackaged_subdirs_terminate_build) > 0 && + _unpackaged_subdirs_terminate_build) + res = RPMRC_FAIL; +- } ++/* }*/ + + return res; + } diff --git a/rpm-5.4.10-printspec.patch b/rpm-5.4.10-printspec.patch new file mode 100644 index 0000000..20d2743 --- /dev/null +++ b/rpm-5.4.10-printspec.patch @@ -0,0 +1,114 @@ +--- rpm-5.4.10/build/spec.c.printspec~ 2013-01-23 01:04:32.483889763 +0100 ++++ rpm-5.4.10/build/spec.c 2013-01-23 01:12:59.970655457 +0100 +@@ -27,6 +27,10 @@ int _spec_debug; + + /*@-redecl@*/ + extern int specedit; ++ ++/*@-redecl@*/ ++extern int printspec; ++ + /*@=redecl@*/ + + #define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;} +@@ -489,7 +493,7 @@ static inline /*@only@*/ /*@null@*/ spec + /*@*/ + { + speclines sl = NULL; +- if (specedit) { ++ if (specedit || printspec) { + sl = xmalloc(sizeof(*sl)); + sl->sl_lines = NULL; + sl->sl_nalloc = 0; +@@ -836,6 +840,34 @@ printNewSpecfile(Spec spec) + } + + /** ++ * Print parsed copy of spec file with expanded macros. ++ * @param spec spec file control structure ++ */ ++static void ++printParsedSpecfile(Spec spec) ++ /*@globals fileSystem, internalState @*/ ++ /*@modifies spec->sl->sl_lines[], spec->packages->header, ++ fileSystem, internalState @*/ ++{ ++ speclines sl = spec->sl; ++ int i; ++ ++ if (sl == NULL) ++ return; ++ ++ for (i = 0; i < sl->sl_nlines; i++) { ++ const char * s = sl->sl_lines[i]; ++ const char * expandedLine; ++ if (s == NULL) ++ continue; ++ expandedLine = rpmMCExpand(spec->macros, s, NULL); ++ printf("%s", expandedLine); ++ _free(expandedLine); ++ if (strchr(s, '\n') == NULL && s[strlen(s)-1] != '\n') ++ printf("\n"); ++ } ++} ++/** + * Add expanded build scriptlet to srpm header. + * @param h srpm header + * @param progTag interpreter tag (0 disables) +@@ -939,6 +971,11 @@ static int _specQuery(rpmts ts, QVA_t qv + goto exit; + } + ++ if (printspec) { ++ printParsedSpecfile(spec); ++ goto exit; ++ } ++ + switch (qva->qva_source) { + case RPMQV_SPECSRPM: + xx = initSourceHeader(spec, NULL); +--- rpm-5.4.10/lib/librpm.vers.printspec~ 2013-01-23 01:09:47.257299567 +0100 ++++ rpm-5.4.10/lib/librpm.vers 2013-01-23 01:10:48.125643410 +0100 +@@ -37,6 +37,7 @@ LIBRPM_0 + _nosigh; + nplatpat; + platpat; ++ printspec; + _print_pkts; + _psm_debug; + _psm_threads; +--- rpm-5.4.10/lib/poptQV.c.printspec~ 2013-01-23 01:04:46.489658974 +0100 ++++ rpm-5.4.10/lib/poptQV.c 2013-01-23 01:07:29.416493474 +0100 +@@ -21,6 +21,9 @@ struct rpmQVKArguments_s rpmQVKArgs; + /*@unchecked@*/ + int specedit = 0; + ++/*@unchecked@*/ ++int printspec = 0; ++ + #define POPT_QUERYFORMAT -1000 + #define POPT_WHATREQUIRES -1001 + #define POPT_WHATPROVIDES -1002 +@@ -363,6 +366,8 @@ struct poptOption rpmQueryPoptTable[] = + N_("skip %%readme files"), NULL }, + #endif + ++ { "printspec", '\0', POPT_ARG_VAL, &printspec, -1, ++ N_("print parsed spec file"), NULL }, + { "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0, + POPT_QUERYFORMAT, NULL, NULL }, + { "queryformat", '\0', POPT_ARG_STRING, 0, POPT_QUERYFORMAT, +--- rpm-5.4.10/lib/rpmcli.h.printspec~ 2013-01-23 01:04:53.165920321 +0100 ++++ rpm-5.4.10/lib/rpmcli.h 2013-01-23 01:05:20.375518501 +0100 +@@ -293,6 +293,11 @@ extern int specedit; + /** \ingroup rpmcli + */ + /*@unchecked@*/ ++extern int printspec; ++ ++/** \ingroup rpmcli ++ */ ++/*@unchecked@*/ + extern struct poptOption rpmQueryPoptTable[]; + + /** \ingroup rpmcli diff --git a/rpm-5.4.10-python3-egg-reqs.patch b/rpm-5.4.10-python3-egg-reqs.patch new file mode 100644 index 0000000..23ef842 --- /dev/null +++ b/rpm-5.4.10-python3-egg-reqs.patch @@ -0,0 +1,27 @@ +diff -Naur rpm-5.4.10.orig/scripts/pythoneggs.py rpm-5.4.10/scripts/pythoneggs.py +--- rpm-5.4.10.orig/scripts/pythoneggs.py 2013-06-14 14:26:18.171626023 +0400 ++++ rpm-5.4.10/scripts/pythoneggs.py 2013-06-14 14:28:45.434611910 +0400 +@@ -125,7 +125,10 @@ + if not name in py_deps: + py_deps[name] = [] + py_deps[name].append(('==', dist.py_version)) +- name = 'pythonegg(%s)' % dist.key ++ if f.find('python3') > 0: ++ name = 'python3egg(%s)' % dist.key ++ else: ++ name = 'pythonegg(%s)' % dist.key + if not name in py_deps: + py_deps[name] = [] + if dist.version: +@@ -155,7 +158,10 @@ + deps = depsextras + # add requires/suggests based on egg metadata + for dep in deps: +- name = 'pythonegg(%s)' % dep.key ++ if f.find('python3') > 0: ++ name = 'python3egg(%s)' % dep.key ++ else: ++ name = 'pythonegg(%s)' % dep.key + for spec in dep.specs: + if spec[0] != '!=': + if not name in py_deps: diff --git a/rpm.spec b/rpm.spec index b86c7bc..da3426c 100644 --- a/rpm.spec +++ b/rpm.spec @@ -59,7 +59,7 @@ Summary: The RPM package management system Name: rpm Epoch: 1 Version: %{libver}.%{minorver} -Release: %{?prereldate:0.%{prereldate}.}10 +Release: %{?prereldate:0.%{prereldate}.}11 License: LGPLv2.1+ Group: System/Configuration/Packaging URL: http://rpm5.org/ @@ -361,6 +361,15 @@ Patch169: rpm-5.4.10-update-and-use-brp-compress.patch Patch170: rpm-5.4.10-dbconvert-5.2.patch +# Do not generate pythonegg provides for python3 until we find a better solution +Patch171: rpm-5.4.10-python3-egg-reqs.patch + +# adds ability for printing parsed version of spec file with 'rpm -q --specfile --printspec' +# status: very simple, non-intrusive, while quite convenient, should be okay to merge +Patch181: rpm-5.4.10-printspec.patch + +Patch191: rpm-5.4.10-enhance-rename-macro-to-accept-optional-second-version-arg.patch + # ROSA stuff Patch501: rpm-5.3.12.vendor.ROSA.patch # Restore RPM_PACKAGE_NAME export as it's still used by aot-compile-rpm @@ -368,6 +377,8 @@ Patch502: rpm-5.4.9-package-name.patch # for specspo Patch503: rpm-5.4.9-specspo.patch +Patch504: rpm-5.4.10-postpone_subpackage_build_failures.patch + BuildRequires: autoconf >= 2.57 BuildRequires: bzip2-devel BuildRequires: automake >= 1.8 @@ -735,10 +746,15 @@ This package contains the RPM API documentation generated in HTML format. %patch169 -p1 -b .brpcomp~ %patch170 -p1 -b .dbconvert52~ +%patch171 -p1 -b .python3~ + +%patch181 -p1 -b .printspec~ +%patch191 -p1 -b .rename~ %patch501 -p1 -b .rosa_vendor~ %patch502 -p1 -b .package_name~ %patch503 -p1 -b .specspo~ +%patch504 -p1 -b .postpone_errors~ #required by P55, P80, P81, P94.. ./autogen.sh