mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-08 12:28:00 -05:00
Some comments for _alpm_unpack.
Signed-off-by: K. Piche <kevin@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
9f56137034
commit
db4258c1fd
@ -370,6 +370,13 @@ int _alpm_lckrm()
|
|||||||
|
|
||||||
/* Compression functions */
|
/* Compression functions */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Unpack a specific file or all files in an archive.
|
||||||
|
*
|
||||||
|
* @param archive the archive to unpack
|
||||||
|
* @param prefix where to extract the files
|
||||||
|
* @param fn a file within the archive to unpack or NULL for all
|
||||||
|
*/
|
||||||
int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
|
int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
|
||||||
{
|
{
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
@ -407,13 +414,17 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
|
|||||||
archive_entry_set_mode(entry, 0755);
|
archive_entry_set_mode(entry, 0755);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If a specific file was requested skip entries that don't match. */
|
||||||
if (fn && strcmp(fn, entryname)) {
|
if (fn && strcmp(fn, entryname)) {
|
||||||
|
_alpm_log(PM_LOG_DEBUG, "skipping: %s\n", entryname);
|
||||||
if (archive_read_data_skip(_archive) != ARCHIVE_OK) {
|
if (archive_read_data_skip(_archive) != ARCHIVE_OK) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Extract the archive entry. */
|
||||||
ret = 0;
|
ret = 0;
|
||||||
snprintf(expath, PATH_MAX, "%s/%s", prefix, entryname);
|
snprintf(expath, PATH_MAX, "%s/%s", prefix, entryname);
|
||||||
archive_entry_set_pathname(entry, expath);
|
archive_entry_set_pathname(entry, expath);
|
||||||
|
Loading…
Reference in New Issue
Block a user