public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Fix harmless unused variable warning from fedora-specspo patch
@ 2026-11-23 9:30 Panu Matilainen
0 siblings, 0 replies; only message in thread
From: Panu Matilainen @ 2026-11-23 9:30 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rpm
Branch : pmatilai-v6
Commit : 32a2500e40958333aa0f2fe317949d815dc4bea6
Author : Panu Matilainen <pmatilai@redhat.com>
Date : 2016-11-02T08:01:35+02:00
Stats : +100/-80 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/rpm/c/32a2500e40958333aa0f2fe317949d815dc4bea6?branch=pmatilai-v6
Log:
Fix harmless unused variable warning from fedora-specspo patch
Fedora specspo version is much simpler than the upstream one and
doesn't need to change languages etc, just drop the unused foa
tripping warnings.o
---
diff --git a/rpm-4.13.0-fedora-specspo.patch b/rpm-4.13.0-fedora-specspo.patch
new file mode 100644
index 0000000..64416c7
--- /dev/null
+++ b/rpm-4.13.0-fedora-specspo.patch
@@ -0,0 +1,95 @@
+diff --git a/lib/tagexts.c b/lib/tagexts.c
+index f72ff60..2c0b179 100644
+--- a/lib/tagexts.c
++++ b/lib/tagexts.c
+@@ -535,15 +535,6 @@ static int filerequireTag(Header h, rpmtd td, headerGetFlags hgflags)
+ return filedepTag(h, RPMTAG_REQUIRENAME, td, hgflags);
+ }
+
+-/* 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}";
+-
+ /**
+ * Retrieve i18n text.
+ * @param h header
+@@ -554,59 +545,30 @@ static const char * const _macro_i18ndomains = "%{?_i18ndomains}";
+ */
+ static int i18nTag(Header h, rpmTag tag, rpmtd td, headerGetFlags hgflags)
+ {
+- int rc;
++ int rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ #if defined(ENABLE_NLS)
+- char * dstring = rpmExpand(_macro_i18ndomains, NULL);
+-
+- 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;
++ if (rc) {
++ static const char * const _macro_i18ndomains = "%{?_i18ndomains}";
++ char *de, *dstring = rpmExpand(_macro_i18ndomains, NULL);
++ const char *domain;
+
+- rasprintf(&msgkey, "%s(%s)", headerGetString(h, RPMTAG_NAME),
+- rpmTagGetName(tag));
+-
+- /* change to en_US for msgkey -> msgid resolution */
+- langval = getenv(language);
+- (void) setenv(language, "en_US", 1);
+- ++_nl_msg_cat_cntr;
+-
+- 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);
+- ++_nl_msg_cat_cntr;
+-
+- 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);
+ }
+-
+- free(dstring);
+ #endif
+
+- rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ return rc;
+ }
+
diff --git a/rpm-4.9.90-fedora-specspo.patch b/rpm-4.9.90-fedora-specspo.patch
deleted file mode 100644
index 61394cf..0000000
--- a/rpm-4.9.90-fedora-specspo.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-diff --git a/lib/tagexts.c b/lib/tagexts.c
-index dc0e0fb..e0a5d1f 100644
---- a/lib/tagexts.c
-+++ b/lib/tagexts.c
-@@ -478,59 +478,29 @@ static const char * const _macro_i18ndomains = "%{?_i18ndomains}";
- */
- static int i18nTag(Header h, rpmTag tag, rpmtd td, headerGetFlags hgflags)
- {
-- int rc;
-+ int rc = headerGet(h, tag, td, HEADERGET_ALLOC);
- #if defined(ENABLE_NLS)
-- char * dstring = rpmExpand(_macro_i18ndomains, NULL);
--
-- 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;
--
-- rasprintf(&msgkey, "%s(%s)", headerGetString(h, RPMTAG_NAME),
-- rpmTagGetName(tag));
--
-- /* change to en_US for msgkey -> msgid resolution */
-- langval = getenv(language);
-- (void) setenv(language, "en_US", 1);
-- ++_nl_msg_cat_cntr;
-+ if (rc) {
-+ char *de, *dstring = rpmExpand(_macro_i18ndomains, NULL);
-+ const char *domain;
-
-- 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);
-- ++_nl_msg_cat_cntr;
--
-- 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);
- }
--
-- free(dstring);
- #endif
-
-- rc = headerGet(h, tag, td, HEADERGET_ALLOC);
- return rc;
- }
-
diff --git a/rpm.spec b/rpm.spec
index 00331c4..6f12f4a 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -29,7 +29,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}1%{?dist}
+Release: %{?snapver:0.%{snapver}.}2%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@@ -43,7 +43,7 @@ BuildRequires: libdb-devel
Patch1: rpm-4.11.x-siteconfig.patch
# Fedora specspo is setup differently than what rpm expects, considering
# this as Fedora-specific patch for now
-Patch2: rpm-4.9.90-fedora-specspo.patch
+Patch2: rpm-4.13.0-fedora-specspo.patch
# In current Fedora, man-pages pkg owns all the localized man directories
Patch3: rpm-4.9.90-no-man-dirs.patch
# gnupg2 comes installed by default, avoid need to drag in gnupg too
@@ -556,6 +556,9 @@ exit 0
%doc doc/librpm/html/*
%changelog
+* Wed Nov 02 2016 Panu Matilainen <pmatilai@redhat.com> - 4.13.0-0.rc2.2
+- Fix harmless unused variable warning from fedora-specspo patch
+
* Thu Oct 20 2016 Panu Matilainen <pmatilai@redhat.com> - 4.13.0-0.rc2.1
- Rebase to rpm 4.13.0-rc2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 9:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 9:30 [rpms/rpm] pmatilai-v6: Fix harmless unused variable warning from fedora-specspo patch Panu Matilainen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox