extract: fix --force-overwrite
Directories are handled specially in package installation code, but extract applet uses also apk_extract_file() to create directories. These should not be unlinked as that fails with unexpected error code terminating the extraction.cute-signatures
parent
b30e94c0ac
commit
f446f2253d
|
@ -23,7 +23,7 @@ int apk_extract_file(int atfd, const struct apk_file_info *ae,
|
|||
const char *fn = extract_name ?: ae->name;
|
||||
int fd, r = -1, atflags = 0, ret = 0;
|
||||
|
||||
if (!(extract_flags & APK_EXTRACTF_NO_OVERWRITE)) {
|
||||
if (!S_ISDIR(ae->mode) && !(extract_flags & APK_EXTRACTF_NO_OVERWRITE)) {
|
||||
if (unlinkat(atfd, fn, 0) != 0 && errno != ENOENT) return -errno;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue