Avoid DNS use in test-suite, drop obsolete patches

Use pre-determined buildhost in test-suite to avoid DNS usage, sometimes
the builder DNS config is whacked which causes crazy slowdown of our builds.

Drop obsolete specspo and gpg2 related patches, specspo is gone for
seven years and gpg2 preferral is upstream in a different form (thanks
to Igor Gnatenko for pointing these out)
This commit is contained in:
Panu Matilainen 2019-06-07 13:52:34 +03:00
parent bda4949bed
commit d90bd67908
4 changed files with 51 additions and 113 deletions

View File

@ -0,0 +1,45 @@
From b7606b9dbebba90fb4868fd01e9c05abe05d9586 Mon Sep 17 00:00:00 2001
Message-Id: <b7606b9dbebba90fb4868fd01e9c05abe05d9586.1559904592.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Fri, 7 Jun 2019 13:12:18 +0300
Subject: [PATCH] Use a pre-determined buildhost in test-suite to avoid DNS
usage
A misconfigured DNS can cause bogus test-suite failures and hideous
slow-down for no reason of our own. Use a preset, predictable
buildhost name to avoid such issues.
---
tests/atlocal.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/atlocal.in b/tests/atlocal.in
index a44c067bf..fcbf783d7 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -45,20 +45,20 @@ fi
function run()
{
- "$@" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
+ "$@" --define "_buildhost testhost" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
}
function rundebug()
{
cp ${top_srcdir}/macros.debug ${RPM_CONFIGDIR}/macros.d/
- "$@" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
+ "$@" --define "_buildhost testhost" --define "_tmppath ${RPMTEST}/tmp" --define "_topdir ${TOPDIR}" --dbpath="${RPMTEST}/var/lib/rpm/"
rm -f ${RPM_CONFIGDIR}/macros.d/macros.debug
}
function runroot()
{
(unset RPM_CONFIGDIR RPM_POPTEXEC_PATH; cd ${RPMTEST} && \
- MAGIC="/magic/magic" FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_topdir /build" --noplugins
+ MAGIC="/magic/magic" FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_buildhost testhost" --define "_topdir /build" --noplugins
)
}
--
2.21.0

View File

@ -1,95 +0,0 @@
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;
}

View File

@ -1,12 +0,0 @@
diff -up rpm-4.8.1/macros.in.gpg2 rpm-4.8.1/macros.in
--- rpm-4.8.0/macros.in.gpg2 2011-01-17 12:17:38.000000000 +0200
+++ rpm-4.8.0/macros.in 2011-01-17 12:17:59.000000000 +0200
@@ -40,7 +40,7 @@
%__cp @__CP@
%__cpio @__CPIO@
%__file @__FILE@
-%__gpg @__GPG@
+%__gpg /usr/bin/gpg2
%__grep @__GREP@
%__gzip @__GZIP@
%__id @__ID@

View File

@ -23,7 +23,7 @@
%global rpmver 4.14.2.1
#global snapver rc2
%global rel 11
%global rel 12
%global srcver %{version}%{?snapver:-%{snapver}}
%global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x}
@ -45,13 +45,8 @@ Source1: db-%{bdbver}.tar.gz
# Disable autoconf config.site processing (#962837)
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.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
Patch4: rpm-4.8.1-use-gpg2.patch
# Temporary band-aid for rpm2cpio whining on payload size mismatch (#1142949)
Patch5: rpm-4.12.0-rpm2cpio-hack.patch
# https://github.com/rpm-software-management/rpm/pull/473
@ -65,6 +60,7 @@ Patch106: 0001-find-debuginfo.sh-Handle-position-independent-execut.patch
Patch107: 0001-Add-flag-to-use-strip-g-instead-of-full-strip-on-DSO.patch
Patch108: 0001-Detect-kernel-modules-by-.modinfo-section-presence-f.patch
Patch109: 0002-Support-build-id-generation-from-compressed-ELF-file.patch
Patch110: 0001-Use-a-pre-determined-buildhost-in-test-suite-to-avoi.patch
# Python 3 string API sanity
Patch150: 0001-In-Python-3-return-all-our-string-data-as-surrogate-.patch
@ -580,6 +576,10 @@ make check || (cat tests/rpmtests.log; exit 1)
%doc doc/librpm/html/*
%changelog
* Fri Jun 07 2019 Panu Matilainen <pmatilai@redhat.com> - 4.14.2.1-12
- Use pre-determined buildhost in test-suite to avoid DNS usage
- Drop obsolete specspo and gpg2 related patches
* Fri Jun 07 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.14.2.1-11
- Use py2/3 macros for building and installing the bindings