Module with createrepo API
◆ cr_block_terminating_signals()
gboolean cr_block_terminating_signals |
( |
GError ** | err | ) |
|
Block process terminating signals. (Useful for creating pseudo-atomic sections in code)
◆ cr_lock_repo()
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 exist, 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.
◆ cr_set_cleanup_handler()
gboolean cr_set_cleanup_handler |
( |
const char * | lock_dir, |
|
|
const char * | tmp_out_repo, |
|
|
GError ** | err ) |
This function does: 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.
◆ cr_setup_logging()
void cr_setup_logging |
( |
gboolean | quiet, |
|
|
gboolean | verbose ) |
Setup logging for the application.
◆ cr_unblock_terminating_signals()
gboolean cr_unblock_terminating_signals |
( |
GError ** | err | ) |
|
Unblock process terminating signals.
◆ cr_unset_cleanup_handler()
gboolean cr_unset_cleanup_handler |
( |
GError ** | err | ) |
|
Unset cleanup handler.
- Parameters
-
- Returns
- TRUE on success, FALSE if err is set.