diff --git a/src/libpriv/rpmostree-core.c b/src/libpriv/rpmostree-core.c index 6ba769fc..28f7c40d 100644 --- a/src/libpriv/rpmostree-core.c +++ b/src/libpriv/rpmostree-core.c @@ -354,8 +354,10 @@ rpmostree_context_new_system (GCancellable *cancellable, dnf_context_set_http_proxy (self->hifctx, g_getenv ("http_proxy")); dnf_context_set_repo_dir (self->hifctx, "/etc/yum.repos.d"); - /* Operating on stale metadata is too annoying */ - dnf_context_set_cache_age (self->hifctx, 0); + /* Operating on stale metadata is too annoying -- but provide a way to + * override this for testing. */ + if (g_getenv("RPMOSTREE_USE_CACHED_METADATA") == NULL) + dnf_context_set_cache_age (self->hifctx, 0); dnf_context_set_cache_dir (self->hifctx, "/var/cache/rpm-ostree/" RPMOSTREE_DIR_CACHE_REPOMD); dnf_context_set_solv_dir (self->hifctx, "/var/cache/rpm-ostree/" RPMOSTREE_DIR_CACHE_SOLV); dnf_context_set_lock_dir (self->hifctx, "/run/rpm-ostree/" RPMOSTREE_DIR_LOCK); diff --git a/src/libpriv/rpmostree-postprocess.c b/src/libpriv/rpmostree-postprocess.c index fe8e63c9..37195e02 100644 --- a/src/libpriv/rpmostree-postprocess.c +++ b/src/libpriv/rpmostree-postprocess.c @@ -1542,7 +1542,7 @@ mutate_os_release (const char *contents, continue; /* NB: we don't mutate VERSION_ID because some libraries expect well-known - * values there*/ + * values there */ if (g_str_has_prefix (line, "VERSION=") || \ g_str_has_prefix (line, "PRETTY_NAME=")) { diff --git a/tests/compose b/tests/compose index a81b25ac..39786099 100755 --- a/tests/compose +++ b/tests/compose @@ -5,6 +5,9 @@ dn=$(cd $(dirname $0) && pwd) export topsrcdir=$(cd $dn/.. && pwd) +# avoid refetching yum metadata everytime +export RPMOSTREE_USE_CACHED_METADATA=1 + LOG=${LOG:-compose.log} date > ${LOG}