|
| int | alpm_remove_pkg (alpm_handle_t *handle, alpm_pkg_t *pkg) |
| | Add a package removal to the transaction.
|
| |
| static int | remove_prepare_cascade (alpm_handle_t *handle, alpm_list_t *lp) |
| | Add dependencies to the removal transaction for cascading.
|
| |
| static void | remove_prepare_keep_needed (alpm_handle_t *handle, alpm_list_t *lp) |
| | Remove needed packages from the removal transaction.
|
| |
| static void | remove_notify_needed_optdepends (alpm_handle_t *handle, alpm_list_t *lp) |
| | Send a callback for any optdepend being removed.
|
| |
| static int | dir_is_mountpoint (alpm_handle_t *handle, const char *directory, const struct stat *stbuf) |
| | Test if a directory is being used as a mountpoint.
|
| |
| static int | can_remove_file (alpm_handle_t *handle, const alpm_file_t *file) |
| | Check if alpm can delete a file.
|
| |
| static void | shift_pacsave (alpm_handle_t *handle, const char *file) |
| |
| static int | unlink_file (alpm_handle_t *handle, alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg, const alpm_file_t *fileobj, int nosave) |
| | Unlink a package file, backing it up if necessary.
|
| |
| static int | should_skip_file (alpm_handle_t *handle, alpm_pkg_t *newpkg, const char *path) |
| | Check if a package file should be removed.
|
| |
| static int | remove_package_files (alpm_handle_t *handle, alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg, size_t targ_count, size_t pkg_count) |
| | Remove a package's files, optionally skipping its replacement's files.
|
| |
| static int remove_package_files |
( |
alpm_handle_t * | handle, |
|
|
alpm_pkg_t * | oldpkg, |
|
|
alpm_pkg_t * | newpkg, |
|
|
size_t | targ_count, |
|
|
size_t | pkg_count ) |
|
static |
Remove a package's files, optionally skipping its replacement's files.
- Parameters
-
| handle | the context handle |
| oldpkg | package to remove |
| newpkg | package to replace oldpkg (optional) |
| targ_count | current index within the transaction (1-based) |
| pkg_count | the number of packages affected by the transaction |
- Returns
- 0 on success, -1 if alpm lacks permission to delete some of the files, >0 the number of files alpm was unable to delete
References ALPM_ERR_PKG_CANT_REMOVE, ALPM_LOG_DEBUG, alpm_pkg_get_files(), ALPM_PROGRESS_REMOVE_START, ALPM_TRANS_FLAG_NOSAVE, can_remove_file(), alpm_filelist_t::count, alpm_filelist_t::files, alpm_file_t::name, PROGRESS, RET_ERR, should_skip_file(), and unlink_file().
| static int unlink_file |
( |
alpm_handle_t * | handle, |
|
|
alpm_pkg_t * | oldpkg, |
|
|
alpm_pkg_t * | newpkg, |
|
|
const alpm_file_t * | fileobj, |
|
|
int | nosave ) |
|
static |
Unlink a package file, backing it up if necessary.
- Parameters
-
| handle | the context handle |
| oldpkg | the package being removed |
| newpkg | the package replacing oldpkg |
| fileobj | file to remove |
| nosave | whether files should be backed up |
- Returns
- 0 on success, -1 if there was an error unlinking the file, 1 if the file was skipped or did not exist
References _, ALPM_CALLER_PREFIX, alpm_compute_md5sum(), ALPM_ERR_MEMORY, ALPM_EVENT_PACSAVE_CREATED, alpm_filelist_contains(), ALPM_LOG_DEBUG, ALPM_LOG_ERROR, alpm_logaction(), alpm_pkg_get_files(), alpm_list_t::data, dir_is_mountpoint(), EVENT, FREE, alpm_backup_t::hash, MALLOC, alpm_file_t::name, alpm_list_t::next, RET_ERR, shift_pacsave(), and alpm_event_pacsave_created_t::type.
Referenced by remove_package_files().