mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-08 08:58:46 +03:00
core: Take --repo as the first argument
I kept doing this over and over...it feels more natural. The "prefix" thing was (almost) unused anyways, and it was easy enough to replace.
This commit is contained in:
parent
3b61a21c0f
commit
d6b3fb5118
@ -55,7 +55,7 @@ usage (char **argv, gboolean is_error)
|
||||
else
|
||||
print_func = g_print;
|
||||
|
||||
print_func ("usage: %s COMMAND [options]\n",
|
||||
print_func ("usage: %s --repo=PATH COMMAND [options]\n",
|
||||
argv[0]);
|
||||
print_func ("Builtin commands:\n");
|
||||
|
||||
@ -74,6 +74,7 @@ main (int argc,
|
||||
{
|
||||
OstreeBuiltin *builtin;
|
||||
const char *cmd;
|
||||
const char *repo;
|
||||
|
||||
g_type_init ();
|
||||
|
||||
@ -81,10 +82,14 @@ main (int argc,
|
||||
|
||||
builtin = builtins;
|
||||
|
||||
if (argc < 2)
|
||||
if (argc < 3)
|
||||
return usage (argv, 1);
|
||||
|
||||
cmd = argv[1];
|
||||
if (!g_str_has_prefix (argv[1], "--repo="))
|
||||
return usage (argv, 1);
|
||||
repo = argv[1] + strlen ("--repo=");
|
||||
|
||||
cmd = argv[2];
|
||||
|
||||
while (builtin->name)
|
||||
{
|
||||
@ -95,13 +100,13 @@ main (int argc,
|
||||
int tmp_argc;
|
||||
char **tmp_argv;
|
||||
|
||||
tmp_argc = argc - 1;
|
||||
tmp_argc = argc - 2;
|
||||
tmp_argv = g_new0 (char *, tmp_argc + 1);
|
||||
|
||||
tmp_argv[0] = (char*)builtin->name;
|
||||
for (i = 0; i < tmp_argc; i++)
|
||||
tmp_argv[i+1] = argv[i+2];
|
||||
if (!builtin->fn (tmp_argc, tmp_argv, NULL, &error))
|
||||
tmp_argv[i+1] = argv[i+3];
|
||||
if (!builtin->fn (tmp_argc, tmp_argv, repo, &error))
|
||||
{
|
||||
g_free (tmp_argv);
|
||||
g_printerr ("%s\n", error->message);
|
||||
|
@ -26,15 +26,12 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
gboolean
|
||||
ostree_builtin_checkout (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_checkout (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -51,9 +48,6 @@ ostree_builtin_checkout (int argc, char **argv, const char *prefix, GError **err
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
static gboolean separator_null;
|
||||
static int from_fd = -1;
|
||||
static gboolean from_stdin;
|
||||
@ -39,7 +38,6 @@ static char **additions;
|
||||
static char **removals;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ "subject", 's', 0, G_OPTION_ARG_STRING, &subject, "One line subject", "subject" },
|
||||
{ "body", 'm', 0, G_OPTION_ARG_STRING, &body, "Full description", "body" },
|
||||
{ "branch", 'b', 0, G_OPTION_ARG_STRING, &branch, "Branch", "branch" },
|
||||
@ -54,11 +52,12 @@ static GOptionEntry options[] = {
|
||||
};
|
||||
|
||||
gboolean
|
||||
ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_commit (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
OstreeRepo *repo = NULL;
|
||||
char *cwd;
|
||||
gboolean using_filename_cmdline;
|
||||
gboolean using_filedescriptors;
|
||||
GPtrArray *additions_array = NULL;
|
||||
@ -66,17 +65,14 @@ ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error
|
||||
GChecksum *commit_checksum = NULL;
|
||||
char **iter;
|
||||
|
||||
cwd = g_get_current_dir ();
|
||||
|
||||
context = g_option_context_new ("- Commit a new revision");
|
||||
g_option_context_add_main_entries (context, options, NULL);
|
||||
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
if (prefix == NULL)
|
||||
prefix = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
@ -125,7 +121,7 @@ ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error
|
||||
g_ptr_array_add (removals_array, *iter);
|
||||
|
||||
if (!ostree_repo_commit (repo, branch, parent, subject, body, NULL,
|
||||
prefix, additions_array,
|
||||
cwd, additions_array,
|
||||
removals_array,
|
||||
&commit_checksum,
|
||||
error))
|
||||
@ -149,7 +145,7 @@ ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error
|
||||
from_fd = temp_fd;
|
||||
}
|
||||
if (!ostree_repo_commit_from_filelist_fd (repo, branch, parent, subject, body, NULL,
|
||||
prefix, from_fd, separator,
|
||||
cwd, from_fd, separator,
|
||||
&commit_checksum, error))
|
||||
{
|
||||
if (temp_fd >= 0)
|
||||
@ -163,6 +159,7 @@ ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error
|
||||
ret = TRUE;
|
||||
g_print ("%s\n", g_checksum_get_string (commit_checksum));
|
||||
out:
|
||||
g_free (cwd);
|
||||
if (context)
|
||||
g_option_context_free (context);
|
||||
g_clear_object (&repo);
|
||||
|
@ -26,12 +26,9 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
|
||||
#define FAST_QUERYINFO "standard::name,standard::type,standard::is-symlink,standard::symlink-target,unix::*"
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -214,7 +211,7 @@ compose_branch_on_dir (OstreeRepo *repo,
|
||||
}
|
||||
|
||||
gboolean
|
||||
ostree_builtin_compose (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_compose (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -230,9 +227,6 @@ ostree_builtin_compose (int argc, char **argv, const char *prefix, GError **erro
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
|
@ -26,11 +26,9 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
static gboolean quiet;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", NULL },
|
||||
{ "quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet, "Don't display informational messages", NULL },
|
||||
{ NULL }
|
||||
};
|
||||
@ -192,7 +190,7 @@ object_iter_callback (OstreeRepo *repo,
|
||||
}
|
||||
|
||||
gboolean
|
||||
ostree_builtin_fsck (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_fsck (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
HtFsckData data;
|
||||
@ -205,9 +203,6 @@ ostree_builtin_fsck (int argc, char **argv, const char *prefix, GError **error)
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
data.n_objects = 0;
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
|
@ -26,11 +26,9 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
static gboolean archive;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", NULL },
|
||||
{ "archive", 0, 0, G_OPTION_ARG_NONE, &archive, "Initialize repository as archive", NULL },
|
||||
{ NULL }
|
||||
};
|
||||
@ -40,7 +38,7 @@ static GOptionEntry options[] = {
|
||||
|
||||
|
||||
gboolean
|
||||
ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_init (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context = NULL;
|
||||
gboolean ret = FALSE;
|
||||
@ -55,9 +53,6 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repodir = ot_util_new_file_for_path (repo_path);
|
||||
|
||||
child = g_file_get_child (repodir, "config");
|
||||
|
@ -26,19 +26,17 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
static gboolean ignore_exists;
|
||||
static gboolean force;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ "ignore-exists", 'n', 0, G_OPTION_ARG_NONE, &ignore_exists, "Don't error if file exists", NULL },
|
||||
{ "force", 'f', 0, G_OPTION_ARG_NONE, &force, "If object exists, relink file", NULL },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
gboolean
|
||||
ostree_builtin_link_file (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_link_file (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -51,9 +49,6 @@ ostree_builtin_link_file (int argc, char **argv, const char *prefix, GError **er
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
|
@ -26,15 +26,12 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
gboolean
|
||||
ostree_builtin_log (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_log (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -50,11 +47,6 @@ ostree_builtin_log (int argc, char **argv, const char *prefix, GError **error)
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
if (prefix == NULL)
|
||||
prefix = ".";
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
|
@ -28,10 +28,7 @@
|
||||
|
||||
#include <libsoup/soup-gnome.h>
|
||||
|
||||
static char *repo_path;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -252,7 +249,7 @@ store_commit_recurse (OstreeRepo *repo,
|
||||
}
|
||||
|
||||
gboolean
|
||||
ostree_builtin_pull (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_pull (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -276,9 +273,6 @@ ostree_builtin_pull (int argc, char **argv, const char *prefix, GError **error)
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
|
@ -26,10 +26,7 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -44,7 +41,7 @@ usage_error (GOptionContext *context, const char *message, GError **error)
|
||||
}
|
||||
|
||||
gboolean
|
||||
ostree_builtin_remote (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_remote (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -59,9 +56,6 @@ ostree_builtin_remote (int argc, char **argv, const char *prefix, GError **error
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
|
@ -29,12 +29,11 @@
|
||||
static char *repo_path;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
gboolean
|
||||
ostree_builtin_rev_parse (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_rev_parse (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -50,9 +49,6 @@ ostree_builtin_rev_parse (int argc, char **argv, const char *prefix, GError **er
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
|
@ -26,17 +26,15 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
static gboolean quiet;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ "quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet, "Don't display informational messages", NULL },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
gboolean
|
||||
ostree_builtin_run_triggers (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_run_triggers (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -50,9 +48,6 @@ ostree_builtin_run_triggers (int argc, char **argv, const char *prefix, GError *
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
|
@ -26,15 +26,12 @@
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
static char *repo_path;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
gboolean
|
||||
ostree_builtin_show (int argc, char **argv, const char *prefix, GError **error)
|
||||
ostree_builtin_show (int argc, char **argv, const char *repo_path, GError **error)
|
||||
{
|
||||
GOptionContext *context;
|
||||
gboolean ret = FALSE;
|
||||
@ -51,9 +48,6 @@ ostree_builtin_show (int argc, char **argv, const char *prefix, GError **error)
|
||||
if (!g_option_context_parse (context, &argc, &argv, error))
|
||||
goto out;
|
||||
|
||||
if (repo_path == NULL)
|
||||
repo_path = ".";
|
||||
|
||||
repo = ostree_repo_new (repo_path);
|
||||
if (!ostree_repo_check (repo, error))
|
||||
goto out;
|
||||
|
@ -32,22 +32,22 @@ typedef enum {
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
gboolean (*fn) (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean (*fn) (int argc, char **argv, const char *repo, GError **error);
|
||||
int flags; /* OstreeBuiltinFlags */
|
||||
} OstreeBuiltin;
|
||||
|
||||
gboolean ostree_builtin_checkout (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_compose (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_log (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_link_file (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_pull (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_run_triggers (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_fsck (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_show (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_rev_parse (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_remote (int argc, char **argv, const char *prefix, GError **error);
|
||||
gboolean ostree_builtin_checkout (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_commit (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_compose (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_init (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_log (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_link_file (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_pull (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_run_triggers (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_fsck (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_show (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_rev_parse (int argc, char **argv, const char *repo, GError **error);
|
||||
gboolean ostree_builtin_remote (int argc, char **argv, const char *repo, GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -80,16 +80,16 @@ setup_test_repository () {
|
||||
mkdir repo
|
||||
cd repo
|
||||
ot_repo="--repo=`pwd`"
|
||||
export OSTREE="ostree ${ot_repo}"
|
||||
cd ../files
|
||||
export ot_repo
|
||||
if test "$mode" = "archive"; then
|
||||
ostree init --archive $ot_repo
|
||||
$OSTREE init --archive
|
||||
else
|
||||
ostree init $ot_repo
|
||||
$OSTREE init
|
||||
fi
|
||||
ostree commit $ot_repo -b test2 -s "Test Commit 1" -m "Commit body first" --add=firstfile --add=somelink
|
||||
ostree commit $ot_repo -b test2 -s "Test Commit 2" -m "Commit body second" --add=baz/cow --add=baz/saucer --add=baz/deeper/ohyeah --add=baz/another/y --add=baz/alink
|
||||
ostree fsck -q $ot_repo
|
||||
$OSTREE commit -b test2 -s "Test Commit 1" -m "Commit body first" --add=firstfile --add=somelink
|
||||
$OSTREE commit -b test2 -s "Test Commit 2" -m "Commit body second" --add=baz/cow --add=baz/saucer --add=baz/deeper/ohyeah --add=baz/another/y --add=baz/alink
|
||||
$OSTREE fsck -q
|
||||
|
||||
cd $oldpwd
|
||||
}
|
||||
@ -99,20 +99,20 @@ setup_fake_remote_repo1() {
|
||||
mkdir ostree-srv
|
||||
cd ostree-srv
|
||||
mkdir gnomerepo
|
||||
ostree init --archive --repo=gnomerepo
|
||||
ostree --repo=gnomerepo init --archive
|
||||
mkdir gnomerepo-files
|
||||
cd gnomerepo-files
|
||||
echo first > firstfile
|
||||
mkdir baz
|
||||
echo moo > baz/cow
|
||||
echo alien > baz/saucer
|
||||
find | grep -v '^\.$' | ostree commit --repo=${test_tmpdir}/ostree-srv/gnomerepo -b main -s "A remote commit" -m "Some Commit body" --from-stdin
|
||||
find | grep -v '^\.$' | ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "A remote commit" -m "Some Commit body" --from-stdin
|
||||
mkdir baz/deeper
|
||||
ostree commit --repo=${test_tmpdir}/ostree-srv/gnomerepo -b main -s "Add deeper" --add=baz/deeper
|
||||
ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "Add deeper" --add=baz/deeper
|
||||
echo hi > baz/deeper/ohyeah
|
||||
mkdir baz/another/
|
||||
echo x > baz/another/y
|
||||
find | grep -v '^\.$' | ostree commit --repo=${test_tmpdir}/ostree-srv/gnomerepo -b main -s "The rest" --from-stdin
|
||||
find | grep -v '^\.$' | ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "The rest" --from-stdin
|
||||
cd ..
|
||||
rm -rf gnomerepo-files
|
||||
|
||||
@ -150,6 +150,8 @@ EOF
|
||||
exit 1
|
||||
fi
|
||||
cd ${oldpwd}
|
||||
|
||||
export OSTREE="ostree --repo=repo"
|
||||
}
|
||||
|
||||
trap 'die' EXIT
|
||||
|
@ -32,12 +32,12 @@ assert_streq "$(readlink ${test_tmpdir}/repo/objects/cf/443bea5eb400bc25b376c079
|
||||
|
||||
echo "ok check"
|
||||
|
||||
ostree checkout $ot_repo test2 checkout-test2
|
||||
$OSTREE checkout test2 checkout-test2
|
||||
echo "ok checkout"
|
||||
|
||||
ostree rev-parse $ot_repo test2
|
||||
ostree rev-parse $ot_repo 'test2^'
|
||||
ostree rev-parse $ot_repo 'test2^^' 2>/dev/null && (echo 1>&2 "rev-parse test2^^ unexpectedly succeeded!"; exit 1)
|
||||
$OSTREE rev-parse test2
|
||||
$OSTREE rev-parse 'test2^'
|
||||
$OSTREE rev-parse 'test2^^' 2>/dev/null && (echo 1>&2 "rev-parse test2^^ unexpectedly succeeded!"; exit 1)
|
||||
echo "ok rev-parse"
|
||||
|
||||
cd checkout-test2
|
||||
@ -47,10 +47,10 @@ assert_file_has_content baz/cow moo
|
||||
assert_has_file baz/deeper/ohyeah
|
||||
echo "ok content"
|
||||
|
||||
ostree commit $ot_repo -b test2 -s delete -r firstfile
|
||||
$OSTREE commit -b test2 -s delete -r firstfile
|
||||
assert_has_file firstfile # It should still exist in this checkout
|
||||
cd $test_tmpdir
|
||||
ostree checkout $ot_repo test2 $test_tmpdir/checkout-test2-2
|
||||
$OSTREE checkout test2 $test_tmpdir/checkout-test2-2
|
||||
cd $test_tmpdir/checkout-test2-2
|
||||
assert_not_has_file firstfile
|
||||
assert_has_file baz/saucer
|
||||
@ -68,11 +68,11 @@ mkdir -p another/nested/tree
|
||||
echo anotherone > another/nested/tree/1
|
||||
echo whee2 > another/whee
|
||||
# FIXME - remove grep for .
|
||||
find | grep -v '^\.$' | ostree commit $ot_repo -b test2 -s "From find" --from-stdin
|
||||
find | grep -v '^\.$' | $OSTREE commit -b test2 -s "From find" --from-stdin
|
||||
echo "ok stdin commit"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
ostree checkout $ot_repo test2 $test_tmpdir/checkout-test2-3
|
||||
$OSTREE checkout test2 $test_tmpdir/checkout-test2-3
|
||||
cd checkout-test2-3
|
||||
assert_has_file a/nested/2
|
||||
assert_file_has_content a/nested/2 'two2'
|
||||
|
@ -27,7 +27,7 @@ echo '1..3'
|
||||
setup_test_repository "archive"
|
||||
echo "ok setup"
|
||||
|
||||
ostree checkout $ot_repo test2 checkout-test2
|
||||
$OSTREE checkout test2 checkout-test2
|
||||
echo "ok checkout"
|
||||
|
||||
cd checkout-test2
|
||||
|
@ -25,7 +25,7 @@ set -e
|
||||
echo "1..1"
|
||||
|
||||
setup_test_repository "regular"
|
||||
ostree log $ot_repo test2 > $test_tmpdir/log.txt
|
||||
$OSTREE log test2 > $test_tmpdir/log.txt
|
||||
assert_file_has_content $test_tmpdir/log.txt "Test Commit 1"
|
||||
assert_file_has_content $test_tmpdir/log.txt "Test Commit 2"
|
||||
echo "ok log"
|
||||
|
@ -25,7 +25,7 @@ set -e
|
||||
echo '1..2'
|
||||
|
||||
setup_test_repository "regular"
|
||||
ostree remote add $ot_repo origin http://example.com/ostree/gnome
|
||||
$OSTREE remote add origin http://example.com/ostree/gnome
|
||||
echo "ok remote add"
|
||||
assert_file_has_content $test_tmpdir/repo/config "example.com"
|
||||
echo "ok config"
|
||||
|
@ -27,7 +27,7 @@ echo '1..1'
|
||||
setup_fake_remote_repo1
|
||||
cd ${test_tmpdir}
|
||||
mkdir repo
|
||||
ostree init --repo=repo
|
||||
ostree remote --repo=repo add origin $(cat httpd-address)/ostree/gnomerepo
|
||||
ostree pull --repo=repo origin main
|
||||
$OSTREE init
|
||||
$OSTREE remote add origin $(cat httpd-address)/ostree/gnomerepo
|
||||
$OSTREE pull origin main
|
||||
echo "ok pull"
|
||||
|
@ -26,7 +26,7 @@ echo "1..3"
|
||||
|
||||
setup_test_repository "regular"
|
||||
|
||||
ostree checkout $ot_repo test2 checkout-test2
|
||||
$OSTREE checkout test2 checkout-test2
|
||||
|
||||
cd "${test_tmpdir}"
|
||||
mkdir artifact-libfoo-runtime
|
||||
@ -36,7 +36,7 @@ echo 'an ELF file' > usr/lib/libfoo.so
|
||||
mkdir -p usr/share
|
||||
echo 'some data' > usr/share/foo.data
|
||||
|
||||
find | grep -v '^\.$' | ostree commit $ot_repo -b artifact-libfoo-runtime -s 'Build 12345 of libfoo' --from-stdin
|
||||
find | grep -v '^\.$' | $OSTREE commit -b artifact-libfoo-runtime -s 'Build 12345 of libfoo' --from-stdin
|
||||
|
||||
cd "${test_tmpdir}"
|
||||
mkdir artifact-libfoo-devel
|
||||
@ -46,7 +46,7 @@ echo 'a header' > usr/include/foo.h
|
||||
mkdir -p usr/share/doc
|
||||
echo 'some documentation' > usr/share/doc/foo.txt
|
||||
|
||||
find | grep -v '^\.$' | ostree commit $ot_repo -b artifact-libfoo-devel -s 'Build 12345 of libfoo' --from-stdin
|
||||
find | grep -v '^\.$' | $OSTREE commit -b artifact-libfoo-devel -s 'Build 12345 of libfoo' --from-stdin
|
||||
|
||||
cd "${test_tmpdir}"
|
||||
mkdir artifact-barapp
|
||||
@ -54,12 +54,12 @@ cd artifact-barapp
|
||||
mkdir -p usr/bin
|
||||
echo 'another ELF file' > usr/bin/bar
|
||||
|
||||
find | grep -v '^\.$' | ostree commit $ot_repo -b artifact-barapp -s 'Build 42 of barapp' --from-stdin
|
||||
find | grep -v '^\.$' | $OSTREE commit -b artifact-barapp -s 'Build 42 of barapp' --from-stdin
|
||||
|
||||
echo 'ok artifacts committed'
|
||||
|
||||
cd "${test_tmpdir}"
|
||||
ostree compose $ot_repo some-compose artifact-libfoo-runtime artifact-libfoo-devel artifact-barapp
|
||||
$OSTREE compose some-compose artifact-libfoo-runtime artifact-libfoo-devel artifact-barapp
|
||||
echo 'ok compose command'
|
||||
|
||||
cd some-compose
|
||||
|
Loading…
x
Reference in New Issue
Block a user