From d676463e5912443488b21c0e6bf31840f1a2bd90 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Sun, 12 May 2019 22:00:46 +0300 Subject: [PATCH] dpkg: use busybox for rm and tar --- packages/dpkg/extract.c.patch | 19 +++++++++++++------ packages/dpkg/help.c.patch | 13 +++++++++++++ packages/dpkg/lib-dpkg-path-remove.c.patch | 9 +++++++++ 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 packages/dpkg/help.c.patch diff --git a/packages/dpkg/extract.c.patch b/packages/dpkg/extract.c.patch index 6f2b9a88c..a53c4df60 100644 --- a/packages/dpkg/extract.c.patch +++ b/packages/dpkg/extract.c.patch @@ -1,9 +1,16 @@ -Remove tar options not supported by busybox tar. - -diff -u -r ../dpkg-1.17.10/dpkg-deb/extract.c ./dpkg-deb/extract.c ---- ../dpkg-1.17.10/dpkg-deb/extract.c 2014-06-04 02:02:54.000000000 +0200 -+++ ./dpkg-deb/extract.c 2014-07-01 16:40:02.785848137 +0200 -@@ -327,14 +327,20 @@ +diff -uNr dpkg-1.19.4/dpkg-deb/extract.c dpkg-1.19.4.mod/dpkg-deb/extract.c +--- dpkg-1.19.4/dpkg-deb/extract.c 2019-01-23 04:31:39.000000000 +0200 ++++ dpkg-1.19.4.mod/dpkg-deb/extract.c 2019-05-12 21:51:55.872339882 +0300 +@@ -309,7 +309,7 @@ + if (!c3) { + struct command cmd; + +- command_init(&cmd, TAR, "tar"); ++ command_init(&cmd, "busybox", "tar"); + command_add_arg(&cmd, "tar"); + + if ((taroption & DPKG_TAR_LIST) && (taroption & DPKG_TAR_EXTRACT)) +@@ -321,14 +321,20 @@ else internerr("unknown or missing tar action '%d'", taroption); diff --git a/packages/dpkg/help.c.patch b/packages/dpkg/help.c.patch new file mode 100644 index 000000000..ae3dc5106 --- /dev/null +++ b/packages/dpkg/help.c.patch @@ -0,0 +1,13 @@ +diff -uNr dpkg-1.19.4/src/help.c dpkg-1.19.4.mod/src/help.c +--- dpkg-1.19.4/src/help.c 2019-01-23 14:04:28.000000000 +0200 ++++ dpkg-1.19.4.mod/src/help.c 2019-05-12 22:08:27.729956232 +0300 +@@ -114,8 +114,7 @@ + void checkpath(void) { + static const char *const prog_list[] = { + DEFAULTSHELL, +- RM, +- TAR, ++ "busybox", + DIFF, + BACKEND, + /* Mac OS X uses dyld (Mach-O) instead of ld.so (ELF), and does not have diff --git a/packages/dpkg/lib-dpkg-path-remove.c.patch b/packages/dpkg/lib-dpkg-path-remove.c.patch index 7dadf256f..c8c6a4b53 100644 --- a/packages/dpkg/lib-dpkg-path-remove.c.patch +++ b/packages/dpkg/lib-dpkg-path-remove.c.patch @@ -18,3 +18,12 @@ diff -u -r ../dpkg-1.18.2/lib/dpkg/path-remove.c ./lib/dpkg/path-remove.c return; if (errno == ENOTDIR) { /* Either it's a file, or one of the path components is. If +@@ -149,7 +149,7 @@ + + pid = subproc_fork(); + if (pid == 0) { +- execlp(RM, "rm", "-rf", "--", pathname, NULL); ++ execlp("@TERMUX_PREFIX@/bin/busybox", "rm", "-rf", "--", pathname, NULL); + ohshite(_("unable to execute %s (%s)"), + _("rm command for cleanup"), RM); + }