2016-02-09 18:38:38 +03:00
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright ( C ) 2015 Colin Walters < walters @ verbum . org >
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; either version 2 of the licence or ( at
* your option ) any later version .
*
* This library 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
* Lesser General Public License for more details .
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library ; if not , write to the
* Free Software Foundation , Inc . , 59 Temple Place , Suite 330 ,
* Boston , MA 02111 - 1307 , USA .
*/
# pragma once
# include <gio/gio.h>
# include <libhif.h>
# include <libhif/hif-utils.h>
# include <libhif/hif-package.h>
# include <ostree.h>
# include "libglnx.h"
2016-02-09 21:13:28 +03:00
# define RPMOSTREE_TYPE_CONTEXT (rpmostree_context_get_type ())
G_DECLARE_FINAL_TYPE ( RpmOstreeContext , rpmostree_context , RPMOSTREE , CONTEXT , GObject )
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
# define RPMOSTREE_TYPE_INSTALL (rpmostree_install_get_type ())
G_DECLARE_FINAL_TYPE ( RpmOstreeInstall , rpmostree_install , RPMOSTREE , INSTALL , GObject )
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
RpmOstreeContext * rpmostree_context_new_system ( GCancellable * cancellable ,
GError * * error ) ;
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
RpmOstreeContext * rpmostree_context_new_unprivileged ( int basedir_dfd ,
GCancellable * cancellable ,
GError * * error ) ;
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
HifContext * rpmostree_context_get_hif ( RpmOstreeContext * self ) ;
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
gboolean
rpmostree_context_repos_enable_only ( RpmOstreeContext * context ,
const char * const * enabled_repos ,
GError * * error ) ;
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
gboolean rpmostree_context_setup ( RpmOstreeContext * self ,
const char * install_root ,
2016-02-09 18:38:38 +03:00
GCancellable * cancellable ,
2016-02-09 21:13:28 +03:00
GError * * error ) ;
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
void rpmostree_hif_add_checksum_goal ( GChecksum * checksum , HyGoal goal ) ;
char * rpmostree_hif_checksum_goal ( GChecksumType type , HyGoal goal ) ;
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
char * rpmostree_get_cache_branch_header ( Header hdr ) ;
char * rpmostree_get_cache_branch_pkg ( HifPackage * pkg ) ;
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
gboolean rpmostree_context_download_metadata ( RpmOstreeContext * context ,
GCancellable * cancellable ,
GError * * error ) ;
2016-02-09 18:38:38 +03:00
/* This API allocates an install context, use with one of the later ones */
2016-02-09 21:13:28 +03:00
gboolean rpmostree_context_prepare_install ( RpmOstreeContext * self ,
2016-02-09 21:23:31 +03:00
const char * const * packages ,
RpmOstreeInstall * * out_install ,
GCancellable * cancellable ,
GError * * error ) ;
2016-02-09 21:13:28 +03:00
gboolean rpmostree_context_download_rpms ( RpmOstreeContext * self ,
2016-02-09 21:23:31 +03:00
int target_dfd ,
RpmOstreeInstall * install ,
GCancellable * cancellable ,
GError * * error ) ;
2016-02-09 18:38:38 +03:00
2016-02-09 21:13:28 +03:00
gboolean rpmostree_context_download_import ( RpmOstreeContext * self ,
RpmOstreeInstall * install ,
2016-02-09 18:38:38 +03:00
GCancellable * cancellable ,
GError * * error ) ;
2016-02-09 21:13:28 +03:00
gboolean rpmostree_context_assemble_commit ( RpmOstreeContext * self ,
2016-02-09 21:23:31 +03:00
int tmpdir_dfd ,
const char * name ,
RpmOstreeInstall * install ,
char * * out_commit ,
GCancellable * cancellable ,
GError * * error ) ;