diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-12-21 16:53:47 +0200 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-12-21 16:53:47 +0200 |
commit | 6417de4d1057675bacc06274cab385810b86eed7 (patch) | |
tree | 3ac64f217deadd9acd12d5de6cdf665a36086baa /src/archive.c | |
parent | f44f34811dde4e33210e83af8584a99543d528a8 (diff) | |
download | apk-tools-6417de4d1057675bacc06274cab385810b86eed7.tar.gz apk-tools-6417de4d1057675bacc06274cab385810b86eed7.tar.bz2 apk-tools-6417de4d1057675bacc06274cab385810b86eed7.tar.xz apk-tools-6417de4d1057675bacc06274cab385810b86eed7.zip |
apk: remove the unneeded --never-overwrite
turns out the logic does not work with overlays as expected due
to busybox symlinks being unmanaged. remove the useless option.
Diffstat (limited to 'src/archive.c')
-rw-r--r-- | src/archive.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/archive.c b/src/archive.c index a2707cd..b27c039 100644 --- a/src/archive.c +++ b/src/archive.c @@ -343,18 +343,7 @@ int apk_archive_entry_extract(int atfd, const struct apk_file_info *ae, if ((!S_ISDIR(ae->mode) && !S_ISREG(ae->mode)) || (ae->link_target != NULL)) { /* non-standard entries need to be deleted first */ - if (apk_flags & APK_NEVER_OVERWRITE) { - if (faccessat(atfd, ae->name, F_OK, - AT_SYMLINK_NOFOLLOW) == 0) { - /* destination exists, but we are not supposed - * to overwrite, just clean the temp file */ - if (suffix != NULL) - unlinkat(atfd, fn, 0); - return 0; - } - } else { - unlinkat(atfd, fn, 0); - } + unlinkat(atfd, fn, 0); } switch (ae->mode & S_IFMT) { @@ -367,14 +356,8 @@ int apk_archive_entry_extract(int atfd, const struct apk_file_info *ae, if (ae->link_target == NULL) { int flags = O_RDWR | O_CREAT | O_TRUNC; - if (apk_flags & APK_NEVER_OVERWRITE) - flags |= O_EXCL; - fd = openat(atfd, fn, flags, ae->mode & 07777); if (fd < 0) { - if ((apk_flags & APK_NEVER_OVERWRITE) && - (errno == EEXIST)) - return 0; r = -1; break; } |