createrepo_c library 1.1.2
C library for metadata manipulation
Loading...
Searching...
No Matches
Locate metadata API.

Data Structures

struct  cr_MetadataLocation
 
struct  cr_Metadatum
 

Functions

struct cr_MetadataLocationcr_parse_repomd (const char *repomd_path, const char *repopath, int ignore_sqlite)
 
GSList * cr_insert_additional_metadatum (const gchar *path, const gchar *type, GSList *additional_metadata)
 
gint cr_cmp_metadatum_type (gconstpointer metadatum, gconstpointer type)
 
gint cr_cmp_repomd_record_type (gconstpointer repomd_record, gconstpointer type)
 
struct cr_MetadataLocationcr_locate_metadata (const char *repopath, gboolean ignore_sqlite, GError **err)
 
void cr_metadatalocation_free (struct cr_MetadataLocation *ml)
 
void cr_metadatum_free (cr_Metadatum *m)
 
gchar * cr_copy_metadatum (const gchar *src, const gchar *tmp_out_repo, GError **err)
 

Detailed Description

Function Documentation

◆ cr_cmp_metadatum_type()

gint cr_cmp_metadatum_type ( gconstpointer  metadatum,
gconstpointer  type 
)

Compares type (string) of specified metadatum with second parameter string (type)

Parameters
metadatumCmp type of this metadatum
typeString value
Returns
an integer less than, equal to, or greater than zero, if metadatum type is <, == or > than type (string cmp)

◆ cr_cmp_repomd_record_type()

gint cr_cmp_repomd_record_type ( gconstpointer  repomd_record,
gconstpointer  type 
)

Compares type (string) of specified cr_RepomdRecord with second parameter string (type)

Parameters
cr_RepomdRecordCmp type of this cr_RepomdRecord
typeString value
Returns
an integer less than, equal to, or greater than zero, if repomdRecord type is <, == or > than type (string cmp)

◆ cr_copy_metadatum()

gchar * cr_copy_metadatum ( const gchar *  src,
const gchar *  tmp_out_repo,
GError **  err 
)

Copies metadata files, exactly, even hashed name It first constructs target path (location + name), Then it copies file to that location

Metadatum as in singular of metadata, it is eg. groupfile, updateinfo..

Parameters
srcFrom where are we copying
tmp_out_repoCopying destination dir
errGError **
Returns
Path to copied file

◆ cr_insert_additional_metadatum()

GSList * cr_insert_additional_metadatum ( const gchar *  path,
const gchar *  type,
GSList *  additional_metadata 
)

Inserts additional metadatum to list of additional metadata if this type is already present it gets overridden

Parameters
pathPath to metadatum
typeType of metadatum
additional_metadataList of additional metadata
Returns
Original list with new element

◆ cr_locate_metadata()

struct cr_MetadataLocation * cr_locate_metadata ( const char *  repopath,
gboolean  ignore_sqlite,
GError **  err 
)

Parses repomd.xml and returns a filled cr_MetadataLocation structure. Remote repodata (repopath with prefix "ftp://" or "http://") are dowloaded into a temporary directory and removed when the cr_metadatalocation_free() is called on the cr_MetadataLocation.

Parameters
repopathpath to directory with repodata/ subdirectory
ignore_sqliteif ignore_sqlite != 0 sqlite dbs are ignored
errGError **
Returns
filled cr_MetadataLocation structure or NULL

◆ cr_metadatalocation_free()

void cr_metadatalocation_free ( struct cr_MetadataLocation ml)

Free cr_MetadataLocation. If repodata were downloaded remove a temporary directory with repodata.

Parameters
mlMeatadaLocation

◆ cr_metadatum_free()

void cr_metadatum_free ( cr_Metadatum m)

Free cr_Metadatum.

Parameters
mMeatadatum