Initial renaming pass of "jigdo" to "rojig"

I noticed that Ubuntu also uses the original "jigdo", so let's start
pulling off the band-aid here and do a mass rename.

For this first pass I'm focusing on CLI entrypoints and docs, as that's what
people are going to see; renaming all of the internal C functions, structure
variables etc. can come later.

Closes: #1269
Approved by: jlebon
This commit is contained in:
Colin Walters 2018-02-22 10:18:24 -05:00 committed by Atomic Bot
parent 4af55efffd
commit 3dd132285a
13 changed files with 61 additions and 54 deletions

View File

@ -1,10 +1,10 @@
Introducing rpm-ostree jigdo
Introducing rpm-ostree rojig
--------
In the rpm-ostree project, we're blending an image system (libostree)
with a package system (libdnf). The goal is to gain the
advantages of both. However, the dual nature also brings overhead;
this proposal aims to reduce some of that by adding a new "jigdo"
this proposal aims to reduce some of that by adding a new "rojig"
model to rpm-ostree that makes more operations use the libdnf side.
To do this, we're reviving an old idea: The [http://atterer.org/jigdo/](Jigdo)
@ -62,7 +62,7 @@ How?
We've already stated that a primary design goal is to preserve the "image"
functionality by default. Further, let's assume that we have an OSTree commit,
and we want to point it at a set of RPMs to use as the jigdo source. The source
and we want to point it at a set of RPMs to use as the rojig source. The source
OSTree commit can have modified, added to, or removed data from the RPM set, and
we will support that. Examples of additional data are the initramfs and RPM
database.
@ -74,7 +74,7 @@ with checksum that is bit-for-bit identical.
A simple approach is to scan over the set of files in the RPMs, then the set
of files in the OSTree commit, and add RPMs which contain files in the OSTree
commit to our "jigdo set".
commit to our "rojig set".
However, a major complication is SELinux labeling. It turns out that in a lot of
cases, doing SELinux labeling is expensive; there are thousands of regular
@ -84,7 +84,7 @@ further complicating things is that there are also other packages that add
labeling configuration such as `container-selinux`. In other words there's a
circular dependency: packages have labels, but labels are contained in packages.
We go to great lengths to handle this in rpm-ostree for package layering, and we
need to do the same for jigdo.
need to do the same for rojig.
We can address this by having our OIRPM contain a mapping of (package, file
path) to a set of extended attributes (including the key `security.selinux`
@ -92,6 +92,5 @@ one).
At this point, if we add in the new objects such as the metadata objects from
the OSTree commit and all new content objects that aren't part of a package,
we'll have our OIRPM. (There is
some [further complexity](https://pagure.io/fedora-atomic/issue/94) around
we'll have our rojigRPM. (There is some [further complexity](https://pagure.io/fedora-atomic/issue/94) around
handling the initramfs and SELinux labeling that we'll omit for now).

View File

@ -203,6 +203,6 @@ Experimental options
All options listed here are subject to change or removal in a future
version of `rpm-ostree`.
* `ex-jigdo-spec`: string, optional: If specified, will also cause
a run of `rpm-ostree ex commit2jigdo` on changes. Also requires the
`--ex-jigdo-output-rpm` commandline option.
* `ex-rojig-spec`: string, optional: If specified, will also cause
a run of `rpm-ostree ex commit2rojig` on changes. Also requires the
`--ex-rojig-output-rpm` commandline option.

View File

@ -30,10 +30,10 @@ static RpmOstreeCommand ex_subcommands[] = {
"Assemble local unprivileged containers", rpmostree_builtin_container },
{ "kargs", 0,
"Query or Modify the kernel arguments", rpmostree_ex_builtin_kargs },
{ "commit2jigdo", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
"Convert an OSTree commit into an rpm-ostree jigdo", rpmostree_ex_builtin_commit2jigdo },
{ "jigdo2commit", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
"Convert an rpm-ostree jigdo into an OSTree commit", rpmostree_ex_builtin_jigdo2commit },
{ "commit2rojig", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
"Convert an OSTree commit into an rpm-ostree rojig", rpmostree_ex_builtin_commit2rojig },
{ "rojig2commit", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
"Convert an rpm-ostree rojig into an OSTree commit", rpmostree_ex_builtin_rojig2commit },
{ NULL, 0, NULL, NULL }
};

View File

