[ostree/wip/libsysroot: 7/9] sysroot: Move ostree_sysroot_origin_new_from_refspec here
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree/wip/libsysroot: 7/9] sysroot: Move ostree_sysroot_origin_new_from_refspec here
- Date: Thu, 3 Oct 2013 23:25:02 +0000 (UTC)
commit cb251ae5cac29df7a3d154dc4f4e34570d46cccc
Author: Colin Walters <walters verbum org>
Date: Thu Oct 3 18:32:41 2013 -0400
sysroot: Move ostree_sysroot_origin_new_from_refspec here
Rather than having it live in admin. This is useful for other
consumers like the test suite.
src/libostree/ostree-sysroot.c | 15 +++++++++++++++
src/libostree/ostree-sysroot.h | 4 ++++
src/ostree/ot-admin-builtin-deploy.c | 2 +-
src/ostree/ot-admin-functions.c | 8 --------
src/ostree/ot-admin-functions.h | 2 --
5 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c
index 4839118..f61324a 100644
--- a/src/libostree/ostree-sysroot.c
+++ b/src/libostree/ostree-sysroot.c
@@ -1095,3 +1095,18 @@ ostree_sysroot_get_merge_deployment (OstreeSysroot *self,
return NULL;
}
+/**
+ * ostree_sysroot_origin_new_from_refspec:
+ * @refspec: A refspec
+ *
+ * Returns: (transfer full): A new config file which sets @refspec as an origin
+ */
+GKeyFile *
+ostree_sysroot_origin_new_from_refspec (OstreeSysroot *sysroot,
+ const char *refspec)
+{
+ GKeyFile *ret = g_key_file_new ();
+ g_key_file_set_string (ret, "origin", "refspec", refspec);
+ return ret;
+}
+
diff --git a/src/libostree/ostree-sysroot.h b/src/libostree/ostree-sysroot.h
index a61f491..5bed119 100644
--- a/src/libostree/ostree-sysroot.h
+++ b/src/libostree/ostree-sysroot.h
@@ -84,5 +84,9 @@ gboolean ostree_sysroot_deploy_one_tree (OstreeSysroot *self,
OstreeDeployment *ostree_sysroot_get_merge_deployment (OstreeSysroot *self,
const char *osname);
+
+GKeyFile *ostree_sysroot_origin_new_from_refspec (OstreeSysroot *self,
+ const char *refspec);
+
G_END_DECLS
diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c
index 5e94e90..54e3485 100644
--- a/src/ostree/ot-admin-builtin-deploy.c
+++ b/src/ostree/ot-admin-builtin-deploy.c
@@ -97,7 +97,7 @@ ot_admin_builtin_deploy (int argc, char **argv, OstreeSysroot *sysroot, GCancell
}
else
{
- origin = ot_origin_new_from_refspec (refspec);
+ origin = ostree_sysroot_origin_new_from_refspec (sysroot, refspec);
}
if (!ostree_repo_resolve_rev (repo, refspec, FALSE, &revision, error))
diff --git a/src/ostree/ot-admin-functions.c b/src/ostree/ot-admin-functions.c
index 3ca7508..fe5c3f9 100644
--- a/src/ostree/ot-admin-functions.c
+++ b/src/ostree/ot-admin-functions.c
@@ -27,14 +27,6 @@
#include "ostree.h"
#include "libgsystem.h"
-GKeyFile *
-ot_origin_new_from_refspec (const char *refspec)
-{
- GKeyFile *ret = g_key_file_new ();
- g_key_file_set_string (ret, "origin", "refspec", refspec);
- return ret;
-}
-
gboolean
ot_admin_require_booted_deployment_or_osname (OstreeSysroot *sysroot,
const char *osname,
diff --git a/src/ostree/ot-admin-functions.h b/src/ostree/ot-admin-functions.h
index e0a824d..1b26948 100644
--- a/src/ostree/ot-admin-functions.h
+++ b/src/ostree/ot-admin-functions.h
@@ -27,8 +27,6 @@
G_BEGIN_DECLS
-GKeyFile *ot_origin_new_from_refspec (const char *refspec);
-
gboolean
ot_admin_require_booted_deployment_or_osname (OstreeSysroot *sysroot,
const char *osname,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]