1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

extract_single_file: reduce indentation

Puts all of the conflict cases at the same level.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
This commit is contained in:
Andrew Gregory 2014-10-01 01:26:33 -04:00 committed by Allan McRae
parent 63660afbc7
commit f917a4a55a

View File

@ -215,9 +215,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
if(llstat(filename, &lsbuf) != 0) { if(llstat(filename, &lsbuf) != 0) {
/* cases 1,2: file doesn't exist, skip all backup checks */ /* cases 1,2: file doesn't exist, skip all backup checks */
} else { } else if(S_ISDIR(lsbuf.st_mode) && S_ISDIR(entrymode)) {
if(S_ISDIR(lsbuf.st_mode)) {
if(S_ISDIR(entrymode)) {
uid_t entryuid = archive_entry_uid(entry); uid_t entryuid = archive_entry_uid(entry);
gid_t entrygid = archive_entry_gid(entry); gid_t entrygid = archive_entry_gid(entry);
@ -248,19 +246,18 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
filename); filename);
archive_read_data_skip(archive); archive_read_data_skip(archive);
return 0; return 0;
} else { } else if(S_ISDIR(lsbuf.st_mode)) {
/* case 5: trying to overwrite dir with file, don't allow it */ /* case 5: trying to overwrite dir with file, don't allow it */
_alpm_log(handle, ALPM_LOG_ERROR, _("extract: not overwriting dir with file %s\n"), _alpm_log(handle, ALPM_LOG_ERROR, _("extract: not overwriting dir with file %s\n"),
filename); filename);
archive_read_data_skip(archive); archive_read_data_skip(archive);
return 1; return 1;
}
} else if(S_ISDIR(entrymode)) { } else if(S_ISDIR(entrymode)) {
/* case 4: trying to overwrite file with dir */ /* case 4: trying to overwrite file with dir */
_alpm_log(handle, ALPM_LOG_DEBUG, "extract: overwriting file with dir %s\n", _alpm_log(handle, ALPM_LOG_DEBUG, "extract: overwriting file with dir %s\n",
filename); filename);
} else { } else {
/* case 3: */ /* case 3: trying to overwrite file with file */
/* if file is in NoUpgrade, don't touch it */ /* if file is in NoUpgrade, don't touch it */
if(_alpm_fnmatch_patterns(handle->noupgrade, entryname) == 0) { if(_alpm_fnmatch_patterns(handle->noupgrade, entryname) == 0) {
notouch = 1; notouch = 1;
@ -275,7 +272,6 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
} }
} }
} }
}
/* we need access to the original entryname later after calls to /* we need access to the original entryname later after calls to
* archive_entry_set_pathname(), so we need to dupe it and free() later */ * archive_entry_set_pathname(), so we need to dupe it and free() later */