/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- * * Copyright (C) 2015 Colin Walters * * 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 #include "libglnx.h" #include #include typedef struct RpmOstreeUnpacker RpmOstreeUnpacker; #define RPMOSTREE_TYPE_UNPACKER (rpmostree_unpacker_get_type ()) #define RPMOSTREE_UNPACKER(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), RPMOSTREE_TYPE_UNPACKER, RpmOstreeUnpacker)) #define RPMOSTREE_IS_UNPACKER(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), RPMOSTREE_TYPE_UNPACKER)) GType rpmostree_unpacker_get_type (void); /** * RpmOstreeUnpackerFlags: * @RPMOSTREE_UNPACKER_FLAGS_OSTREE_CONVENTION: Move files to follow ostree convention * @RPMOSTREE_UNPACKER_FLAGS_UNPRIVILEGED: Ignore file ownership and setuid modes */ typedef enum { RPMOSTREE_UNPACKER_FLAGS_OSTREE_CONVENTION = (1 << 0), RPMOSTREE_UNPACKER_FLAGS_UNPRIVILEGED = (1 << 1) } RpmOstreeUnpackerFlags; RpmOstreeUnpacker* rpmostree_unpacker_new_fd (int fd, DnfPackage *pkg, RpmOstreeUnpackerFlags flags, GError **error); RpmOstreeUnpacker* rpmostree_unpacker_new_at (int dfd, const char *path, DnfPackage *pkg, /* for metadata */ RpmOstreeUnpackerFlags flags, GError **error); gboolean rpmostree_unpacker_read_metainfo (int fd, Header *out_header, gsize *out_cpio_offset, rpmfi *out_fi, GError **error); const char* rpmostree_unpacker_get_ostree_branch (RpmOstreeUnpacker *unpacker); gboolean rpmostree_unpacker_unpack_to_ostree (RpmOstreeUnpacker *unpacker, OstreeRepo *repo, OstreeSePolicy *sepolicy, char **out_commit, GCancellable *cancellable, GError **error); char * rpmostree_unpacker_get_nevra (RpmOstreeUnpacker *self); const char * rpmostree_unpacker_get_header_sha256 (RpmOstreeUnpacker *self);