1 /*#############################################################################
3 # Pakfire - The IPFire package management system #
4 # Copyright (C) 2013 Pakfire development team #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 #############################################################################*/
21 #ifndef PAKFIRE_PACKAGE_H
22 #define PAKFIRE_PACKAGE_H
24 #include <solv/pooltypes.h>
26 #include <pakfire/relation.h>
27 #include <pakfire/relationlist.h>
28 #include <pakfire/pool.h>
29 #include <pakfire/types.h>
31 PakfirePackage
pakfire_package_create(PakfirePool pool
, Id id
);
32 PakfirePackage
pakfire_package_create2(PakfirePool pool
, PakfireRepo repo
, const char* name
, const char* evr
, const char* arch
);
33 void pakfire_package_free(PakfirePackage pkg
);
35 int pakfire_package_identical(PakfirePackage pkg1
, PakfirePackage pkg2
);
36 int pakfire_package_cmp(PakfirePackage pkg1
, PakfirePackage pkg2
);
37 int pakfire_package_evr_cmp(PakfirePackage pkg1
, PakfirePackage pkg2
);
39 Id
pakfire_package_id(PakfirePackage pkg
);
41 char* pakfire_package_get_nevra(PakfirePackage pkg
);
42 const char* pakfire_package_get_name(PakfirePackage pkg
);
43 void pakfire_package_set_name(PakfirePackage pkg
, const char* name
);
44 const char* pakfire_package_get_evr(PakfirePackage pkg
);
45 void pakfire_package_set_evr(PakfirePackage pkg
, const char* evr
);
46 unsigned long pakfire_package_get_epoch(PakfirePackage pkg
);
47 const char* pakfire_package_get_version(PakfirePackage pkg
);
48 const char* pakfire_package_get_release(PakfirePackage pkg
);
49 const char* pakfire_package_get_arch(PakfirePackage pkg
);
50 void pakfire_package_set_arch(PakfirePackage pkg
, const char* arch
);
52 const char* pakfire_package_get_uuid(PakfirePackage pkg
);
53 void pakfire_package_set_uuid(PakfirePackage pkg
, const char* uuid
);
54 const char* pakfire_package_get_checksum(PakfirePackage pkg
);
55 void pakfire_package_set_checksum(PakfirePackage pkg
, const char* checksum
);
56 const char* pakfire_package_get_summary(PakfirePackage pkg
);
57 void pakfire_package_set_summary(PakfirePackage pkg
, const char* summary
);
58 const char* pakfire_package_get_description(PakfirePackage pkg
);
59 void pakfire_package_set_description(PakfirePackage pkg
, const char* description
);
60 const char* pakfire_package_get_license(PakfirePackage pkg
);
61 void pakfire_package_set_license(PakfirePackage pkg
, const char* license
);
62 const char* pakfire_package_get_url(PakfirePackage pkg
);
63 void pakfire_package_set_url(PakfirePackage pkg
, const char* url
);
64 const char** pakfire_package_get_groups(PakfirePackage pkg
);
65 void pakfire_package_set_groups(PakfirePackage pkg
, const char** grouplist
);
66 const char* pakfire_package_get_vendor(PakfirePackage pkg
);
67 void pakfire_package_set_vendor(PakfirePackage pkg
, const char* vendor
);
68 const char* pakfire_package_get_maintainer(PakfirePackage pkg
);
69 void pakfire_package_set_maintainer(PakfirePackage pkg
, const char* maintainer
);
70 const char* pakfire_package_get_filename(PakfirePackage pkg
);
71 void pakfire_package_set_filename(PakfirePackage pkg
, const char* filename
);
72 int pakfire_package_is_installed(PakfirePackage pkg
);
73 unsigned long long pakfire_package_get_downloadsize(PakfirePackage pkg
);
74 void pakfire_package_set_downloadsize(PakfirePackage pkg
, unsigned long long downloadsize
);
75 unsigned long long pakfire_package_get_installsize(PakfirePackage pkg
);
76 void pakfire_package_set_installsize(PakfirePackage pkg
, unsigned long long installsize
);
77 unsigned long long pakfire_package_get_size(PakfirePackage pkg
);
78 const char* pakfire_package_get_buildhost(PakfirePackage pkg
);
79 void pakfire_package_set_buildhost(PakfirePackage pkg
, const char* buildhost
);
80 unsigned long long pakfire_package_get_buildtime(PakfirePackage pkg
);
81 void pakfire_package_set_buildtime(PakfirePackage pkg
, unsigned long long buildtime
);
82 unsigned long long pakfire_package_get_installtime(PakfirePackage pkg
);
84 PakfireRelationList
pakfire_package_get_provides(PakfirePackage pkg
);
85 void pakfire_package_set_provides(PakfirePackage pkg
, PakfireRelationList relationlist
);
86 void pakfire_package_add_provides(PakfirePackage pkg
, PakfireRelation relation
);
87 PakfireRelationList
pakfire_package_get_requires(PakfirePackage pkg
);
88 void pakfire_package_set_requires(PakfirePackage pkg
, PakfireRelationList relationlist
);
89 void pakfire_package_add_requires(PakfirePackage pkg
, PakfireRelation relation
);
90 PakfireRelationList
pakfire_package_get_conflicts(PakfirePackage pkg
);
91 void pakfire_package_set_conflicts(PakfirePackage pkg
, PakfireRelationList relationlist
);
92 void pakfire_package_add_conflicts(PakfirePackage pkg
, PakfireRelation relation
);
93 PakfireRelationList
pakfire_package_get_obsoletes(PakfirePackage pkg
);
94 void pakfire_package_set_obsoletes(PakfirePackage pkg
, PakfireRelationList relationlist
);
95 void pakfire_package_add_obsoletes(PakfirePackage pkg
, PakfireRelation relation
);
96 PakfireRelationList
pakfire_package_get_recommends(PakfirePackage pkg
);
97 void pakfire_package_set_recommends(PakfirePackage pkg
, PakfireRelationList relationlist
);
98 void pakfire_package_add_recommends(PakfirePackage pkg
, PakfireRelation relation
);
99 PakfireRelationList
pakfire_package_get_suggests(PakfirePackage pkg
);
100 void pakfire_package_set_suggests(PakfirePackage pkg
, PakfireRelationList relationlist
);
101 void pakfire_package_add_suggests(PakfirePackage pkg
, PakfireRelation relation
);
103 PakfireRepo
pakfire_package_get_repo(PakfirePackage pkg
);
104 void pakfire_package_set_repo(PakfirePackage pkg
, PakfireRepo repo
);
106 char* pakfire_package_get_location(PakfirePackage pkg
);
108 char* pakfire_package_dump(PakfirePackage pkg
, int flags
);
110 int pakfire_package_is_cached(PakfirePackage pkg
);
111 char* pakfire_package_get_cache_path(PakfirePackage pkg
);
112 char* pakfire_package_get_cache_full_path(PakfirePackage pkg
);
114 PakfireFile
pakfire_package_get_filelist(PakfirePackage pkg
);
115 PakfireFile
pakfire_package_filelist_append(PakfirePackage pkg
, const char* filename
);
117 PakfireFile
pakfire_package_filelist_append(PakfirePackage pkg
);
119 void pakfire_package_filelist_remove(PakfirePackage pkg
);
121 enum pakfire_package_keynames
{
125 PAKFIRE_PKG_CONFLICTS
,
126 PAKFIRE_PKG_DESCRIPTION
,
131 PAKFIRE_PKG_OBSOLETES
,
132 PAKFIRE_PKG_PROVIDES
,
134 PAKFIRE_PKG_REPONAME
,
135 PAKFIRE_PKG_REQUIRES
,
136 PAKFIRE_PKG_SOURCERPM
,
143 enum pakfire_package_dump_flags
{
144 PAKFIRE_PKG_DUMP_FILELIST
= 1 << 0,
145 PAKFIRE_PKG_DUMP_LONG
= 1 << 1,
148 #ifdef PAKFIRE_PRIVATE
150 struct _PakfirePackage
{
154 PakfireFile filelist
;
157 static inline PakfirePool
pakfire_package_pool(PakfirePackage pkg
) {
161 static inline Pool
* pakfire_package_solv_pool(PakfirePackage pkg
) {
162 return pakfire_package_pool(pkg
)->pool
;
167 #endif /* PAKFIRE_PACKAGE_H */