diff options
author | Ron Yorston <rmy@pobox.com> | 2020-07-09 13:10:58 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-07-09 13:10:58 +0100 |
commit | 9c0b2f7020d7c30b21a930ef54be632e092e533b (patch) | |
tree | b2187c40bd2fd9f49f73599fb08e52cb7a596de0 /archival | |
parent | a8c6e20e332a9e11a9d28cd6770eadb9c9d73cb7 (diff) | |
parent | d21a63f9fca8eb16f79de9b72d4a3484dfaec1fc (diff) | |
download | busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.gz busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.tar.bz2 busybox-w32-9c0b2f7020d7c30b21a930ef54be632e092e533b.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'archival')
-rw-r--r-- | archival/bbunzip.c | 2 | ||||
-rw-r--r-- | archival/cpio.c | 1 | ||||
-rw-r--r-- | archival/dpkg.c | 23 |
3 files changed, 25 insertions, 1 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c index da6f031e3..320fe4fd1 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c | |||
@@ -388,7 +388,7 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv) | |||
388 | * Normally, "zcat" is just "gunzip -c". | 388 | * Normally, "zcat" is just "gunzip -c". |
389 | * But if seamless magic is enabled, then we are much more clever. | 389 | * But if seamless magic is enabled, then we are much more clever. |
390 | */ | 390 | */ |
391 | if (ENABLE_ZCAT && (!ENABLE_GUNZIP || applet_name[1] == 'c')) | 391 | if (ENABLE_ZCAT && applet_name[1] == 'c') |
392 | option_mask32 |= BBUNPK_OPT_STDOUT | BBUNPK_SEAMLESS_MAGIC; | 392 | option_mask32 |= BBUNPK_OPT_STDOUT | BBUNPK_SEAMLESS_MAGIC; |
393 | 393 | ||
394 | return bbunpack(argv, unpack_gz_stream, make_new_name_gunzip, /*unused:*/ NULL); | 394 | return bbunpack(argv, unpack_gz_stream, make_new_name_gunzip, /*unused:*/ NULL); |
diff --git a/archival/cpio.c b/archival/cpio.c index 0f37ffbb9..94b4b8174 100644 --- a/archival/cpio.c +++ b/archival/cpio.c | |||
@@ -516,6 +516,7 @@ int cpio_main(int argc UNUSED_PARAM, char **argv) | |||
516 | if (archive_handle->cpio__blocks != (off_t)-1 | 516 | if (archive_handle->cpio__blocks != (off_t)-1 |
517 | && !(opt & OPT_QUIET) | 517 | && !(opt & OPT_QUIET) |
518 | ) { | 518 | ) { |
519 | fflush_all(); | ||
519 | fprintf(stderr, "%"OFF_FMT"u blocks\n", archive_handle->cpio__blocks); | 520 | fprintf(stderr, "%"OFF_FMT"u blocks\n", archive_handle->cpio__blocks); |
520 | } | 521 | } |
521 | 522 | ||
diff --git a/archival/dpkg.c b/archival/dpkg.c index 6f28b994c..61631bd4d 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1209,6 +1209,27 @@ static char **create_list(const char *filename) | |||
1209 | return file_list; | 1209 | return file_list; |
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | /** This tests if the filename is an "important" directory, which might be symlinked. | ||
1213 | * Debians dpkg test if directories are used by other packages, this | ||
1214 | * implementation doesn't and would remove for ex. an lib -> usr/lib symlink. | ||
1215 | */ | ||
1216 | static int is_builtin_exclude(const char *name) | ||
1217 | { | ||
1218 | if (*name++ != '/') | ||
1219 | return 0; | ||
1220 | if (index_in_strings(".\0" "etc\0" "opt\0" "srv\0" "var\0" "var/lib\0", | ||
1221 | name) >= 0) | ||
1222 | return 1; | ||
1223 | if (is_prefixed_with(name, "usr/")) { | ||
1224 | name += sizeof("usr/") - 1; | ||
1225 | if (is_prefixed_with(name, "local/")) | ||
1226 | name += sizeof("local/") - 1; | ||
1227 | } | ||
1228 | |||
1229 | return index_in_strings("bin\0" "lib\0" "lib32\0" "lib64\0" "sbin\0", | ||
1230 | name) >= 0; | ||
1231 | } | ||
1232 | |||
1212 | /* maybe i should try and hook this into remove_file.c somehow */ | 1233 | /* maybe i should try and hook this into remove_file.c somehow */ |
1213 | static int remove_file_array(char **remove_names, char **exclude_names) | 1234 | static int remove_file_array(char **remove_names, char **exclude_names) |
1214 | { | 1235 | { |
@@ -1220,6 +1241,8 @@ static int remove_file_array(char **remove_names, char **exclude_names) | |||
1220 | return 0; | 1241 | return 0; |
1221 | } | 1242 | } |
1222 | for (i = 0; remove_names[i] != NULL; i++) { | 1243 | for (i = 0; remove_names[i] != NULL; i++) { |
1244 | if (is_builtin_exclude(remove_names[i])) | ||
1245 | continue; | ||
1223 | if (exclude_names != NULL) { | 1246 | if (exclude_names != NULL) { |
1224 | for (j = 0; exclude_names[j] != NULL; j++) { | 1247 | for (j = 0; exclude_names[j] != NULL; j++) { |
1225 | if (strcmp(remove_names[i], exclude_names[j]) == 0) { | 1248 | if (strcmp(remove_names[i], exclude_names[j]) == 0) { |