summaryrefslogtreecommitdiff
path: root/data/dpkg/runcmd.diff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-08-15 12:42:15 -1000
committerSam Bingner <sam@bingner.com>2018-08-15 12:42:15 -1000
commitc720592809c2211c4d5bea69058abfa8dd0d3f8b (patch)
treec2071d5b35d69b3e3fdb83b1c7bd5dd0778080d1 /data/dpkg/runcmd.diff
parent72a9e76ee8585738e3289a316a2520e8a7a0ad81 (diff)
Update dpkg to support xz and arm64
Diffstat (limited to 'data/dpkg/runcmd.diff')
-rw-r--r--data/dpkg/runcmd.diff45
1 files changed, 45 insertions, 0 deletions
diff --git a/data/dpkg/runcmd.diff b/data/dpkg/runcmd.diff
new file mode 100644
index 000000000..80edf7ee6
--- /dev/null
+++ b/data/dpkg/runcmd.diff
@@ -0,0 +1,45 @@
+--- dpkg-1.18.10/lib/dpkg/command.c 2016-07-04 15:55:13.000000000 -1000
++++ dpkg-1.18.10+iPhone/lib/dpkg/command.c 2018-07-27 18:00:54.000000000 -1000
+@@ -31,6 +31,8 @@
+ #include <dpkg/path.h>
+ #include <dpkg/command.h>
+
++void runcmd(struct command *cmd);
++
+ /**
+ * Initialize a command structure.
+ *
+@@ -178,8 +180,7 @@
+ void
+ command_exec(struct command *cmd)
+ {
+- execvp(cmd->filename, (char * const *)cmd->argv);
+- ohshite(_("unable to execute %s (%s)"), cmd->name, cmd->filename);
++ runcmd(cmd);
+ }
+
+
+@@ -230,3 +231,23 @@
+ execlp(shell, shell, mode, cmd, NULL);
+ ohshite(_("unable to execute %s (%s)"), name, cmd);
+ }
++
++void
++runcmd(struct command *cmd)
++{
++ int i = 0;
++ char cmdstring[cmd->argv_size];
++ char *ptr = cmdstring; // set ptr to the start of the destination buffer
++ for (i=0; i<cmd->argc; i++) {
++ const char *current_arg = cmd->argv[i];
++ char c;
++ while ( (c = *current_arg++) ) {
++ // copy each character to the destination buffer until the end of the current string
++ *ptr++ = c;
++ }
++ *ptr++ = ' '; // or whatever joining character you want
++ }
++ *ptr = '\0'; // null terminate
++ command_shell(cmdstring, cmd->name);
++ ohshite(_("unable to execute %s (%s)"), cmd->name, cmd->filename);
++}