createrepo_c library  0.2.1
C library for metadata manipulation
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Locate metadata API.

Data Structures

struct  cr_MetadataLocation
 

Functions

struct cr_MetadataLocationcr_locate_metadata (const char *repopath, int ignore_sqlite, GError **err)
 
void cr_metadatalocation_free (struct cr_MetadataLocation *ml)
 
int cr_remove_metadata (const char *repopath, GError **err)
 
int cr_remove_metadata_classic (const char *repopath, int retain, GError **err)
 

Detailed Description

Function Documentation

struct cr_MetadataLocation* cr_locate_metadata ( const char *  repopath,
int  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
void cr_metadatalocation_free ( struct cr_MetadataLocation ml)

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

Parameters
mlMeatadaLocation
int cr_remove_metadata ( const char *  repopath,
GError **  err 
)

Remove files related to repodata from the specified path. Files not listed in repomd.xml and with nonstandard names (standard names are names with suffixes like primary.xml.*, primary.sqlite.*, other.xml.*, etc.) are keep untouched (repodata/ subdirectory IS NOT removed!).

Parameters
repopathpath to directory with repodata/ subdirectory
errGError **
Returns
number of removed files
int cr_remove_metadata_classic ( const char *  repopath,
int  retain,
GError **  err 
)

Remove repodata in same manner as classic createrepo. This function removes only (primary|filelists|other)[.sqlite].* files from repodata.

Parameters
repopathpath to directory with repodata/subdirectory
retainkeep around the latest N old, uniquely named primary, filelists and otherdata xml and sqlite files. If <1 no old files will be kept.
errGError **
Returns
cr_Error code