Librepo library  1.8.0
C library for downloading linux repository metadata and packages
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules
yum.h
1 /* librepo - A library providing (libcURL like) API to downloading repository
2  * Copyright (C) 2012 Tomas Mlcoch
3  *
4  * Licensed under the GNU Lesser General Public License Version 2.1
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library 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 GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef __LR_YUMREPO_H__
22 #define __LR_YUMREPO_H__
23 
24 #include <glib.h>
25 
26 #include "handle.h"
27 #include "metalink.h"
28 #include "rcodes.h"
29 #include "repomd.h"
30 #include "result.h"
31 
32 G_BEGIN_DECLS
33 
40 typedef struct {
41  char *type;
42  char *path;
44 
46 typedef struct {
47  GSList *paths;
48  char *repomd;
49  char *url;
50  char *destdir;
51  char *signature;
54  char *mirrorlist;
55  char *metalink;
56 } LrYumRepo;
57 
60 typedef struct CbData_s {
61  void *userdata;
62  void *cbdata;
65  char *metadata;
66 } CbData;
67 
71 LrYumRepo *
72 lr_yum_repo_init(void);
73 
77 void
79 
85 const char *
86 lr_yum_repo_path(LrYumRepo *repo, const char *type);
87 
95 int
96 hmfcb(void *clientp, const char *msg, const char *url);
97 
103 gboolean
104 lr_prepare_repodata_dir(LrHandle *handle, GError **err);
105 
106 
113 gboolean
114 lr_store_mirrorlist_files(LrHandle *handle, LrYumRepo *repo, GError **err);
115 
122 gboolean
123 lr_copy_metalink_content(LrHandle *handle, LrYumRepo *repo, GError **err);
124 
131 int
132 lr_prepare_repomd_xml_file(LrHandle *handle, char **path, GError **err);
133 
134 gboolean
135 lr_check_repomd_xml_asc_availability(LrHandle *handle, LrYumRepo *repo, int fd, char *path, GError **err);
136 
141 void
142 lr_get_best_checksum(const LrMetalink *metalink, GSList **checksums);
143 
148 CbData *
150 
157 gboolean
158 lr_yum_download_repos(GSList *targets,
159  GError **err);
160 
163 G_END_DECLS
164 
165 #endif
gboolean lr_prepare_repodata_dir(LrHandle *handle, GError **err)
struct CbData_s CbData
char * url
Definition: yum.h:49
GSList * paths
Definition: yum.h:47
Definition: yum.h:60
int hmfcb(void *clientp, const char *msg, const char *url)
char * type
Definition: yum.h:41
gboolean lr_yum_download_repos(GSList *targets, GError **err)
void lr_yum_repo_free(LrYumRepo *repo)
gboolean lr_copy_metalink_content(LrHandle *handle, LrYumRepo *repo, GError **err)
char * metalink
Definition: yum.h:55
char * path
Definition: yum.h:42
void lr_get_best_checksum(const LrMetalink *metalink, GSList **checksums)
int(* LrProgressCb)(void *clientp, double total_to_download, double now_downloaded)
Definition: types.h:125
char * signature
Definition: yum.h:51
LrHandleMirrorFailureCb hmfcb
Definition: yum.h:64
void * cbdata
Definition: yum.h:62
CbData * lr_get_metadata_failure_callback(const LrHandle *handle)
LrProgressCb progresscb
Definition: yum.h:63
char * mirrorlist
Definition: yum.h:54
char * destdir
Definition: yum.h:50
const char * lr_yum_repo_path(LrYumRepo *repo, const char *type)
gboolean lr_store_mirrorlist_files(LrHandle *handle, LrYumRepo *repo, GError **err)
int lr_prepare_repomd_xml_file(LrHandle *handle, char **path, GError **err)
Definition: yum.h:46
char * repomd
Definition: yum.h:48
LrYumRepo * lr_yum_repo_init(void)
int(* LrHandleMirrorFailureCb)(void *clientp, const char *msg, const char *url, const char *metadata)
Definition: types.h:165
void * userdata
Definition: yum.h:61
char * metadata
Definition: yum.h:65
struct _LrHandle LrHandle
Definition: handle.h:38