aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-04-27 08:02:15 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-04-27 08:04:58 +0000
commitff74987622997a07657523ef81496b7b8afa18ec (patch)
tree4bcaedd3c5a1baee1b993ec6abf8566070219ea1
parent66454d9b279beebab7c35a15bf54671cdfbbf692 (diff)
downloadaports-ff74987622997a07657523ef81496b7b8afa18ec.tar.bz2
aports-ff74987622997a07657523ef81496b7b8afa18ec.tar.xz
main/busybox: backport tar --no-recursion
-rw-r--r--main/busybox/0001-tar-Implement-no-recursion.patch112
-rw-r--r--main/busybox/APKBUILD4
2 files changed, 115 insertions, 1 deletions
diff --git a/main/busybox/0001-tar-Implement-no-recursion.patch b/main/busybox/0001-tar-Implement-no-recursion.patch
new file mode 100644
index 0000000000..b457c50c93
--- /dev/null
+++ b/main/busybox/0001-tar-Implement-no-recursion.patch
@@ -0,0 +1,112 @@
+From abc357b4612ac02e9246eccdde8dcfcda81a5433 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Tue, 24 Apr 2012 17:02:15 +0200
+Subject: [PATCH] tar: Implement --no-recursion
+
+bloatcheck on x86_64:
+
+function old new delta
+tar_longopts 259 274 +15
+.rodata 5757 5772 +15
+tar_main 1038 1052 +14
+writeTarFile 362 353 -9
+------------------------------------------------------------------------------
+(add/remove: 0/0 grow/shrink: 3/1 up/down: 44/-9) Total: 35 bytes
+ text data bss dec hex filename
+ 81457 1706 8344 91507 16573 busybox_old
+ 81477 1706 8344 91527 16587 busybox_unstripped
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ archival/tar.c | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/archival/tar.c b/archival/tar.c
+index cf972c2..a64d651 100644
+--- a/archival/tar.c
++++ b/archival/tar.c
+@@ -60,8 +60,8 @@
+
+ #if !ENABLE_FEATURE_SEAMLESS_GZ && !ENABLE_FEATURE_SEAMLESS_BZ2
+ /* Do not pass gzip flag to writeTarFile() */
+-#define writeTarFile(tar_fd, verboseFlag, dereferenceFlag, include, exclude, gzip) \
+- writeTarFile(tar_fd, verboseFlag, dereferenceFlag, include, exclude)
++#define writeTarFile(tar_fd, verboseFlag, recurseFlags, include, exclude, gzip) \
++ writeTarFile(tar_fd, verboseFlag, recurseFlags, include, exclude)
+ #endif
+
+
+@@ -598,7 +598,7 @@ static void NOINLINE vfork_compressor(int tar_fd, int gzip)
+
+ /* gcc 4.2.1 inlines it, making code bigger */
+ static NOINLINE int writeTarFile(int tar_fd, int verboseFlag,
+- int dereferenceFlag, const llist_t *include,
++ int recurseFlags, const llist_t *include,
+ const llist_t *exclude, int gzip)
+ {
+ int errorFlag = FALSE;
+@@ -621,8 +621,7 @@ static NOINLINE int writeTarFile(int tar_fd, int verboseFlag,
+
+ /* Read the directory/files and iterate over them one at a time */
+ while (include) {
+- if (!recursive_action(include->data, ACTION_RECURSE |
+- (dereferenceFlag ? ACTION_FOLLOWLINKS : 0),
++ if (!recursive_action(include->data, recurseFlags,
+ writeFileToTarball, writeFileToTarball, &tbInfo, 0)
+ ) {
+ errorFlag = TRUE;
+@@ -662,7 +661,7 @@ static NOINLINE int writeTarFile(int tar_fd, int verboseFlag,
+ }
+ #else
+ int writeTarFile(int tar_fd, int verboseFlag,
+- int dereferenceFlag, const llist_t *include,
++ int recurseFlags, const llist_t *include,
+ const llist_t *exclude, int gzip);
+ #endif /* FEATURE_TAR_CREATE */
+
+@@ -749,6 +748,7 @@ static llist_t *append_file_list_to_list(llist_t *list)
+ // o no-same-owner
+ // p same-permissions
+ // k keep-old
++// no-recursion
+ // numeric-owner
+ // no-same-permissions
+ // overwrite
+@@ -768,6 +768,7 @@ enum {
+ IF_FEATURE_SEAMLESS_Z( OPTBIT_COMPRESS ,) // 16th bit
+ IF_FEATURE_TAR_NOPRESERVE_TIME(OPTBIT_NOPRESERVE_TIME,)
+ #if ENABLE_FEATURE_TAR_LONG_OPTIONS
++ OPTBIT_NORECURSION,
+ IF_FEATURE_TAR_TO_COMMAND(OPTBIT_2COMMAND ,)
+ OPTBIT_NUMERIC_OWNER,
+ OPTBIT_NOPRESERVE_PERM,
+@@ -791,6 +792,7 @@ enum {
+ OPT_GZIP = IF_FEATURE_SEAMLESS_GZ( (1 << OPTBIT_GZIP )) + 0, // z
+ OPT_COMPRESS = IF_FEATURE_SEAMLESS_Z( (1 << OPTBIT_COMPRESS )) + 0, // Z
+ OPT_NOPRESERVE_TIME = IF_FEATURE_TAR_NOPRESERVE_TIME((1 << OPTBIT_NOPRESERVE_TIME)) + 0, // m
++ OPT_NORECURSION = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NORECURSION )) + 0, // no-recursion
+ OPT_2COMMAND = IF_FEATURE_TAR_TO_COMMAND( (1 << OPTBIT_2COMMAND )) + 0, // to-command
+ OPT_NUMERIC_OWNER = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NUMERIC_OWNER )) + 0, // numeric-owner
+ OPT_NOPRESERVE_PERM = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NOPRESERVE_PERM)) + 0, // no-same-permissions
+@@ -835,6 +837,7 @@ static const char tar_longopts[] ALIGN1 =
+ # if ENABLE_FEATURE_TAR_NOPRESERVE_TIME
+ "touch\0" No_argument "m"
+ # endif
++ "no-recursion\0" No_argument "\xfa"
+ # if ENABLE_FEATURE_TAR_TO_COMMAND
+ "to-command\0" Required_argument "\xfb"
+ # endif
+@@ -1050,7 +1053,9 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
+ zipMode = 2;
+ #endif
+ /* NB: writeTarFile() closes tar_handle->src_fd */
+- return writeTarFile(tar_handle->src_fd, verboseFlag, opt & OPT_DEREFERENCE,
++ return writeTarFile(tar_handle->src_fd, verboseFlag,
++ (opt & OPT_DEREFERENCE ? ACTION_FOLLOWLINKS : 0)
++ | (opt & OPT_NORECURSION ? 0 : ACTION_RECURSE),
+ tar_handle->accept,
+ tar_handle->reject, zipMode);
+ }
+--
+1.7.10
+
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index 460c753bbd..55512e501d 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
pkgver=1.19.4
-pkgrel=1
+pkgrel=2
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net
arch="all"
@@ -22,6 +22,7 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
busybox-mkdir-permissions-64bit.patch
0001-acpid-do-not-install-handlers-for-fatal-signals.patch
0001-grep-support-for-x-match-whole-line.patch
+ 0001-tar-Implement-no-recursion.patch
busyboxconfig"
@@ -94,4 +95,5 @@ b5375210f13fd6e1ca61a565e8fabd35 busybox-uname-is-not-gnu.patch
78bb1e70897124a0e09d50c425210e83 busybox-mkdir-permissions-64bit.patch
cfafb917f777437f428ea97da0a63915 0001-acpid-do-not-install-handlers-for-fatal-signals.patch
699701047d05468a13e5c37b5ebc3824 0001-grep-support-for-x-match-whole-line.patch
+b0977368029587bab23067f0267ae309 0001-tar-Implement-no-recursion.patch
42e2f49483e650193c0e142ade7de142 busyboxconfig"