createrepo_c library  0.9.1
C library for metadata manipulation
deltarpms.h
1 /* createrepo_c - Library of routines for manipulation with repodata
2  * Copyright (C) 2014 Tomas Mlcoch
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17  * USA.
18  */
19 
20 #ifndef __C_CREATEREPOLIB_DELTARPMS_H__
21 #define __C_CREATEREPOLIB_DELTARPMS_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <glib.h>
28 #include <rpm/rpmlib.h>
29 #include "package.h"
30 #include "parsehdr.h"
31 #include "xml_file.h"
32 
38 #define CR_DELTA_RPM_SUPPORT
39 #define CR_DEFAULT_MAX_DELTA_RPM_SIZE 100000000
40 
41 typedef struct {
42  cr_Package *package;
43  char *nevr;
44  char *sequence;
45  GStringChunk *chunk;
47 
48 typedef struct {
49  char *name;
50  char *arch;
51  char *epoch;
52  char *version;
53  char *release;
54  char *location_href;
55  gint64 size_installed;
56 
57  char *path;
58  GStringChunk *chunk;
60 
61 gboolean cr_drpm_support(void);
62 
63 #ifdef CR_DELTA_RPM_SUPPORT
64 char *
65 cr_drpm_create(cr_DeltaTargetPackage *old,
67  const char *destdir,
68  GError **err);
69 
71 cr_deltapackage_from_drpm_base(const char *filename,
72  int changelog_limit,
74  GError **err);
75 
76 void
77 cr_deltapackage_free(cr_DeltaPackage *deltapackage);
78 
79 GHashTable *
80 cr_deltarpms_scan_oldpackagedirs(GSList *oldpackagedirs,
81  gint64 max_delta_rpm_size,
82  GError **err);
83 
85 cr_deltatargetpackage_from_package(cr_Package *pkg,
86  const char *path,
87  GError **err);
88 
90 cr_deltatargetpackage_from_rpm(const char *path, GError **err);
91 
92 void
93 cr_deltatargetpackage_free(cr_DeltaTargetPackage *tpkg);
94 
95 gboolean
96 cr_deltarpms_parallel_deltas(GSList *targetpackages,
97  GHashTable *oldpackages,
98  const char *outdeltadir,
99  gint num_deltas,
100  gint workers,
101  gint64 max_delta_rpm_size,
102  gint64 max_work_size,
103  GError **err);
104 
105 GSList *
106 cr_deltarpms_scan_targetdir(const char *path,
107  gint64 max_delta_rpm_size,
108  GError **err);
109 
110 gboolean
111 cr_deltarpms_generate_prestodelta_file(const gchar *drpmdir,
112  cr_XmlFile *f,
113  cr_ChecksumType checksum_type,
114  gint workers,
115  const gchar *prefix_to_strip,
116  GError **err);
117 #endif
118 
119 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* __C_CREATEREPOLIB_DELTARPMS_H__ */
cr_ChecksumType
Definition: checksum.h:43
cr_HeaderReadingFlags
Definition: parsehdr.h:38