rpm-ostree/src/libpriv/rpmostree-scripts.h

74 lines
2.6 KiB
C
Raw Normal View History

/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2016 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 <ostree.h>
#include <rpm/rpmsq.h>
#include <rpm/rpmlib.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmfi.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmts.h>
#include <libdnf/libdnf.h>
#include "libglnx.h"
typedef enum {
RPMOSTREE_SCRIPT_ACTION_DEFAULT = 0,
RPMOSTREE_SCRIPT_ACTION_IGNORE,
RPMOSTREE_SCRIPT_ACTION_TODO_SHELL_POSTTRANS = RPMOSTREE_SCRIPT_ACTION_IGNORE,
} RpmOstreeScriptAction;
struct RpmOstreePackageScriptHandler {
const char *package_script;
RpmOstreeScriptAction action;
};
const struct RpmOstreePackageScriptHandler* rpmostree_script_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
gboolean rpmostree_script_ignore_hash_from_strv (const char *const *strv,
GHashTable **out_hash,
GError **error);
gboolean
rpmostree_script_txn_validate (DnfPackage *package,
Header hdr,
GHashTable *ignore_scripts,
GCancellable *cancellable,
GError **error);
gboolean
rpmostree_posttrans_run_sync (DnfPackage *pkg,
Header hdr,
GHashTable *ignore_scripts,
int rootfs_fd,
GCancellable *cancellable,
GError **error);
gboolean
rpmostree_pre_run_sync (DnfPackage *pkg,
Header hdr,
GHashTable *ignore_scripts,
int rootfs_fd,
GCancellable *cancellable,
GError **error);