Second renaming pass for "rojig"

We're continuing an incremental renaming process; previously we changed
the most user-visible strings.  Now we're doing some internal variables,
and notably the cached refs and the origin files - the latter set is
things that end up on disk.

This leaves the biggest items; renaming APIs, files, and tests.

Closes: #1276
Approved by: jlebon
This commit is contained in:
Colin Walters 2018-02-27 11:07:25 -05:00 committed by Atomic Bot
parent 829a746821
commit b304a433a0
9 changed files with 127 additions and 127 deletions

View File

@ -483,11 +483,11 @@ print_deployments (RPMOSTreeSysroot *sysroot_proxy,
break;
case RPMOSTREE_REFSPEC_TYPE_ROJIG:
{
g_autoptr(GVariant) jigdo_description = NULL;
g_variant_dict_lookup (dict, "jigdo-description", "@a{sv}", &jigdo_description);
if (jigdo_description)
g_autoptr(GVariant) rojig_description = NULL;
g_variant_dict_lookup (dict, "rojig-description", "@a{sv}", &rojig_description);
if (rojig_description)
{
g_autoptr(GVariantDict) dict = g_variant_dict_new (jigdo_description);
g_autoptr(GVariantDict) dict = g_variant_dict_new (rojig_description);
const char *repo = NULL;
g_variant_dict_lookup (dict, "repo", "&s", &repo);
const char *name = NULL;

View File

@ -103,15 +103,15 @@ rpm_ostree_jigdo2commit_context_new (RpmOstreeJigdo2CommitContext **out_context,
static gboolean
impl_rojig2commit (RpmOstreeJigdo2CommitContext *self,
const char *jigdo_id,
const char *rojig_id,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GKeyFile) tsk = g_key_file_new ();
g_key_file_set_string (tsk, "tree", "jigdo", jigdo_id);
g_key_file_set_string (tsk, "tree", "rojig", rojig_id);
if (opt_oirpm_version)
g_key_file_set_string (tsk, "tree", "jigdo-version", opt_oirpm_version);
g_key_file_set_string (tsk, "tree", "rojig-version", opt_oirpm_version);
if (opt_releasever)
g_key_file_set_string (tsk, "tree", "releasever", opt_releasever);
if (opt_enable_rpmmdrepo)
@ -122,13 +122,13 @@ impl_rojig2commit (RpmOstreeJigdo2CommitContext *self,
if (!treespec)
return FALSE;
/* We're also "pure" jigdo - this adds assertions that we don't depsolve for example */
/* We're also "pure" rojig - this adds assertions that we don't depsolve for example */
if (!rpmostree_context_setup (self->ctx, NULL, NULL, treespec, cancellable, error))
return FALSE;
if (!rpmostree_context_prepare_jigdo (self->ctx, cancellable, error))
return FALSE;
gboolean jigdo_changed;
if (!rpmostree_context_execute_jigdo (self->ctx, &jigdo_changed, cancellable, error))
gboolean rojig_changed;
if (!rpmostree_context_execute_jigdo (self->ctx, &rojig_changed, cancellable, error))
return FALSE;
return TRUE;

View File

@ -443,10 +443,10 @@ rpmostree_sysroot_upgrader_pull_base (RpmOstreeSysrootUpgrader *self,
return glnx_throw (error, "Specifying commit overrides for rojig:// is not implemented yet");
g_autoptr(GKeyFile) tsk = g_key_file_new ();
g_key_file_set_string (tsk, "tree", "jigdo", refspec);
const char *jigdo_version = rpmostree_origin_get_jigdo_version (self->origin);
if (jigdo_version)
g_key_file_set_string (tsk, "tree", "jigdo-version", jigdo_version);
g_key_file_set_string (tsk, "tree", "rojig", refspec);
const char *rojig_version = rpmostree_origin_get_jigdo_version (self->origin);
if (rojig_version)
g_key_file_set_string (tsk, "tree", "rojig-version", rojig_version);
g_autoptr(RpmOstreeTreespec) treespec = rpmostree_treespec_new_from_keyfile (tsk, error);
if (!treespec)
@ -455,7 +455,7 @@ rpmostree_sysroot_upgrader_pull_base (RpmOstreeSysrootUpgrader *self,
/* This context is currently different from one that may be created later
* for e.g. package layering. I can't think why we couldn't unify them,
* but for now it seems a lot simpler to keep the symmetry that
* rpm-ostree jigdo == ostree pull.
* rojig == ostree pull.
*/
g_autoptr(RpmOstreeContext) ctx =
rpmostree_context_new_system (self->repo, cancellable, error);
@ -469,17 +469,17 @@ rpmostree_sysroot_upgrader_pull_base (RpmOstreeSysrootUpgrader *self,
*/
if (!rpmostree_context_setup (ctx, NULL, "/", treespec, cancellable, error))
return FALSE;
/* We're also "pure" rpm-ostree jigdo - this adds assertions that we don't depsolve for example */
/* We're also "pure" rojig - this adds assertions that we don't depsolve for example */
if (!rpmostree_context_prepare_jigdo (ctx, cancellable, error))
return FALSE;
DnfPackage *jigdo_pkg = rpmostree_context_get_jigdo_pkg (ctx);
DnfPackage *rojig_pkg = rpmostree_context_get_jigdo_pkg (ctx);
new_base_rev = g_strdup (rpmostree_context_get_jigdo_checksum (ctx));
gboolean jigdo_changed; /* Currently unused */
if (!rpmostree_context_execute_jigdo (ctx, &jigdo_changed, cancellable, error))
gboolean rojig_changed; /* Currently unused */
if (!rpmostree_context_execute_jigdo (ctx, &rojig_changed, cancellable, error))
return FALSE;
if (jigdo_changed)
rpmostree_origin_set_jigdo_description (self->origin, jigdo_pkg);
if (rojig_changed)
rpmostree_origin_set_jigdo_description (self->origin, rojig_pkg);
}
}

View File

@ -329,7 +329,7 @@ rpmostreed_deployment_generate_variant (OstreeSysroot *sysroot,
break;
case RPMOSTREE_REFSPEC_TYPE_ROJIG:
{
g_variant_dict_insert (&dict, "jigdo-description", "@a{sv}",
g_variant_dict_insert (&dict, "rojig-description", "@a{sv}",
rpmostree_origin_get_jigdo_description (origin));
}
break;
@ -985,7 +985,7 @@ rpmostreed_update_generate_variant (OstreeSysroot *sysroot,
if (!rpmostree_refspec_classify (refspec, &refspectype, &refspec_data, error))
return FALSE;
/* we don't support jigdo-based origins yet */
/* we don't support rojig-based origins yet */
if (refspectype != RPMOSTREE_REFSPEC_TYPE_OSTREE)
{
*out_update = NULL;

View File

@ -30,12 +30,12 @@ struct _RpmOstreeContext {
RpmOstreeTreespec *spec;
gboolean empty;
/* jigdo-mode data */
const char *jigdo_spec; /* The jigdo spec like: repoid:package */
const char *jigdo_version; /* Optional */
gboolean jigdo_pure; /* There is only jigdo */
DnfPackage *jigdo_pkg;
char *jigdo_checksum;
/* rojig-mode data */
const char *rojig_spec; /* The rojig spec like: repoid:package */
const char *rojig_version; /* Optional */
gboolean rojig_pure; /* There is only rojig */
DnfPackage *rojig_pkg;
char *rojig_checksum;
gboolean pkgcache_only;
DnfContext *dnfctx;

View File

@ -249,8 +249,8 @@ rpmostree_treespec_new_from_keyfile (GKeyFile *keyfile,
g_variant_builder_add (&builder, "{sv}", k, g_variant_new_string (v)); \
}
BIND_STRING("jigdo");
BIND_STRING("jigdo-version");
BIND_STRING("rojig");
BIND_STRING("rojig-version");
BIND_STRING("releasever");
#undef BIND_STRING
@ -331,8 +331,8 @@ rpmostree_context_finalize (GObject *object)
g_clear_object (&rctx->spec);
g_clear_object (&rctx->dnfctx);
g_clear_object (&rctx->jigdo_pkg);
g_free (rctx->jigdo_checksum);
g_clear_object (&rctx->rojig_pkg);
g_free (rctx->rojig_checksum);
g_clear_object (&rctx->pkgcache_repo);
g_clear_object (&rctx->ostreerepo);
@ -740,10 +740,10 @@ rpmostree_context_setup (RpmOstreeContext *self,
return glnx_throw (error, "No enabled repositories");
}
/* Keep a handy pointer to the jigdo source if specified, since it influences
/* Keep a handy pointer to the rojig source if specified, since it influences
* a lot of things here.
*/
g_variant_dict_lookup (self->spec->dict, "jigdo", "&s", &self->jigdo_spec);
g_variant_dict_lookup (self->spec->dict, "rojig", "&s", &self->rojig_spec);
/* Ensure that each repo that's enabled is marked as required; this should be
* the default, but we make sure. This is a bit of a messy topic, but for
@ -1256,7 +1256,7 @@ rpmostree_get_jigdo_branch_header (Header hdr)
g_autofree char *name = headerGetAsString (hdr, RPMTAG_NAME);
g_autofree char *evr = headerGetAsString (hdr, RPMTAG_EVR);
g_autofree char *arch = headerGetAsString (hdr, RPMTAG_ARCH);
return get_branch_for_n_evr_a ("jigdo", name, evr, arch);
return get_branch_for_n_evr_a ("rojig", name, evr, arch);
}
/* Return the ostree cache branch from a libdnf Package */
@ -1271,7 +1271,7 @@ rpmostree_get_cache_branch_pkg (DnfPackage *pkg)
char *
rpmostree_get_jigdo_branch_pkg (DnfPackage *pkg)
{
return get_branch_for_n_evr_a ("jigdo", dnf_package_get_name (pkg),
return get_branch_for_n_evr_a ("rojig", dnf_package_get_name (pkg),
dnf_package_get_evr (pkg),
dnf_package_get_arch (pkg));
}
@ -1375,7 +1375,7 @@ find_pkg_in_ostree (RpmOstreeContext *self,
if (repo == NULL)
return TRUE; /* Note early return */
g_autofree char *cachebranch = self->jigdo_spec ?
g_autofree char *cachebranch = self->rojig_spec ?
rpmostree_get_jigdo_branch_pkg (pkg) : rpmostree_get_cache_branch_pkg (pkg);
g_autofree char *cached_rev = NULL;
if (!ostree_repo_resolve_rev (repo, cachebranch, TRUE,
@ -1782,39 +1782,39 @@ static gboolean
setup_jigdo_state (RpmOstreeContext *self,
GError **error)
{
g_assert (self->jigdo_spec);
g_assert (!self->jigdo_pkg);
g_assert (!self->jigdo_checksum);
g_assert (self->rojig_spec);
g_assert (!self->rojig_pkg);
g_assert (!self->rojig_checksum);
g_autofree char *jigdo_repoid = NULL;
g_autofree char *jigdo_name = NULL;
g_autofree char *rojig_repoid = NULL;
g_autofree char *rojig_name = NULL;
{ const char *colon = strchr (self->jigdo_spec, ':');
{ const char *colon = strchr (self->rojig_spec, ':');
if (!colon)
return glnx_throw (error, "Invalid jigdo spec '%s', expected repoid:name", self->jigdo_spec);
jigdo_repoid = g_strndup (self->jigdo_spec, colon - self->jigdo_spec);
jigdo_name = g_strdup (colon + 1);
return glnx_throw (error, "Invalid rojig spec '%s', expected repoid:name", self->rojig_spec);
rojig_repoid = g_strndup (self->rojig_spec, colon - self->rojig_spec);
rojig_name = g_strdup (colon + 1);
}
const char *jigdo_version = NULL;
g_variant_dict_lookup (self->spec->dict, "jigdo-version", "&s", &jigdo_version);
const char *rojig_version = NULL;
g_variant_dict_lookup (self->spec->dict, "rojig-version", "&s", &rojig_version);
hy_autoquery HyQuery query = hy_query_create (dnf_context_get_sack (self->dnfctx));
hy_query_filter (query, HY_PKG_REPONAME, HY_EQ, jigdo_repoid);
hy_query_filter (query, HY_PKG_NAME, HY_EQ, jigdo_name);
if (jigdo_version)
hy_query_filter (query, HY_PKG_VERSION, HY_EQ, jigdo_version);
hy_query_filter (query, HY_PKG_REPONAME, HY_EQ, rojig_repoid);
hy_query_filter (query, HY_PKG_NAME, HY_EQ, rojig_name);
if (rojig_version)
hy_query_filter (query, HY_PKG_VERSION, HY_EQ, rojig_version);
g_autoptr(GPtrArray) pkglist = hy_query_run (query);
if (pkglist->len == 0)
return glnx_throw (error, "Failed to find jigdo package '%s'", self->jigdo_spec);
return glnx_throw (error, "Failed to find rojig package '%s'", self->rojig_spec);
g_ptr_array_sort (pkglist, compare_pkgs);
/* We use the last package in the array which should be newest */
self->jigdo_pkg = g_object_ref (pkglist->pdata[pkglist->len-1]);
self->rojig_pkg = g_object_ref (pkglist->pdata[pkglist->len-1]);
/* Iterate over provides directly to provide a nicer error on mismatch */
gboolean found_vprovide = FALSE;
g_autoptr(DnfReldepList) provides = dnf_package_get_provides (self->jigdo_pkg);
g_autoptr(DnfReldepList) provides = dnf_package_get_provides (self->rojig_pkg);
const gint n_provides = dnf_reldep_list_count (provides);
for (int i = 0; i < n_provides; i++)
{
@ -1835,18 +1835,18 @@ setup_jigdo_state (RpmOstreeContext *self,
if (!closeparen)
return glnx_throw (error, "Invalid %s", provide_str);
self->jigdo_checksum = g_strndup (rest, closeparen - rest);
if (strlen (self->jigdo_checksum) != OSTREE_SHA256_STRING_LEN)
self->rojig_checksum = g_strndup (rest, closeparen - rest);
if (strlen (self->rojig_checksum) != OSTREE_SHA256_STRING_LEN)
return glnx_throw (error, "Invalid %s", provide_str);
}
}
if (!found_vprovide)
return glnx_throw (error, "Package '%s' does not have Provides: %s",
dnf_package_get_nevra (self->jigdo_pkg), RPMOSTREE_JIGDO_PROVIDE_V5);
if (!self->jigdo_checksum)
dnf_package_get_nevra (self->rojig_pkg), RPMOSTREE_JIGDO_PROVIDE_V5);
if (!self->rojig_checksum)
return glnx_throw (error, "Package '%s' does not have Provides: %s",
dnf_package_get_nevra (self->jigdo_pkg), RPMOSTREE_JIGDO_PROVIDE_COMMIT);
dnf_package_get_nevra (self->rojig_pkg), RPMOSTREE_JIGDO_PROVIDE_COMMIT);
return TRUE;
}
@ -1889,7 +1889,7 @@ rpmostree_context_prepare (RpmOstreeContext *self,
dnf_sack_set_installonly (dnf_context_get_sack (self->dnfctx), NULL);
dnf_sack_set_installonly_limit (dnf_context_get_sack (self->dnfctx), 0);
if (self->jigdo_pure)
if (self->rojig_pure)
{
g_assert_cmpint (g_strv_length (pkgnames), ==, 0);
g_assert_cmpint (g_strv_length (cached_pkgnames), ==, 0);
@ -1902,7 +1902,7 @@ rpmostree_context_prepare (RpmOstreeContext *self,
for (char **it = removed_base_pkgnames; it && *it; it++)
{
const char *pkgname = *it;
g_assert (!self->jigdo_pure);
g_assert (!self->rojig_pure);
if (!dnf_context_remove (dnfctx, pkgname, error))
return FALSE;
@ -1921,7 +1921,7 @@ rpmostree_context_prepare (RpmOstreeContext *self,
if (!rpmostree_decompose_sha256_nevra (&nevra, &sha256, error))
return FALSE;
g_assert (!self->jigdo_pure);
g_assert (!self->rojig_pure);
if (!install_pkg_from_cache (self, nevra, sha256, cancellable, error))
return FALSE;
@ -1937,7 +1937,7 @@ rpmostree_context_prepare (RpmOstreeContext *self,
if (!rpmostree_decompose_sha256_nevra (&nevra, &sha256, error))
return FALSE;
g_assert (!self->jigdo_pure);
g_assert (!self->rojig_pure);
if (!install_pkg_from_cache (self, nevra, sha256, cancellable, error))
return FALSE;
@ -1958,18 +1958,18 @@ rpmostree_context_prepare (RpmOstreeContext *self,
for (char **it = pkgnames; it && *it; it++)
{
const char *pkgname = *it;
g_assert (!self->jigdo_pure);
g_assert (!self->rojig_pure);
if (!dnf_context_install (dnfctx, pkgname, error))
return FALSE;
}
if (self->jigdo_spec)
if (self->rojig_spec)
{
if (!setup_jigdo_state (self, error))
return FALSE;
}
if (!self->jigdo_pure)
if (!self->rojig_pure)
{
HyGoal goal = dnf_context_get_goal (dnfctx);
@ -1999,7 +1999,7 @@ rpmostree_context_prepare (RpmOstreeContext *self,
}
/* Call this to ensure we don't do any "package stuff" like
* depsolving - we're in "pure jigdo" mode. If specified
* depsolving - we're in "pure rojig" mode. If specified
* this obviously means there are no layered packages for
* example.
*/
@ -2008,7 +2008,7 @@ rpmostree_context_prepare_jigdo (RpmOstreeContext *self,
GCancellable *cancellable,
GError **error)
{
self->jigdo_pure = TRUE;
self->rojig_pure = TRUE;
return rpmostree_context_prepare (self, cancellable, error);
}
@ -2022,7 +2022,7 @@ rpmostree_context_get_packages (RpmOstreeContext *self)
}
/* Rather than doing a depsolve, directly set which packages
* are required. Will be used by jigdo.
* are required. Will be used by rojig.
*/
gboolean
rpmostree_context_set_packages (RpmOstreeContext *self,
@ -2227,20 +2227,20 @@ rpmostree_context_download (RpmOstreeContext *self,
return TRUE;
}
/* Returns: (transfer none): The jigdo package */
/* Returns: (transfer none): The rojig package */
DnfPackage *
rpmostree_context_get_jigdo_pkg (RpmOstreeContext *self)
{
g_assert (self->jigdo_spec);
return self->jigdo_pkg;
g_assert (self->rojig_spec);
return self->rojig_pkg;
}
/* Returns: (transfer none): The jigdo checksum */
/* Returns: (transfer none): The rojig checksum */
const char *
rpmostree_context_get_jigdo_checksum (RpmOstreeContext *self)
{
g_assert (self->jigdo_spec);
return self->jigdo_checksum;
g_assert (self->rojig_spec);
return self->rojig_checksum;
}
static void
@ -2270,8 +2270,8 @@ on_async_import_done (GObject *obj,
gboolean
rpmostree_context_import_jigdo (RpmOstreeContext *self,
GVariant *jigdo_xattr_table,
GHashTable *jigdo_pkg_to_xattrs,
GVariant *rojig_xattr_table,
GHashTable *rojig_pkg_to_xattrs,
GCancellable *cancellable,
GError **error)
{
@ -2282,7 +2282,7 @@ rpmostree_context_import_jigdo (RpmOstreeContext *self,
OstreeRepo *repo = get_pkgcache_repo (self);
g_return_val_if_fail (repo != NULL, FALSE);
g_return_val_if_fail (jigdo_pkg_to_xattrs == NULL || self->sepolicy == NULL, FALSE);
g_return_val_if_fail (rojig_pkg_to_xattrs == NULL || self->sepolicy == NULL, FALSE);
if (!dnf_transaction_import_keys (dnf_context_get_transaction (dnfctx), error))
return FALSE;
@ -2299,12 +2299,12 @@ rpmostree_context_import_jigdo (RpmOstreeContext *self,
for (guint i = 0; i < self->pkgs_to_import->len; i++)
{
DnfPackage *pkg = self->pkgs_to_import->pdata[i];
GVariant *jigdo_xattrs = NULL;
if (jigdo_pkg_to_xattrs)
GVariant *rojig_xattrs = NULL;
if (rojig_pkg_to_xattrs)
{
jigdo_xattrs = g_hash_table_lookup (jigdo_pkg_to_xattrs, pkg);
if (!jigdo_xattrs)
g_error ("Failed to find jigdo xattrs for %s", dnf_package_get_nevra (pkg));
rojig_xattrs = g_hash_table_lookup (rojig_pkg_to_xattrs, pkg);
if (!rojig_xattrs)
g_error ("Failed to find rojig xattrs for %s", dnf_package_get_nevra (pkg));
}
glnx_fd_close int fd = -1;
@ -2336,10 +2336,10 @@ rpmostree_context_import_jigdo (RpmOstreeContext *self,
if (!unpacker)
return FALSE;
if (jigdo_xattrs)
if (rojig_xattrs)
{
g_assert (!self->sepolicy);
rpmostree_importer_set_jigdo_mode (unpacker, jigdo_xattr_table, jigdo_xattrs);
rpmostree_importer_set_jigdo_mode (unpacker, rojig_xattr_table, rojig_xattrs);
}
rpmostree_importer_run_async (unpacker, cancellable, on_async_import_done, self);
@ -3465,7 +3465,7 @@ run_all_transfiletriggers (RpmOstreeContext *self,
GCancellable *cancellable,
GError **error)
{
g_assert (!self->jigdo_pure);
g_assert (!self->rojig_pure);
/* Triggers from base packages, but only if we already have an rpmdb,
* otherwise librpm will whine on our stderr.

View File

@ -33,15 +33,15 @@ struct RpmOstreeOrigin {
/* this is the single source of truth */
GKeyFile *kf;
/* An origin can have either a refspec or a jigdospec */
/* An origin can have either a refspec or a rojigspec */
RpmOstreeRefspecType refspec_type;
char *cached_refspec;
/* Version data that goes along with the refspec */
char *cached_override_commit;
char *cached_jigdo_version;
/* The NEVRA of the jigdoRPM */
char *cached_jigdo_description;
char *cached_rojig_version;
/* The NEVRA of the rojigRPM */
char *cached_rojig_description;
char *cached_unconfigured_state;
char **cached_initramfs_args;
@ -117,14 +117,14 @@ rpmostree_origin_parse_keyfile (GKeyFile *origin,
ret->cached_unconfigured_state = g_key_file_get_string (ret->kf, "origin", "unconfigured-state", NULL);
g_autofree char *refspec = g_key_file_get_string (ret->kf, "origin", "refspec", NULL);
g_autofree char *jigdo_spec = g_key_file_get_string (ret->kf, "origin", "rojig", NULL);
g_autofree char *rojig_spec = g_key_file_get_string (ret->kf, "origin", "rojig", NULL);
if (!refspec)
{
refspec = g_key_file_get_string (ret->kf, "origin", "baserefspec", NULL);
if (!refspec && !jigdo_spec)
if (!refspec && !rojig_spec)
return glnx_null_throw (error, "No origin/refspec, origin/rojig, or origin/baserefspec in current deployment origin; cannot handle via rpm-ostree");
}
if (refspec && jigdo_spec)
if (refspec && rojig_spec)
return glnx_null_throw (error, "Duplicate origin/refspec and origin/rojig in deployment origin");
else if (refspec)
{
@ -139,11 +139,11 @@ rpmostree_origin_parse_keyfile (GKeyFile *origin,
}
else
{
g_assert (jigdo_spec);
g_assert (rojig_spec);
ret->refspec_type = RPMOSTREE_REFSPEC_TYPE_ROJIG;
ret->cached_refspec = g_steal_pointer (&jigdo_spec);
ret->cached_jigdo_version = g_key_file_get_string (ret->kf, "origin", "jigdo-override-version", NULL);
ret->cached_jigdo_description = g_key_file_get_string (ret->kf, "origin", "jigdo-description", NULL);
ret->cached_refspec = g_steal_pointer (&rojig_spec);
ret->cached_rojig_version = g_key_file_get_string (ret->kf, "origin", "rojig-override-version", NULL);
ret->cached_rojig_description = g_key_file_get_string (ret->kf, "origin", "rojig-description", NULL);
}
if (!parse_packages_strv (ret->kf, "packages", "requested", FALSE,
@ -201,7 +201,7 @@ rpmostree_origin_get_full_refspec (RpmOstreeOrigin *origin,
return NULL;
}
/* Returns: TRUE iff the origin type is rpm-ostree jigdo */
/* Returns: TRUE iff the origin type is rpm-ostree rojig */
gboolean
rpmostree_origin_is_rojig (RpmOstreeOrigin *origin)
{
@ -221,7 +221,7 @@ rpmostree_origin_classify_refspec (RpmOstreeOrigin *origin,
const char *
rpmostree_origin_get_jigdo_version (RpmOstreeOrigin *origin)
{
return origin->cached_jigdo_version;
return origin->cached_rojig_version;
}
/* Returns a new (floating) variant of type a{sv} with fields:
@ -237,15 +237,15 @@ rpmostree_origin_get_jigdo_description (RpmOstreeOrigin *origin)
const char *colon = strchr (origin->cached_refspec, ':');
g_assert (colon);
const char *repo = strndupa (origin->cached_refspec, colon - origin->cached_refspec);
g_autofree char *jigdo_evr = g_key_file_get_string (origin->kf, "origin", "jigdo-imported-evr", NULL);
g_autofree char *jigdo_arch = g_key_file_get_string (origin->kf, "origin", "jigdo-imported-arch", NULL);
g_autofree char *rojig_evr = g_key_file_get_string (origin->kf, "origin", "rojig-imported-evr", NULL);
g_autofree char *rojig_arch = g_key_file_get_string (origin->kf, "origin", "rojig-imported-arch", NULL);
g_autoptr(GVariantBuilder) builder = g_variant_builder_new (G_VARIANT_TYPE_VARDICT);
g_variant_builder_add (builder, "{sv}", "repo", g_variant_new_string (repo));
g_variant_builder_add (builder, "{sv}", "name", g_variant_new_string (colon + 1));
if (jigdo_evr)
g_variant_builder_add (builder, "{sv}", "evr", g_variant_new_string (jigdo_evr));
if (jigdo_arch)
g_variant_builder_add (builder, "{sv}", "arch", g_variant_new_string (jigdo_arch));
if (rojig_evr)
g_variant_builder_add (builder, "{sv}", "evr", g_variant_new_string (rojig_evr));
if (rojig_arch)
g_variant_builder_add (builder, "{sv}", "arch", g_variant_new_string (rojig_arch));
return g_variant_builder_end (builder);
}
@ -353,7 +353,7 @@ rpmostree_origin_unref (RpmOstreeOrigin *origin)
return;
g_key_file_unref (origin->kf);
g_free (origin->cached_refspec);
g_free (origin->cached_jigdo_version);
g_free (origin->cached_rojig_version);
g_free (origin->cached_unconfigured_state);
g_strfreev (origin->cached_initramfs_args);
g_clear_pointer (&origin->cached_packages, g_hash_table_unref);
@ -428,14 +428,14 @@ rpmostree_origin_set_jigdo_version (RpmOstreeOrigin *origin,
const char *version)
{
if (version)
g_key_file_set_string (origin->kf, "origin", "jigdo-override-version", version);
g_key_file_set_string (origin->kf, "origin", "rojig-override-version", version);
else
g_key_file_remove_key (origin->kf, "origin", "jigdo-override-version", NULL);
g_free (origin->cached_jigdo_version);
origin->cached_jigdo_version = g_strdup (version);
g_key_file_remove_key (origin->kf, "origin", "rojig-override-version", NULL);
g_free (origin->cached_rojig_version);
origin->cached_rojig_version = g_strdup (version);
}
/* The jigdoRPM is highly special; it doesn't live in the rpmdb for example, as
/* The rojigRPM is highly special; it doesn't live in the rpmdb for example, as
* that would be fully circular. Yet, it's of critical importance to the whole
* system; we want to render it on the client. For now, what we do is stick the
* EVR+A in the origin. That's the only data we really care about.
@ -449,8 +449,8 @@ rpmostree_origin_set_jigdo_description (RpmOstreeOrigin *origin,
DnfPackage *package)
{
g_assert_cmpint (origin->refspec_type, ==, RPMOSTREE_REFSPEC_TYPE_ROJIG);
g_key_file_set_string (origin->kf, "origin", "jigdo-imported-evr", dnf_package_get_evr (package));
g_key_file_set_string (origin->kf, "origin", "jigdo-imported-arch", dnf_package_get_arch (package));
g_key_file_set_string (origin->kf, "origin", "rojig-imported-evr", dnf_package_get_evr (package));
g_key_file_set_string (origin->kf, "origin", "rojig-imported-arch", dnf_package_get_arch (package));
}
gboolean
@ -462,7 +462,7 @@ rpmostree_origin_set_rebase (RpmOstreeOrigin *origin,
* rebase by default.
*/
rpmostree_origin_set_override_commit (origin, NULL, NULL);
g_key_file_remove_key (origin->kf, "origin", "jigdo-override-version", NULL);
g_key_file_remove_key (origin->kf, "origin", "rojig-override-version", NULL);
/* See related code in rpmostree_origin_parse_keyfile() */
const char *refspecdata;
@ -475,8 +475,8 @@ rpmostree_origin_set_rebase (RpmOstreeOrigin *origin,
case RPMOSTREE_REFSPEC_TYPE_OSTREE:
{
g_key_file_remove_key (origin->kf, "origin", "rojig", NULL);
g_key_file_remove_key (origin->kf, "origin", "jigdo-imported-evr", NULL);
g_key_file_remove_key (origin->kf, "origin", "jigdo-imported-arch", NULL);
g_key_file_remove_key (origin->kf, "origin", "rojig-imported-evr", NULL);
g_key_file_remove_key (origin->kf, "origin", "rojig-imported-arch", NULL);
const char *refspec_key =
g_key_file_has_key (origin->kf, "origin", "baserefspec", NULL) ?
"baserefspec" : "refspec";

View File

@ -54,10 +54,10 @@ do_rojig2commit
assert_file_has_content jigdo2commit-out.txt ${npkgs}/${npkgs}' packages to import'
ostree --repo=jigdo-unpack-repo rev-parse ${rev}
ostree --repo=jigdo-unpack-repo fsck
ostree --repo=jigdo-unpack-repo refs > jigdo-refs.txt
assert_file_has_content jigdo-refs.txt 'rpmostree/jigdo/test-pkg/1.0-1.x86__64'
ostree --repo=jigdo-unpack-repo refs > rojig-refs.txt
assert_file_has_content rojig-refs.txt 'rpmostree/rojig/test-pkg/1.0-1.x86__64'
echo "ok jigdo ♲📦 fresh assembly"
echo "ok rojig ♲📦 fresh assembly"
origrev=${rev}
unset rev
@ -94,13 +94,13 @@ for x in ${origrev} ${newrev}; do
ostree --repo=jigdo-unpack-repo rev-parse ${x}
done
ostree --repo=jigdo-unpack-repo fsck
ostree --repo=jigdo-unpack-repo refs > jigdo-refs.txt
ostree --repo=jigdo-unpack-repo refs > rojig-refs.txt
# We should have both refs; GC will be handled by the sysroot upgrader
# via deployments, same way it is for pkg layering.
assert_file_has_content jigdo-refs.txt 'rpmostree/jigdo/test-pkg/1.0-1.x86__64'
assert_file_has_content jigdo-refs.txt 'rpmostree/jigdo/test-pkg/1.1-1.x86__64'
assert_file_has_content rojig-refs.txt 'rpmostree/rojig/test-pkg/1.0-1.x86__64'
assert_file_has_content rojig-refs.txt 'rpmostree/rojig/test-pkg/1.1-1.x86__64'
echo "ok jigdo ♲📦 update!"
echo "ok rojig ♲📦 update!"
# Add all docs to test https://github.com/projectatomic/rpm-ostree/issues/1197
pysetjsonmember "documentation" 'True'
@ -113,4 +113,4 @@ do_rojig2commit
# Not every package has docs, but there are going to need to be changes
assert_file_has_content jigdo2commit-out.txt '[1-9][0-9]*/[1-9][0-9]* packages to import ([1-9][0-9]* changed)'
ostree --repo=jigdo-unpack-repo ls -R ${newrev} >/dev/null
echo "ok jigdo ♲📦 updated docs"
echo "ok rojig ♲📦 updated docs"

View File

@ -40,7 +40,7 @@ assert_file_has_content_literal err.txt 'rojig:// refspec requires --experimenta
vm_rpmostree rebase --experimental rojig://fahc:fedora-atomic-host
vm_assert_status_jq '.deployments[0].origin|startswith("rojig://fahc:fedora-atomic-host")'
vm_cmd ostree refs > refs.txt
assert_file_has_content refs.txt '^rpmostree/jigdo/kernel-core/'
assert_file_has_content refs.txt '^rpmostree/rojig/kernel-core/'
echo "ok jigdo client rebase "
version=$(vm_get_deployment_info 0 version)