mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
libalpm/add.c,util.c : log ARCHIVE_WARN warning to debug output.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
This commit is contained in:
parent
cd3a636813
commit
f55f7f100f
@ -545,7 +545,11 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||
archive_entry_set_pathname(entry, tempfile);
|
||||
|
||||
int ret = archive_read_extract(archive, entry, archive_flags);
|
||||
if(ret != ARCHIVE_OK && ret != ARCHIVE_WARN) {
|
||||
if(ret == ARCHIVE_WARN) {
|
||||
/* operation succeeded but a non-critical error was encountered */
|
||||
_alpm_log(PM_LOG_DEBUG, _("warning extracting %s (%s)"),
|
||||
entryname, archive_error_string(archive));
|
||||
} else if(ret != ARCHIVE_OK) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)"),
|
||||
entryname, archive_error_string(archive));
|
||||
alpm_logaction(_("could not extract %s (%s)"),
|
||||
@ -701,7 +705,11 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||
archive_entry_set_pathname(entry, filename);
|
||||
|
||||
int ret = archive_read_extract(archive, entry, archive_flags);
|
||||
if(ret != ARCHIVE_OK && ret != ARCHIVE_WARN) {
|
||||
if(ret == ARCHIVE_WARN) {
|
||||
/* operation succeeded but a non-critical error was encountered */
|
||||
_alpm_log(PM_LOG_DEBUG, _("warning extracting %s (%s)"),
|
||||
entryname, archive_error_string(archive));
|
||||
} else if(ret != ARCHIVE_OK) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)"),
|
||||
entryname, archive_error_string(archive));
|
||||
alpm_logaction(_("could not extract %s (%s)"),
|
||||
|
@ -327,15 +327,24 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
|
||||
}
|
||||
|
||||
while(archive_read_next_header(_archive, &entry) == ARCHIVE_OK) {
|
||||
if (fn && strcmp(fn, archive_entry_pathname(entry))) {
|
||||
const char *entryname; /* the name of the file in the archive */
|
||||
entryname = archive_entry_pathname(entry);
|
||||
|
||||
if (fn && strcmp(fn, entryname)) {
|
||||
if (archive_read_data_skip(_archive) != ARCHIVE_OK)
|
||||
return(1);
|
||||
continue;
|
||||
}
|
||||
snprintf(expath, PATH_MAX, "%s/%s", prefix, archive_entry_pathname(entry));
|
||||
snprintf(expath, PATH_MAX, "%s/%s", prefix, entryname);
|
||||
archive_entry_set_pathname(entry, expath);
|
||||
if(archive_read_extract(_archive, entry, archive_flags) != ARCHIVE_OK) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not extract %s: %s\n"), archive_entry_pathname(entry), archive_error_string(_archive));
|
||||
int ret = archive_read_extract(_archive, entry, archive_flags);
|
||||
if(ret == ARCHIVE_WARN) {
|
||||
/* operation succeeded but a non-critical error was encountered */
|
||||
_alpm_log(PM_LOG_DEBUG, _("warning extracting %s (%s)\n"),
|
||||
entryname, archive_error_string(_archive));
|
||||
} else if(ret != ARCHIVE_OK) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)\n"),
|
||||
entryname, archive_error_string(_archive));
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user