@ -78,8 +78,10 @@ static GOptionEntry install_option_entries[] = {
{ "cachedir", 0, 0, G_OPTION_ARG_STRING, &opt_cachedir, "Cached state", "CACHEDIR" },
{ "download-only", 0, 0, G_OPTION_ARG_NONE, &opt_download_only, "Like --dry-run, but download RPMs as well; requires --cachedir", NULL },
{ "ex-unified-core", 0, 0, G_OPTION_ARG_NONE, &opt_ex_unified_core, "Use new \"unified core\" codepath", NULL },
{ "ex-jigdo-output-rpm", 0, 0, G_OPTION_ARG_STRING, &opt_ex_jigdo_output_rpm, "Directory to write jigdoRPM", NULL },
{ "ex-jigdo-output-set", 0, 0, G_OPTION_ARG_STRING, &opt_ex_jigdo_output_set, "Directory to write complete jigdo set (jigdoRPM+dependencies)", NULL },
{ "ex-jigdo-output-rpm", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &opt_ex_jigdo_output_rpm, "Deprecated alias", NULL },
{ "ex-jigdo-output-set", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &opt_ex_jigdo_output_set, "Deprecated alias", NULL },
{ "ex-rojig-output-rpm", 0, 0, G_OPTION_ARG_STRING, &opt_ex_jigdo_output_rpm, "Directory to write rojigRPM", NULL },
{ "ex-rojig-output-set", 0, 0, G_OPTION_ARG_STRING, &opt_ex_jigdo_output_set, "Directory to write complete rojig set (rojigRPM+dependencies)", NULL },
{ "proxy", 0, 0, G_OPTION_ARG_STRING, &opt_proxy, "HTTP proxy", "PROXY" },
{ "dry-run", 0, 0, G_OPTION_ARG_NONE, &opt_dry_run, "Just print the transaction and exit", NULL },
{ "output-repodata-dir", 0, 0, G_OPTION_ARG_STRING, &opt_output_repodata_dir, "Save downloaded repodata in DIR", "DIR" },
@ -941,8 +943,14 @@ rpm_ostree_compose_context_new (const char *treefile_pathstr,
g_autoptr(GFile) treefile_dir = g_file_get_parent (self->treefile_path);
const char *jigdo_spec = NULL;
if (!_rpmostree_jsonutil_object_get_optional_string_member (self->treefile, "ex-jigdo-spec", &jigdo_spec, error))
if (!_rpmostree_jsonutil_object_get_optional_string_member (self->treefile, "ex-rojig-spec", &jigdo_spec, error))
return FALSE;
if (!jigdo_spec)
{
/* Backcompat for a little while */
if (!_rpmostree_jsonutil_object_get_optional_string_member (self->treefile, "ex-jigdo-spec", &jigdo_spec, error))
return FALSE;
}
if (jigdo_spec)
self->jigdo_spec = g_build_filename (gs_file_get_path_cached (treefile_dir), jigdo_spec, NULL);
@ -1276,8 +1284,8 @@ impl_commit_tree (RpmOstreeTreeComposeContext *self,
if (jigdo_outputdir)
{
if (!self->jigdo_spec)
return glnx_throw (error, "No ex-jigdo-spec provided");
if (!rpmostree_commit2jigdo (self->repo, self->pkgcache_repo,
return glnx_throw (error, "No ex-rojig-spec provided");
if (!rpmostree_commit2rojig (self->repo, self->pkgcache_repo,
new_revision, self->jigdo_spec,
jigdo_outputdir,
cancellable, error))

View File

@ -30,8 +30,8 @@ gboolean rpmostree_compose_builtin_tree (int argc, char **argv, RpmOstreeCommand
gboolean rpmostree_compose_builtin_install (int argc, char **argv, RpmOstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error);
gboolean rpmostree_compose_builtin_postprocess (int argc, char **argv, RpmOstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error);
gboolean rpmostree_compose_builtin_commit (int argc, char **argv, RpmOstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error);
gboolean rpmostree_compose_builtin_commit2jigdo (int argc, char **argv, RpmOstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error);
gboolean rpmostree_compose_builtin_jigdo2commit (int argc, char **argv, RpmOstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error);
gboolean rpmostree_compose_builtin_commit2rojig (int argc, char **argv, RpmOstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error);
gboolean rpmostree_compose_builtin_rojig2commit (int argc, char **argv, RpmOstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error);
G_END_DECLS

View File

@ -45,7 +45,7 @@ static char *opt_repo;
static char *opt_pkgcache_repo;
static gboolean opt_only_contentdir;
static GOptionEntry commit2jigdo_option_entries[] = {
static GOptionEntry commit2rojig_option_entries[] = {
{ "repo", 0, 0, G_OPTION_ARG_STRING, &opt_repo, "OSTree repo", "REPO" },
{ "pkgcache-repo", 0, 0, G_OPTION_ARG_STRING, &opt_pkgcache_repo, "Pkgcache OSTree repo", "REPO" },
{ "only-contentdir", 0, 0, G_OPTION_ARG_NONE, &opt_only_contentdir, "Do not generate RPM, only output content directory", NULL },
@ -53,7 +53,7 @@ static GOptionEntry commit2jigdo_option_entries[] = {
};
int
rpmostree_ex_builtin_commit2jigdo (int argc,
rpmostree_ex_builtin_commit2rojig (int argc,
char **argv,
RpmOstreeCommandInvocation *invocation,
GCancellable *cancellable,
@ -61,7 +61,7 @@ rpmostree_ex_builtin_commit2jigdo (int argc,
{
g_autoptr(GOptionContext) context = g_option_context_new ("REV OIRPM-SPEC OUTPUTDIR");
if (!rpmostree_option_context_parse (context,
commit2jigdo_option_entries,
commit2rojig_option_entries,
&argc, &argv,
invocation,
cancellable,
@ -93,7 +93,7 @@ rpmostree_ex_builtin_commit2jigdo (int argc,
g_autoptr(OstreeRepo) pkgcache_repo = ostree_repo_open_at (AT_FDCWD, opt_pkgcache_repo, cancellable, error);
if (!pkgcache_repo)
return FALSE;
if (!rpmostree_commit2jigdo (repo, pkgcache_repo, rev, oirpm_spec, outputdir,
if (!rpmostree_commit2rojig (repo, pkgcache_repo, rev, oirpm_spec, outputdir,
cancellable, error))
return FALSE;

View File

@ -46,7 +46,7 @@ static char *opt_releasever;
static char **opt_enable_rpmmdrepo;
static char *opt_oirpm_version;
static GOptionEntry jigdo2commit_option_entries[] = {
static GOptionEntry rojig2commit_option_entries[] = {
{ "repo", 0, 0, G_OPTION_ARG_STRING, &opt_repo, "OSTree repo", "REPO" },
{ "rpmmd-reposd", 'd', 0, G_OPTION_ARG_STRING, &opt_rpmmd_reposdir, "Path to yum.repos.d (rpmmd) config directory", "PATH" },
{ "enablerepo", 'e', 0, G_OPTION_ARG_STRING_ARRAY, &opt_enable_rpmmdrepo, "Enable rpm-md repo with id ID", "ID" },
@ -102,7 +102,7 @@ rpm_ostree_jigdo2commit_context_new (RpmOstreeJigdo2CommitContext **out_context,
}
static gboolean
impl_jigdo2commit (RpmOstreeJigdo2CommitContext *self,
impl_rojig2commit (RpmOstreeJigdo2CommitContext *self,
const char *jigdo_id,
GCancellable *cancellable,
GError **error)
@ -135,7 +135,7 @@ impl_jigdo2commit (RpmOstreeJigdo2CommitContext *self,
}
int
rpmostree_ex_builtin_jigdo2commit (int argc,
rpmostree_ex_builtin_rojig2commit (int argc,
char **argv,
RpmOstreeCommandInvocation *invocation,
GCancellable *cancellable,
@ -143,7 +143,7 @@ rpmostree_ex_builtin_jigdo2commit (int argc,
{
g_autoptr(GOptionContext) context = g_option_context_new ("REPOID:OIRPM-NAME");
if (!rpmostree_option_context_parse (context,
jigdo2commit_option_entries,
rojig2commit_option_entries,
&argc, &argv,
invocation,
cancellable,
@ -168,7 +168,7 @@ rpmostree_ex_builtin_jigdo2commit (int argc,
g_autoptr(RpmOstreeJigdo2CommitContext) self = NULL;
if (!rpm_ostree_jigdo2commit_context_new (&self, cancellable, error))
return FALSE;
if (!impl_jigdo2commit (self, oirpm, cancellable, error))
if (!impl_rojig2commit (self, oirpm, cancellable, error))
return FALSE;
return TRUE;

View File

@ -34,8 +34,8 @@ BUILTINPROTO(unpack);
BUILTINPROTO(livefs);
BUILTINPROTO(override);
BUILTINPROTO(kargs);
BUILTINPROTO(commit2jigdo);
BUILTINPROTO(jigdo2commit);
BUILTINPROTO(commit2rojig);
BUILTINPROTO(rojig2commit);
#undef BUILTINPROTO

View File

@ -446,7 +446,7 @@ state_transition (RpmOstreeJigdoAssembler *self,
return TRUE;
}
/* Process new objects included in the OIRPM */
/* Process new objects included in the rojigRPM */
gboolean
rpmostree_jigdo_assembler_write_new_objects (RpmOstreeJigdoAssembler *self,
OstreeRepo *repo,

View File

@ -666,7 +666,7 @@ compare_pkgs (gconstpointer ap,
}
static gboolean
write_commit2jigdo (RpmOstreeCommit2JigdoContext *self,
write_commit2rojig (RpmOstreeCommit2JigdoContext *self,
const char *commit,
const char *oirpm_spec,
const char *outputdir,
@ -1031,14 +1031,14 @@ write_commit2jigdo (RpmOstreeCommit2JigdoContext *self,
return TRUE;
}
/* Entrypoint function for turning a commit into an OIRPM.
/* Entrypoint function for turning a commit into an rojigRPM.
*
* The basic prerequisite for this: when doing a compose tree, import the
* packages, and after import check out the final tree and SELinux relabel the
* imports so that they're reliably updated (currently depends on some unified
* core 🌐 work).
*
* First, we find the "jigdo set" of packages we need; not all packages that
* First, we find the "rojig set" of packages we need; not all packages that
* live in the tree actually need to be imported; things like `emacs-filesystem`
* or `rootfiles` today don't actually generate any content objects we use.
*
@ -1056,15 +1056,15 @@ write_commit2jigdo (RpmOstreeCommit2JigdoContext *self,
*
* Once we've determined all the needed data, we make a temporary directory, and
* start writing out files inside it. This temporary directory is then turned
* into the OIRPM (what looks like a plain old RPM) by invoking `rpmbuild` using
* into the rojigRPM (what looks like a plain old RPM) by invoking `rpmbuild` using
* a `.spec` file.
*
* The resulting "jigdo set" is then that OIRPM, plus the exact NEVRAs - we also
* The resulting "rojig set" is then that rojigRPM, plus the exact NEVRAs - we also
* record the repodata checksum (normally sha256), to ensure that we get the
* *exact* RPMs we require bit-for-bit.
*/
static gboolean
impl_commit2jigdo (RpmOstreeCommit2JigdoContext *self,
impl_commit2rojig (RpmOstreeCommit2JigdoContext *self,
const char *rev,
const char *oirpm_spec,
const char *outputdir,
@ -1267,7 +1267,7 @@ impl_commit2jigdo (RpmOstreeCommit2JigdoContext *self,
}
/* Hardcode FALSE for opt_only_contentdir for now */
if (!write_commit2jigdo (self, commit, oirpm_spec, outputdir, FALSE, pkglist,
if (!write_commit2rojig (self, commit, oirpm_spec, outputdir, FALSE, pkglist,
new_reachable_small, new_big_content_identical,
cancellable, error))
return FALSE;
@ -1275,9 +1275,9 @@ impl_commit2jigdo (RpmOstreeCommit2JigdoContext *self,
return TRUE;
}
/* See comment for impl_commit2jigdo() */
/* See comment for impl_commit2rojig() */
gboolean
rpmostree_commit2jigdo (OstreeRepo *repo,
rpmostree_commit2rojig (OstreeRepo *repo,
OstreeRepo *pkgcache_repo,
const char *commit,
const char *spec,
@ -1295,5 +1295,5 @@ rpmostree_commit2jigdo (OstreeRepo *repo,
(GDestroyNotify)g_free,(GDestroyNotify)pkg_objid_free);
self->objsize_to_object = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)g_free);
return impl_commit2jigdo (self, commit, spec, outputdir, cancellable, error);
return impl_commit2rojig (self, commit, spec, outputdir, cancellable, error);
}

View File

@ -24,7 +24,7 @@
#include "rpmostree-jigdo-core.h"
gboolean
rpmostree_commit2jigdo (OstreeRepo *repo,
rpmostree_commit2rojig (OstreeRepo *repo,
OstreeRepo *pkgcache_repo,
const char *commit,
const char *spec,

View File

@ -1,5 +1,5 @@
#!/bin/bash
# Test rpm-ostree compose tree --ex-jigdo-output-rpm
# Test rpm-ostree compose tree --ex-rojig-output-rpm
set -xeuo pipefail
@ -8,10 +8,10 @@ dn=$(cd $(dirname $0) && pwd)
. ${dn}/../common/libtest.sh
prepare_compose_test "compose2jigdo"
pysetjsonmember "ex-jigdo-spec" '"fedora-atomic-host-oirpm.spec"'
pysetjsonmember "ex-rojig-spec" '"fedora-atomic-host-oirpm.spec"'
mkdir cache
mkdir jigdo-output
runcompose --ex-jigdo-output-rpm $(pwd)/jigdo-output --cachedir $(pwd)/cache --add-metadata-string version=42.0
runcompose --ex-rojig-output-rpm $(pwd)/jigdo-output --cachedir $(pwd)/cache --add-metadata-string version=42.0
rev=$(ostree --repo=repo-build rev-parse ${treeref})
find jigdo-output -name '*.rpm' | tee rpms.txt
assert_file_has_content rpms.txt 'fedora-atomic-host-42.0.*x86_64'
@ -21,7 +21,7 @@ done
assert_file_has_content_literal provides.txt "rpmostree-jigdo-commit(${rev})"
echo "ok compose2jigdoRPM"
runcompose --force-nocache --ex-jigdo-output-set $(pwd)/jigdo-output --cachedir $(pwd)/cache --add-metadata-string version=42.1
runcompose --force-nocache --ex-rojig-output-set $(pwd)/jigdo-output --cachedir $(pwd)/cache --add-metadata-string version=42.1
rev=$(ostree --repo=repo-build rev-parse ${treeref})
find jigdo-output -name '*.rpm' | tee rpms.txt
assert_file_has_content rpms.txt 'systemd.*x86_64'

View File

@ -30,7 +30,7 @@ rev=$(ostree --repo=${repobuild} rev-parse ${treeref})
mkdir jigdo-output
do_commit2jigdo() {
targetrev=$1
rpm-ostree ex commit2jigdo --repo=repo-build --pkgcache-repo cache/pkgcache-repo ${targetrev} $(pwd)/composedata/fedora-atomic-host-oirpm.spec $(pwd)/jigdo-output
rpm-ostree ex commit2rojig --repo=repo-build --pkgcache-repo cache/pkgcache-repo ${targetrev} $(pwd)/composedata/fedora-atomic-host-oirpm.spec $(pwd)/jigdo-output
(cd jigdo-output && createrepo_c .)
}
do_commit2jigdo ${rev}
@ -46,10 +46,10 @@ baseurl=file://$(pwd)/jigdo-output
enabled=1
gpgcheck=0
eof
do_jigdo2commit() {
rpm-ostree ex jigdo2commit -d $(pwd)/composedata -e fedora-local -e test-repo -e jigdo-test --repo=jigdo-unpack-repo jigdo-test:fedora-atomic-host | tee jigdo2commit-out.txt
do_rojig2commit() {
rpm-ostree ex rojig2commit -d $(pwd)/composedata -e fedora-local -e test-repo -e jigdo-test --repo=jigdo-unpack-repo jigdo-test:fedora-atomic-host | tee jigdo2commit-out.txt
}
do_jigdo2commit
do_rojig2commit
# there will generally be pkgs not in the jigdo set, but let's at least assert it's > 0
assert_file_has_content jigdo2commit-out.txt ${npkgs}/${npkgs}' packages to import'
ostree --repo=jigdo-unpack-repo rev-parse ${rev}
@ -87,7 +87,7 @@ assert_file_has_content requires.txt 'systemd(.*) = '
assert_file_has_content requires.txt 'test-pkg(.*) = 1.0-1'
# And pull it; we should download the newer version by default
do_jigdo2commit
do_rojig2commit
# Now we should only download 2 packages
assert_file_has_content jigdo2commit-out.txt '2/[1-9][0-9]* packages to import'
for x in ${origrev} ${newrev}; do
@ -109,7 +109,7 @@ newrev=$(ostree --repo=${repobuild} rev-parse ${treeref})
do_commit2jigdo ${newrev}
find jigdo-output -name '*.rpm' | tee rpms.txt
assert_file_has_content rpms.txt 'fedora-atomic-host-42.2.*x86_64'
do_jigdo2commit
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