- fixup rpm translation lookup to match Fedora specspo (#436941) - drop unused patch
This commit is contained in:
parent
3ec6422b5d
commit
4febce23b7
@ -1,101 +0,0 @@
|
||||
diff --git a/lib/transaction.c b/lib/transaction.c
|
||||
index 7e432a3..42f1b12 100644
|
||||
--- a/lib/transaction.c
|
||||
+++ b/lib/transaction.c
|
||||
@@ -910,33 +910,51 @@ static int runTransScripts(rpmts ts, rpmTag stag)
|
||||
if (script == NULL && scriptprog == NULL)
|
||||
continue;
|
||||
|
||||
- p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_OPEN_FILE, 0, 0);
|
||||
- p->h = NULL;
|
||||
- if (rpmteFd(p) != NULL) {
|
||||
- rpmVSFlags ovsflags = rpmtsVSFlags(ts);
|
||||
- rpmVSFlags vsflags = ovsflags | RPMVSF_NEEDPAYLOAD;
|
||||
- rpmRC rpmrc;
|
||||
- ovsflags = rpmtsSetVSFlags(ts, vsflags);
|
||||
- rpmrc = rpmReadPackageFile(ts, rpmteFd(p),
|
||||
- rpmteNEVR(p), &p->h);
|
||||
- vsflags = rpmtsSetVSFlags(ts, ovsflags);
|
||||
- switch (rpmrc) {
|
||||
- default:
|
||||
- /* FIX: notify annotations */
|
||||
- p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
|
||||
- p->fd = NULL;
|
||||
- break;
|
||||
- case RPMRC_NOTTRUSTED:
|
||||
- case RPMRC_NOKEY:
|
||||
- case RPMRC_OK:
|
||||
- break;
|
||||
+ if (stag==RPMTAG_POSTTRANS) {
|
||||
+ /* get (already installed) header from rpmdb */
|
||||
+ rpmdbMatchIterator mi;
|
||||
+ mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(p), 0);
|
||||
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP,
|
||||
+ rpmteE(p));
|
||||
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_STRCMP,
|
||||
+ rpmteV(p));
|
||||
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP,
|
||||
+ rpmteR(p));
|
||||
+ xx = rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP,
|
||||
+ rpmteA(p));
|
||||
+
|
||||
+ p->h = headerCopy(rpmdbNextIterator(mi));
|
||||
+ mi = rpmdbFreeIterator(mi);
|
||||
+ } else {
|
||||
+ /* reread rpm file */
|
||||
+ p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_OPEN_FILE, 0, 0);
|
||||
+ p->h = NULL;
|
||||
+ if (rpmteFd(p) != NULL) {
|
||||
+ rpmVSFlags ovsflags = rpmtsVSFlags(ts);
|
||||
+ rpmVSFlags vsflags = ovsflags | RPMVSF_NEEDPAYLOAD;
|
||||
+ rpmRC rpmrc;
|
||||
+ ovsflags = rpmtsSetVSFlags(ts, vsflags);
|
||||
+ rpmrc = rpmReadPackageFile(ts, rpmteFd(p),
|
||||
+ rpmteNEVR(p), &p->h);
|
||||
+ vsflags = rpmtsSetVSFlags(ts, ovsflags);
|
||||
+ switch (rpmrc) {
|
||||
+ default:
|
||||
+ /* FIX: notify annotations */
|
||||
+ p->fd = rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
|
||||
+ p->fd = NULL;
|
||||
+ break;
|
||||
+ case RPMRC_NOTTRUSTED:
|
||||
+ case RPMRC_NOKEY:
|
||||
+ case RPMRC_OK:
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
- }
|
||||
+ }
|
||||
|
||||
- if (rpmteFd(p) != NULL) {
|
||||
- fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1);
|
||||
+ if (p->h) {
|
||||
+ fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1);
|
||||
if (fi != NULL) { /* XXX can't happen */
|
||||
- if (stag == RPMTAG_PRETRANS) {
|
||||
+ if (stag == RPMTAG_PRETRANS) { /* isn't this the same? */
|
||||
fi->te = p;
|
||||
p->fi = fi;
|
||||
} else {
|
||||
@@ -944,14 +962,16 @@ static int runTransScripts(rpmts ts, rpmTag stag)
|
||||
p->fi->te = p;
|
||||
}
|
||||
}
|
||||
+ fi->h = p->h; // is this right?
|
||||
psm = rpmpsmNew(ts, p, p->fi);
|
||||
assert(psm != NULL);
|
||||
xx = rpmpsmScriptStage(psm, stag, progtag);
|
||||
psm = rpmpsmFree(psm);
|
||||
-
|
||||
- (void) rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
|
||||
- p->fd = NULL;
|
||||
- p->h = headerFree(p->h);
|
||||
+ if (p->fd != NULL) {
|
||||
+ (void) rpmtsNotify(ts, p, RPMCALLBACK_INST_CLOSE_FILE, 0, 0);
|
||||
+ p->fd = NULL;
|
||||
+ }
|
||||
+ p->h = fi->h = headerFree(p->h);
|
||||
}
|
||||
}
|
||||
pi = rpmtsiFree(pi);
|
96
rpm-4.6.0-fedora-specspo.patch
Normal file
96
rpm-4.6.0-fedora-specspo.patch
Normal file
@ -0,0 +1,96 @@
|
||||
diff --git a/lib/tagexts.c b/lib/tagexts.c
|
||||
index 501d8ac..cf71639 100644
|
||||
--- a/lib/tagexts.c
|
||||
+++ b/lib/tagexts.c
|
||||
@@ -460,12 +460,6 @@ static int filerequireTag(Header h, rpmtd td)
|
||||
}
|
||||
|
||||
/* I18N look aside diversions */
|
||||
-
|
||||
-#if defined(ENABLE_NLS)
|
||||
-extern int _nl_msg_cat_cntr; /* XXX GNU gettext voodoo */
|
||||
-#endif
|
||||
-static const char * const language = "LANGUAGE";
|
||||
-
|
||||
static const char * const _macro_i18ndomains = "%{?_i18ndomains}";
|
||||
|
||||
/**
|
||||
@@ -477,63 +471,27 @@ static const char * const _macro_i18ndomains = "%{?_i18ndomains}";
|
||||
*/
|
||||
static int i18nTag(Header h, rpmTag tag, rpmtd td)
|
||||
{
|
||||
- char * dstring = rpmExpand(_macro_i18ndomains, NULL);
|
||||
- int rc;
|
||||
+ int rc = headerGet(h, tag, td, HEADERGET_ALLOC);
|
||||
+ if (rc) {
|
||||
+ char *de, *dstring = rpmExpand(_macro_i18ndomains, NULL);
|
||||
+ const char *domain;
|
||||
|
||||
- td->type = RPM_STRING_TYPE;
|
||||
- td->data = NULL;
|
||||
- td->count = 0;
|
||||
-
|
||||
- if (dstring && *dstring) {
|
||||
- char *domain, *de;
|
||||
- const char * langval;
|
||||
- char * msgkey;
|
||||
- const char * msgid;
|
||||
- const char * n;
|
||||
- int xx;
|
||||
-
|
||||
- xx = headerNVR(h, &n, NULL, NULL);
|
||||
- rasprintf(&msgkey, "%s(%s)", n, rpmTagGetName(tag));
|
||||
-
|
||||
- /* change to en_US for msgkey -> msgid resolution */
|
||||
- langval = getenv(language);
|
||||
- (void) setenv(language, "en_US", 1);
|
||||
-#if defined(ENABLE_NLS)
|
||||
- ++_nl_msg_cat_cntr;
|
||||
-#endif
|
||||
-
|
||||
- msgid = NULL;
|
||||
for (domain = dstring; domain != NULL; domain = de) {
|
||||
+ const char *msgid = td->data;
|
||||
+ const char *msg = NULL;
|
||||
+
|
||||
de = strchr(domain, ':');
|
||||
if (de) *de++ = '\0';
|
||||
- msgid = dgettext(domain, msgkey);
|
||||
- if (msgid != msgkey) break;
|
||||
- }
|
||||
-
|
||||
- /* restore previous environment for msgid -> msgstr resolution */
|
||||
- if (langval)
|
||||
- (void) setenv(language, langval, 1);
|
||||
- else
|
||||
- unsetenv(language);
|
||||
-#if defined(ENABLE_NLS)
|
||||
- ++_nl_msg_cat_cntr;
|
||||
-#endif
|
||||
-
|
||||
- if (domain && msgid) {
|
||||
- td->data = dgettext(domain, msgid);
|
||||
- td->data = xstrdup(td->data); /* XXX xstrdup has side effects. */
|
||||
- td->count = 1;
|
||||
- td->flags = RPMTD_ALLOCED;
|
||||
+ msg = dgettext(domain, td->data);
|
||||
+ if (msg != msgid) {
|
||||
+ free(td->data);
|
||||
+ td->data = xstrdup(msg);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
- dstring = _free(dstring);
|
||||
- free(msgkey);
|
||||
- if (td->data)
|
||||
- return 1;
|
||||
+ free(dstring);
|
||||
}
|
||||
-
|
||||
- dstring = _free(dstring);
|
||||
-
|
||||
- rc = headerGet(h, tag, td, HEADERGET_DEFAULT);
|
||||
+
|
||||
return rc;
|
||||
}
|
||||
|
23
rpm.spec
23
rpm.spec
@ -10,15 +10,14 @@
|
||||
%define rpmhome /usr/lib/rpm
|
||||
|
||||
%define rpmver 4.6.0
|
||||
%define snapver rc3
|
||||
%define srcver %{rpmver}-%{snapver}
|
||||
%define srcver %{rpmver}
|
||||
|
||||
%define bdbver 4.5.20
|
||||
|
||||
Summary: The RPM package management system
|
||||
Name: rpm
|
||||
Version: %{rpmver}
|
||||
Release: 0.%{snapver}.1%{?dist}
|
||||
Release: 1%{?dist}
|
||||
Group: System Environment/Base
|
||||
Url: http://www.rpm.org/
|
||||
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
|
||||
@ -29,15 +28,16 @@ Source1: db-%{bdbver}.tar.gz
|
||||
Patch0: rpm-4.5.90-devel-autodep.patch
|
||||
Patch1: rpm-4.5.90-pkgconfig-path.patch
|
||||
Patch2: rpm-4.5.90-gstreamer-provides.patch
|
||||
# Fedora specspo is setup differently than what rpm expects, considering
|
||||
# this as Fedora-specific patch for now
|
||||
Patch3: rpm-4.6.0-fedora-specspo.patch
|
||||
|
||||
# XXX only create provides for pkgconfig and libtool initially
|
||||
Patch100: rpm-4.6.x-no-pkgconfig-reqs.patch
|
||||
|
||||
# Patches already in upstream
|
||||
Patch200: rpm-4.6.0-rc1-defaultdocdir.patch
|
||||
|
||||
# These are not yet upstream
|
||||
Patch300: rpm-4.5.90-posttrans.patch
|
||||
|
||||
# Partially GPL/LGPL dual-licensed and some bits with BSD
|
||||
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
|
||||
License: GPLv2+
|
||||
@ -166,13 +166,11 @@ that will manipulate RPM packages and databases.
|
||||
%patch0 -p1 -b .devel-autodep
|
||||
%patch1 -p1 -b .pkgconfig-path
|
||||
%patch2 -p1 -b .gstreamer-prov
|
||||
%patch3 -p1 -b .fedora.specspo
|
||||
%patch100 -p1 -b .pkgconfig-deps
|
||||
|
||||
%patch200 -p1 -b .defaultdocdir
|
||||
|
||||
# needs a bit of upstream love first...
|
||||
#%patch300 -p1 -b .posttrans
|
||||
|
||||
%if %{with int_bdb}
|
||||
ln -s db-%{bdbver} db
|
||||
%endif
|
||||
@ -368,6 +366,13 @@ exit 0
|
||||
%doc doc/librpm/html/*
|
||||
|
||||
%changelog
|
||||
* Sat Feb 07 2009 Panu Matilainen <pmatilai@redhat.com>
|
||||
- update to 4.6.0 final: http://rpm.org/wiki/Releases/4.6.0, fixing
|
||||
#475582, #478907, #476737, #479869, #476201
|
||||
- change platform sharedstatedir to something more sensible (#185862)
|
||||
- fixup rpm translation lookup to match Fedora specspo (#436941)
|
||||
- add rpmdb_foo links to db utils for documentation compatibility
|
||||
|
||||
* Fri Dec 12 2008 Panu Matilainen <pmatilai@redhat.com>
|
||||
- update to 4.6.0-rc3
|
||||
- fixes segfault on oddball, legacy packages (#475214)
|
||||
|
Loading…
Reference in New Issue
Block a user