build-sys: Drop support for ancient librpm

Here's where we stop caring about RHEL7's librpm.

Closes: #1794
Approved by: jlebon
This commit is contained in:
Colin Walters 2019-03-21 02:54:52 +00:00 committed by Atomic Bot
parent 02b25c616d
commit 8331e8069a
5 changed files with 3 additions and 42 deletions

View File

@ -123,17 +123,7 @@ PKGDEP_RPMOSTREE_CFLAGS="-I $(pwd)/libdnf -I $(pwd)/libdnf-build $PKGDEP_RPMOSTR
PKGDEP_RPMOSTREE_LIBS="-L$(pwd)/libdnf-build/libdnf -ldnf $PKGDEP_RPMOSTREE_LIBS"
dnl This is the current version in Fedora 25.
AS_IF([pkg-config --atleast-version=4.13.0.1 rpm], [
have_modern_rpm=true
AC_DEFINE([BUILDOPT_HAVE_RPMSQ_SET_INTERRUPT_SAFETY], 1, [Set to 1 if we have interrupt safety API])
AC_DEFINE([BUILDOPT_HAVE_RPM_FILETRIGGERS], 1, [Set to 1 if we have file triggers])
AC_DEFINE([BUILDOPT_HAVE_RPMFILES], 1, [Set to 1 if we have rpmfiles API])
], [have_modern_rpm=false])
dnl See usage
AS_IF([pkg-config --atleast-version=4.14.2 rpm], [
AC_DEFINE([BUILDOPT_HAVE_NEW_RPM_VERIFY], 1, [Set to 1 if we have rpmtsSetVfyLevel])
])
librpm_version="$(pkg-config rpm --modversion)"
AS_IF([pkg-config --atleast-version=4.14.2 rpm], [], [AC_MSG_ERROR([librpm 4.14.2 required])])
AC_ARG_ENABLE(dfd_over_dbus,
AS_HELP_STRING([--enable-dfd-over-dbus],
@ -317,7 +307,6 @@ AC_OUTPUT
echo "
$PACKAGE $VERSION
built with modern RPM (e.g. Fedora 25+): $have_modern_rpm ($librpm_version)
nts name: $enable_new_name
compose tooling: $enable_compose_tooling
introspection: $found_introspection

View File

@ -412,9 +412,7 @@ rpmostree_context_new_system (OstreeRepo *repo,
* otherwise we keep calling _rpmostree_reset_rpm_sighandlers() in
* various places.
*/
#ifdef BUILDOPT_HAVE_RPMSQ_SET_INTERRUPT_SAFETY
rpmsqSetInterruptSafety (FALSE);
#endif
self->dnfctx = dnf_context_new ();
DECLARE_RPMSIGHANDLER_RESET;
@ -2496,12 +2494,8 @@ static void
add_te_files_to_ht (rpmte te,
GHashTable *ht)
{
#ifdef BUILDOPT_HAVE_RPMFILES /* use rpmfiles API if possible, rpmteFI is deprecated */
g_auto(rpmfiles) files = rpmteFiles (te);
g_auto(rpmfi) fi = rpmfilesIter (files, RPMFI_ITER_FWD);
#else
rpmfi fi = rpmteFI (te); /* rpmfi owned by rpmte */
#endif
while (rpmfiNext (fi) >= 0)
{
@ -2598,11 +2592,7 @@ handle_file_dispositions (RpmOstreeContext *self,
continue;
/* try to only load what we need: filenames and colors */
rpmfiFlags flags = RPMFI_FLAGS_QUERY;
#ifdef BUILDOPT_HAVE_RPMFILES /* we're using this more as a "if not on CentOS" switch */
/* this is even more restrictive that QUERY */
flags = RPMFI_FLAGS_ONLY_FILENAMES;
#endif
rpmfiFlags flags = RPMFI_FLAGS_ONLY_FILENAMES;
flags &= ~RPMFI_NOFILECOLORS;
g_auto(rpmfi) fi = rpmfiNew (ts, h, RPMTAG_BASENAMES, flags);
@ -2834,15 +2824,11 @@ delete_package_from_root (RpmOstreeContext *self,
GCancellable *cancellable,
GError **error)
{
#ifdef BUILDOPT_HAVE_RPMFILES /* use rpmfiles API if possible, rpmteFI is deprecated */
g_auto(rpmfiles) files = rpmteFiles (pkg);
/* NB: new librpm uses RPMFI_ITER_BACK here to empty out dirs before deleting them using
* unlink/rmdir. Older rpm doesn't support this API, so rather than doing some fancy
* compat, we just use shutil_rm_rf anyway since we now skip over shared dirs/files. */
g_auto(rpmfi) fi = rpmfilesIter (files, RPMFI_ITER_FWD);
#else
rpmfi fi = rpmteFI (pkg); /* rpmfi owned by rpmte */
#endif
while (rpmfiNext (fi) >= 0)
{
@ -4238,9 +4224,7 @@ rpmostree_context_assemble (RpmOstreeContext *self,
* just the header in metadata - we don't have the exact original content to
* provide again.
*/
#ifdef BUILDOPT_HAVE_NEW_RPM_VERIFY
rpmtsSetVfyLevel (rpmdb_ts, 0);
#endif
/* We're just writing the rpmdb, hence _JUSTDB. Also disable the librpm
* SELinux plugin since rpm-ostree (and ostree) have fundamentally better
* code.

View File

@ -1002,13 +1002,7 @@ rpmostree_pkg_array_compare (DnfPackage **p_pkg1,
void
rpmostree_sighandler_reset_cleanup (RpmSighandlerResetCleanup *cleanup)
{
/* Forcibly override rpm/librepo SIGINT handlers. We always operate
* in a fully idempotent/atomic mode, and can be killed at any time.
*/
#ifndef BUILDOPT_HAVE_RPMSQ_SET_INTERRUPT_SAFETY
signal (SIGINT, SIG_DFL);
signal (SIGTERM, SIG_DFL);
#endif
/* No-op now that we have rpmsqSetInterruptSafety_ */
}
static void

View File

@ -72,9 +72,7 @@ G_DEFINE_AUTO_CLEANUP_FREE_FUNC(Header, headerFree, NULL)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC(rpmfi, rpmfiFree, NULL)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC(rpmts, rpmtsFree, NULL)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC(rpmdbMatchIterator, rpmdbFreeIterator, NULL)
#ifdef BUILDOPT_HAVE_RPMFILES
G_DEFINE_AUTO_CLEANUP_FREE_FUNC(rpmfiles, rpmfilesFree, NULL)
#endif
void
rpmhdrs_diff_prnt_diff (struct RpmHeadersDiff *diff);

View File

@ -663,7 +663,6 @@ run_script (const KnownRpmScriptKind *rpmscript,
enable_fuse, cancellable, error);
}
#ifdef BUILDOPT_HAVE_RPM_FILETRIGGERS
static gboolean
write_filename (FILE *f, GString *prefix,
GError **error)
@ -769,7 +768,6 @@ find_and_write_matching_files (int rootfs_fd, const char *pattern,
return TRUE;
}
#endif
/* Execute a supported script. Note that @cancellable
* does not currently kill a running script subprocess.
@ -823,7 +821,6 @@ rpmostree_transfiletriggers_run_sync (Header hdr,
GCancellable *cancellable,
GError **error)
{
#ifdef BUILDOPT_HAVE_RPM_FILETRIGGERS
const char *pkg_name = headerGetString (hdr, RPMTAG_NAME);
g_assert (pkg_name);
@ -992,7 +989,6 @@ rpmostree_transfiletriggers_run_sync (Header hdr,
"EXEC_TIME_MS=%" G_GUINT64_FORMAT, elapsed_ms,
NULL);
}
#endif
return TRUE;
}