Createrepo API.

Functions

gboolean cr_set_cleanup_handler (const char *lock_dir, const char *tmp_out_repo, GError **err)
gboolean cr_block_terminating_signals (GError **err)
gboolean cr_unblock_terminating_signals (GError **err)
gboolean cr_lock_repo (const gchar *repo_dir, gboolean ignore_lock, gchar **lock_dir, gchar **tmp_repodata_dir, GError **err)
gboolean cr_unset_cleanup_handler (GError **err)
void cr_setup_logging (gboolean quiet, gboolean verbose)

Detailed Description

Module with createrepo API


Function Documentation

gboolean cr_block_terminating_signals ( GError **  err  ) 

Block process terminating signals. (Useful for creating pseudo-atomic sections in code)

gboolean cr_lock_repo ( const gchar *  repo_dir,
gboolean  ignore_lock,
gchar **  lock_dir,
gchar **  tmp_repodata_dir,
GError **  err 
)

This function does:

  • Tries to create repo/.repodata/ dir.
  • If it doesn't exists, it's created and function returns TRUE.
  • If it exists and ignore_lock is FALSE, returns FALSE and err is set.
  • If it exists and ignore_lock is TRUE it:
    • Removes the existing .repodata/ dir and all its content
    • Creates (empty) new one (just as a lock dir - place holder)
    • Creates .repodata.pid.datetime.usec/ that should be used for repodata generation
Parameters:
repo_dir Path to repo (a dir that contains repodata/ subdir)
ignore_lock Ignore existing .repodata/ dir - remove it and create a new one.
lock_dir Location to store path to a directory used as a lock. Always repodir+"/.repodata/". Even if FALSE is returned, the content of this variable IS DEFINED.
tmp_repodata_dir Location to store a path to a directory used as a temporary directory for repodata generation. If ignore_lock is FALSE than lock_dir is same as tmp_repodata_dir. If FALSE is returned, the content of this variable is undefined.
err GError **
Returns:
TRUE on success, FALSE if err is set.
gboolean cr_set_cleanup_handler ( const char *  lock_dir,
const char *  tmp_out_repo,
GError **  err 
)

This function does: 1) Sets on_exit cleanup function that removes temporary directories 2) Sets a signal handler for signals that lead to process temination. (List obtained from the "man 7 signal") Signals that are ignored (SIGCHILD) or lead just to stop (SIGSTOP, ...) don't get this handler - these signals do not terminate the process! This handler assures that the cleanup function that is hooked on exit gets called.

Parameters:
lock_dir Dir that serves as lock (".repodata/")
tmp_out_repo Dir that is really used for repodata generation (usually exactly the same as lock dir if not --ignore-lock is specified). Could be NULL.
Returns:
TRUE on success, FALSE if err is set.
void cr_setup_logging ( gboolean  quiet,
gboolean  verbose 
)

Setup logging for the application.

gboolean cr_unblock_terminating_signals ( GError **  err  ) 

Unblock process terminating signals.

gboolean cr_unset_cleanup_handler ( GError **  err  ) 

Unset cleanup handler.

Parameters:
err GError **
Returns:
TRUE on success, FALSE if err is set.

Generated on 5 Apr 2016 for createrepo_c library by  doxygen 1.6.1