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.
This commit is contained in:
parent
ae2234b183
commit
cb251ae5ca
|
|
@ -1095,3 +1095,18 @@ ostree_sysroot_get_merge_deployment (OstreeSysroot *self,
|
||||||
return NULL;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,5 +84,9 @@ gboolean ostree_sysroot_deploy_one_tree (OstreeSysroot *self,
|
||||||
OstreeDeployment *ostree_sysroot_get_merge_deployment (OstreeSysroot *self,
|
OstreeDeployment *ostree_sysroot_get_merge_deployment (OstreeSysroot *self,
|
||||||
const char *osname);
|
const char *osname);
|
||||||
|
|
||||||
|
|
||||||
|
GKeyFile *ostree_sysroot_origin_new_from_refspec (OstreeSysroot *self,
|
||||||
|
const char *refspec);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ ot_admin_builtin_deploy (int argc, char **argv, OstreeSysroot *sysroot, GCancell
|
||||||
}
|
}
|
||||||
else
|
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))
|
if (!ostree_repo_resolve_rev (repo, refspec, FALSE, &revision, error))
|
||||||
|
|
|
||||||
|
|
@ -27,14 +27,6 @@
|
||||||
#include "ostree.h"
|
#include "ostree.h"
|
||||||
#include "libgsystem.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
|
gboolean
|
||||||
ot_admin_require_booted_deployment_or_osname (OstreeSysroot *sysroot,
|
ot_admin_require_booted_deployment_or_osname (OstreeSysroot *sysroot,
|
||||||
const char *osname,
|
const char *osname,
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,6 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
GKeyFile *ot_origin_new_from_refspec (const char *refspec);
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
ot_admin_require_booted_deployment_or_osname (OstreeSysroot *sysroot,
|
ot_admin_require_booted_deployment_or_osname (OstreeSysroot *sysroot,
|
||||||
const char *osname,
|
const char *osname,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue