cfengine  3.15.4
About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.
  Fossies Dox: cfengine-3.15.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

package_module.h
Go to the documentation of this file.
1 /*
2  Copyright 2019 Northern.tech AS
3 
4  This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
5 
6  This program is free software; you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by the
8  Free Software Foundation; version 3.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
18 
19  To the extent this program is licensed as part of the Enterprise
20  versions of CFEngine, the applicable Commercial Open Source License
21  (COSL) may apply to this file if you as a licensee so wish it. See
22  included file COSL.txt.
23 */
24 
25 #ifndef PACKAGE_MODULE_H
26 #define PACKAGE_MODULE_H
27 
28 #include <cf3.defs.h>
29 
30 //TODO: use promise expireafter instead
31 #define PACKAGE_PROMISE_SCRIPT_TIMEOUT_SEC 4 * 3600 /* 4 hours timeout */
32 #define PACKAGE_PROMISE_TERMINATION_CHECK_SEC 1
33 
34 #define GLOBAL_PACKAGE_PROMISE_LOCK_NAME "new_packages_promise_lock"
35 
36 typedef enum
37 {
42 
43 typedef struct
44 {
45  char *name;
46  char *version;
47  char *arch;
49 } PackageInfo;
50 
51 typedef struct
52 {
53  char *type;
54  char *message;
55 } PackageError;
56 
57 typedef struct
58 {
59  char *name;
60  char *path;
61  char *script_path;
67 
68 typedef struct
69 {
73 
74 typedef enum {
78 } UpdateType;
79 
81  const char *package_name,
82  const NewPackages *policy_data,
83  const PackageModuleWrapper *wrapper,
84  enum cfopaction action);
86  char *package_name,
87  const NewPackages *policy_data,
88  const PackageModuleWrapper *wrapper,
89  enum cfopaction action);
90 
91 void UpdatePackagesCache(EvalContext *ctx, bool force_update);
92 
95 
98 
99 #endif
PromiseResult
Definition: cf3.defs.h:122
cfopaction
Definition: cf3.defs.h:717
PackageModuleWrapper * NewPackageModuleWrapper(PackageModuleBody *package_module)
UpdateType
@ UPDATE_TYPE_INSTALLED
@ UPDATE_TYPE_LOCAL_UPDATES
@ UPDATE_TYPE_UPDATES
PackagePromiseGlobalLock AcquireGlobalPackagePromiseLock(EvalContext *ctx)
PromiseResult HandleAbsentPromiseAction(EvalContext *ctx, char *package_name, const NewPackages *policy_data, const PackageModuleWrapper *wrapper, enum cfopaction action)
void UpdatePackagesCache(EvalContext *ctx, bool force_update)
PromiseResult HandlePresentPromiseAction(EvalContext *ctx, const char *package_name, const NewPackages *policy_data, const PackageModuleWrapper *wrapper, enum cfopaction action)
void DeletePackageModuleWrapper(PackageModuleWrapper *wrapper)
PackageType
@ PACKAGE_TYPE_NONE
@ PACKAGE_TYPE_REPO
@ PACKAGE_TYPE_FILE
void YieldGlobalPackagePromiseLock(PackagePromiseGlobalLock lock)
char * version
PackageType type
PackageModuleBody * package_module