rpm-ostree/src/daemon/rpmostreed-utils.h
Jonathan Lebon 0b6721a10a deploy: make sure commits are on the current branch
A funky behaviour of `rpm-ostree deploy` was that specifying a csum
directly allowed you to jump to any commit, regardless of whether that
commit exists on the current branch or not. We tighten that up here so
that we check that the checksum does exist on the current branch.

The previous behaviour can be useful of course, but we might want to
change how users access it so that we don't get inconsistencies such as
rpm-ostree status saying that we're sitting on a specific branch with a
specific commit which doesn't actually belong to that branch.

Closes: #495
Approved by: cgwalters
2016-10-20 14:06:58 +00:00

85 lines
4.3 KiB
C

/*
* Copyright (C) 2015 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#pragma once
#include <ostree.h>
#include "rpmostreed-types.h"
gchar * rpmostreed_generate_object_path (const gchar *base,
const gchar *part,
...);
gchar * rpmostreed_generate_object_path_from_va (const gchar *base,
const gchar *part,
va_list va);
gboolean rpmostreed_refspec_parse_partial (const gchar *new_provided_refspec,
const gchar *base_refspec,
gchar **out_refspec,
GError **error);
void
rpmostreed_reboot (GCancellable *cancellable, GError **error);
/* XXX These pull-ancestry and lookup-version functions should eventually
* be integrated into libostree, but it's still a bit premature to do
* so now. Version integration in ostree needs more design work. */
typedef gboolean (*RpmostreedCommitVisitor) (OstreeRepo *repo,
const char *checksum,
GVariant *commit,
gpointer user_data,
gboolean *out_stop,
GError **error);
gboolean rpmostreed_repo_pull_ancestry (OstreeRepo *repo,
const char *refspec,
RpmostreedCommitVisitor visitor,
gpointer visitor_data,
OstreeAsyncProgress *progress,
GCancellable *cancellable,
GError **error);
gboolean rpmostreed_repo_lookup_version (OstreeRepo *repo,
const char *refspec,
const char *version,
OstreeAsyncProgress *progress,
GCancellable *cancellable,
char **out_checksum,
GError **error);
gboolean rpmostreed_repo_lookup_checksum (OstreeRepo *repo,
const char *refspec,
const char *checksum,
OstreeAsyncProgress *progress,
GCancellable *cancellable,
GError **error);
gboolean rpmostreed_repo_lookup_cached_version (OstreeRepo *repo,
const char *refspec,
const char *version,
GCancellable *cancellable,
char **out_checksum,
GError **error);
gboolean rpmostreed_parse_revision (const char *revision,
char **out_checksum,
char **out_version,
GError **error);