2015-02-11 21:06:43 +03:00
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright ( C ) 2014 Colin Walters < walters @ verbum . org >
*
* This library 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 License , 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 <ostree.h>
2017-01-11 22:05:18 +03:00
# include "rpmostree-origin.h"
2017-03-27 21:12:05 +03:00
# include "rpmostree-sysroot-core.h"
2015-02-11 21:06:43 +03:00
G_BEGIN_DECLS
2016-02-25 20:42:56 +03:00
# define RPMOSTREE_TYPE_SYSROOT_UPGRADER rpmostree_sysroot_upgrader_get_type()
2015-02-11 21:06:43 +03:00
# define RPMOSTREE_SYSROOT_UPGRADER(obj) \
( G_TYPE_CHECK_INSTANCE_CAST ( ( obj ) , RPMOSTREE_TYPE_SYSROOT_UPGRADER , RpmOstreeSysrootUpgrader ) )
# define RPMOSTREE_IS_SYSROOT_UPGRADER(obj) \
( G_TYPE_CHECK_INSTANCE_TYPE ( ( obj ) , RPMOSTREE_TYPE_SYSROOT_UPGRADER ) )
typedef struct RpmOstreeSysrootUpgrader RpmOstreeSysrootUpgrader ;
2017-05-11 23:04:23 +03:00
G_DEFINE_AUTOPTR_CLEANUP_FUNC ( RpmOstreeSysrootUpgrader , g_object_unref )
2015-02-11 21:06:43 +03:00
/**
2016-02-25 20:42:56 +03:00
* RpmOstreeSysrootUpgraderFlags :
* @ RPMOSTREE_SYSROOT_UPGRADER_FLAGS_NONE : No options
* @ RPMOSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED : Do not error if the origin has an unconfigured - state key
2016-05-20 21:21:06 +03:00
* @ RPMOSTREE_SYSROOT_UPGRADER_FLAGS_ALLOW_OLDER : Do not error if the new deployment was composed earlier than the current deployment
2017-03-31 16:07:28 +03:00
* @ RPMOSTREE_SYSROOT_UPGRADER_FLAGS_DRY_RUN : Don ' t deploy new base . If layering packages , only print the transaction
2017-10-13 16:22:15 +03:00
* @ RPMOSTREE_SYSROOT_UPGRADER_FLAGS_PKGCACHE_ONLY : Don ' t try to update cached packages .
* @ RPMOSTREE_SYSROOT_UPGRADER_FLAGS_SYNTHETIC_PULL : Don ' t actually pull , just resolve ref and timestamp check
2015-02-11 21:06:43 +03:00
*
* Flags controlling operation of an # RpmOstreeSysrootUpgrader .
*/
typedef enum {
2016-05-20 21:21:06 +03:00
RPMOSTREE_SYSROOT_UPGRADER_FLAGS_NONE = ( 1 < < 0 ) ,
RPMOSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED = ( 1 < < 1 ) ,
RPMOSTREE_SYSROOT_UPGRADER_FLAGS_ALLOW_OLDER = ( 1 < < 2 ) ,
2017-10-05 19:03:34 +03:00
RPMOSTREE_SYSROOT_UPGRADER_FLAGS_DRY_RUN = ( 1 < < 3 ) ,
2017-10-13 16:22:15 +03:00
RPMOSTREE_SYSROOT_UPGRADER_FLAGS_PKGCACHE_ONLY = ( 1 < < 4 ) ,
RPMOSTREE_SYSROOT_UPGRADER_FLAGS_SYNTHETIC_PULL = ( 1 < < 5 ) ,
2015-02-11 21:06:43 +03:00
} RpmOstreeSysrootUpgraderFlags ;
2017-08-08 16:46:37 +03:00
/* _NONE means we're doing pure ostree, no client-side computation.
* _LOCAL is just e . g . rpm - ostree initramfs
* _RPMMD_REPOS is where we ' re downloading data from / etc / yum . repos . d
*/
typedef enum {
RPMOSTREE_SYSROOT_UPGRADER_LAYERING_NONE = 0 ,
RPMOSTREE_SYSROOT_UPGRADER_LAYERING_LOCAL = 1 ,
RPMOSTREE_SYSROOT_UPGRADER_LAYERING_RPMMD_REPOS = 2 ,
} RpmOstreeSysrootUpgraderLayeringType ;
2015-02-11 21:06:43 +03:00
GType rpmostree_sysroot_upgrader_get_type ( void ) ;
GType rpmostree_sysroot_upgrader_flags_get_type ( void ) ;
RpmOstreeSysrootUpgrader * rpmostree_sysroot_upgrader_new ( OstreeSysroot * sysroot ,
const char * osname ,
RpmOstreeSysrootUpgraderFlags flags ,
GCancellable * cancellable ,
GError * * error ) ;
2016-05-20 21:21:06 +03:00
OstreeDeployment * rpmostree_sysroot_upgrader_get_merge_deployment ( RpmOstreeSysrootUpgrader * self ) ;
2015-02-11 21:06:43 +03:00
2017-02-15 20:41:38 +03:00
RpmOstreeOrigin *
rpmostree_sysroot_upgrader_dup_origin ( RpmOstreeSysrootUpgrader * self ) ;
2015-02-11 21:06:43 +03:00
2017-02-15 20:41:38 +03:00
void
rpmostree_sysroot_upgrader_set_origin ( RpmOstreeSysrootUpgrader * self ,
RpmOstreeOrigin * origin ) ;
2016-05-20 21:21:06 +03:00
2017-06-05 19:37:56 +03:00
const char *
rpmostree_sysroot_upgrader_get_base ( RpmOstreeSysrootUpgrader * self ) ;
2015-02-11 21:06:43 +03:00
gboolean
2017-08-08 16:46:37 +03:00
rpmostree_sysroot_upgrader_pull_base ( RpmOstreeSysrootUpgrader * self ,
const char * dir_to_pull ,
OstreeRepoPullFlags flags ,
OstreeAsyncProgress * progress ,
gboolean * out_changed ,
GCancellable * cancellable ,
GError * * error ) ;
gboolean
rpmostree_sysroot_upgrader_prep_layering ( RpmOstreeSysrootUpgrader * self ,
RpmOstreeSysrootUpgraderLayeringType * out_layering ,
gboolean * out_changed ,
GCancellable * cancellable ,
GError * * error ) ;
2017-10-13 16:22:15 +03:00
gboolean
rpmostree_sysroot_upgrader_import_pkgs ( RpmOstreeSysrootUpgrader * self ,
GCancellable * cancellable ,
GError * * error ) ;
2017-08-08 16:46:37 +03:00
gboolean
rpmostree_sysroot_upgrader_pull_repos ( RpmOstreeSysrootUpgrader * self ,
const char * dir_to_pull ,
OstreeRepoPullFlags flags ,
OstreeAsyncProgress * progress ,
gboolean * out_changed ,
GCancellable * cancellable ,
GError * * error ) ;
2015-02-11 21:06:43 +03:00
gboolean
rpmostree_sysroot_upgrader_deploy ( RpmOstreeSysrootUpgrader * self ,
GCancellable * cancellable ,
GError * * error ) ;
G_END_DECLS