Fredrik Fornwall
9 years ago
11 changed files with 89 additions and 116 deletions
@ -1,39 +0,0 @@ |
|||
(1) Do not check for ldconfig in checkpath() |
|||
(2) Handle EROFS in ensure_pathname_nonexisting(). |
|||
This is since ensure_pathname_nonexisting() will be called with |
|||
'/data.dpkg-tmp' |
|||
'/data/data.dpkg-tmp' |
|||
'/data/data/com.termux.dpkg-tmp' |
|||
'/data/data/com.termux/files.dpkg-tmp' |
|||
'/data/data/com.termux/files/usr.dpkg-tmp' |
|||
and the first call will get a EROFS, read-only file system error. |
|||
|
|||
diff -u -r ../dpkg-1.17.23/src/help.c ./src/help.c
|
|||
--- ../dpkg-1.17.23/src/help.c 2014-12-27 17:21:19.000000000 -0500
|
|||
+++ ./src/help.c 2015-01-01 19:08:58.868327880 -0500
|
|||
@@ -89,12 +89,14 @@
|
|||
TAR, |
|||
FIND, |
|||
BACKEND, |
|||
+#ifndef __ANDROID__
|
|||
/* Mac OS X uses dyld (Mach-O) instead of ld.so (ELF), and does not have |
|||
* an ldconfig. */ |
|||
-#if defined(__APPLE__) && defined(__MACH__)
|
|||
+# if defined(__APPLE__) && defined(__MACH__)
|
|||
"update_dyld_shared_cache", |
|||
-#else
|
|||
+# else
|
|||
"ldconfig", |
|||
+# endif
|
|||
#endif |
|||
#if BUILD_START_STOP_DAEMON |
|||
"start-stop-daemon", |
|||
@@ -376,7 +378,7 @@
|
|||
debug(dbg_eachfile, "ensure_pathname_nonexisting '%s'", pathname); |
|||
if (!rmdir(pathname)) |
|||
return; /* Deleted it OK, it was a directory. */ |
|||
- if (errno == ENOENT || errno == ELOOP) return;
|
|||
+ if (errno == ENOENT || errno == ELOOP || errno == EROFS) return;
|
|||
if (errno == ENOTDIR) { |
|||
/* Either it's a file, or one of the path components is. If one |
|||
* of the path components is this will fail again ... */ |
@ -0,0 +1,20 @@ |
|||
Handle EROFS. This is since path_remove_tree() will be called with |
|||
'/data.dpkg-tmp' |
|||
'/data/data.dpkg-tmp' |
|||
'/data/data/com.termux.dpkg-tmp' |
|||
'/data/data/com.termux/files.dpkg-tmp' |
|||
'/data/data/com.termux/files/usr.dpkg-tmp' |
|||
and the first call will get a EROFS, read-only file system error. |
|||
|
|||
diff -u -r ../dpkg-1.18.2/lib/dpkg/path-remove.c ./lib/dpkg/path-remove.c
|
|||
--- ../dpkg-1.18.2/lib/dpkg/path-remove.c 2015-07-30 00:39:24.000000000 -0400
|
|||
+++ ./lib/dpkg/path-remove.c 2015-08-25 18:04:31.391421421 -0400
|
|||
@@ -126,7 +126,7 @@
|
|||
debug(dbg_eachfile, "%s '%s'", __func__, pathname); |
|||
if (!rmdir(pathname)) |
|||
return; /* Deleted it OK, it was a directory. */ |
|||
- if (errno == ENOENT || errno == ELOOP)
|
|||
+ if (errno == ENOENT || errno == ELOOP || errno == EROFS)
|
|||
return; |
|||
if (errno == ENOTDIR) { |
|||
/* Either it's a file, or one of the path components is. If |
@ -0,0 +1,18 @@ |
|||
diff -u -r ../dpkg-1.18.2/lib/dpkg/triglib.c ./lib/dpkg/triglib.c
|
|||
--- ../dpkg-1.18.2/lib/dpkg/triglib.c 2015-07-12 22:38:47.000000000 -0400
|
|||
+++ ./lib/dpkg/triglib.c 2015-08-25 17:54:10.350853590 -0400
|
|||
@@ -787,10 +787,13 @@
|
|||
if (errno != EEXIST) |
|||
ohshite(_("unable to create triggers state" |
|||
" directory '%.250s'"), triggersdir); |
|||
- } else if (chown(triggersdir, 0, 0)) {
|
|||
+ }
|
|||
+#ifndef __ANDROID__
|
|||
+ else if (chown(triggersdir, 0, 0)) {
|
|||
ohshite(_("unable to set ownership of triggers state" |
|||
" directory '%.250s'"), triggersdir); |
|||
} |
|||
+#endif
|
|||
ur = trigdef_update_start(tduf); |
|||
} |
|||
switch (ur) { |
@ -1,51 +1,52 @@ |
|||
diff -u -r ../dpkg-1.17.25/src/archives.c ./src/archives.c
|
|||
--- ../dpkg-1.17.25/src/archives.c 2015-04-09 17:40:47.000000000 -0400
|
|||
+++ ./src/archives.c 2015-07-09 20:56:04.604894782 -0400
|
|||
@@ -359,8 +359,10 @@
|
|||
diff -u -r ../dpkg-1.18.2/src/archives.c ./src/archives.c
|
|||
--- ../dpkg-1.18.2/src/archives.c 2015-07-13 09:53:37.000000000 -0400
|
|||
+++ ./src/archives.c 2015-08-25 17:59:35.594992908 -0400
|
|||
@@ -352,8 +352,10 @@
|
|||
namenode->statoverride->uid, |
|||
namenode->statoverride->gid, |
|||
namenode->statoverride->mode); |
|||
+#ifndef __ANDROID__
|
|||
if (fchown(fd, st->uid, st->gid)) |
|||
ohshite(_("error setting ownership of `%.255s'"), te->name); |
|||
ohshite(_("error setting ownership of '%.255s'"), te->name); |
|||
+#endif
|
|||
if (fchmod(fd, st->mode & ~S_IFMT)) |
|||
ohshite(_("error setting permissions of `%.255s'"), te->name); |
|||
ohshite(_("error setting permissions of '%.255s'"), te->name); |
|||
|
|||
@@ -472,11 +474,15 @@
|
|||
@@ -465,11 +467,15 @@
|
|||
return; /* Already handled using the file descriptor. */ |
|||
|
|||
if (te->type == TAR_FILETYPE_SYMLINK) { |
|||
+#ifndef __ANDROID__
|
|||
if (lchown(path, st->uid, st->gid)) |
|||
ohshite(_("error setting ownership of symlink `%.255s'"), path); |
|||
ohshite(_("error setting ownership of symlink '%.255s'"), path); |
|||
+#endif
|
|||
} else { |
|||
+#ifndef __ANDROID__
|
|||
if (chown(path, st->uid, st->gid)) |
|||
ohshite(_("error setting ownership of `%.255s'"), path); |
|||
ohshite(_("error setting ownership of '%.255s'"), path); |
|||
+#endif
|
|||
if (chmod(path, st->mode & ~S_IFMT)) |
|||
ohshite(_("error setting permissions of `%.255s'"), path); |
|||
ohshite(_("error setting permissions of '%.255s'"), path); |
|||
} |
|||
@@ -1148,14 +1154,18 @@
|
|||
@@ -1022,14 +1028,19 @@
|
|||
varbuf_end_str(&symlinkfn); |
|||
if (symlink(symlinkfn.buf,fnametmpvb.buf)) |
|||
ohshite(_("unable to make backup symlink for `%.255s'"), ti->name); |
|||
ohshite(_("unable to make backup symlink for '%.255s'"), ti->name); |
|||
+#ifndef __ANDROID__
|
|||
if (lchown(fnametmpvb.buf,stab.st_uid,stab.st_gid)) |
|||
ohshite(_("unable to chown backup symlink for `%.255s'"), ti->name); |
|||
ohshite(_("unable to chown backup symlink for '%.255s'"), ti->name); |
|||
+#endif
|
|||
tarobject_set_se_context(fnamevb.buf, fnametmpvb.buf, stab.st_mode); |
|||
} else { |
|||
debug(dbg_eachfiledetail, "tarobject nondirectory, 'link' backup"); |
|||
+ /* Termux modification: Try with rename(2) for systems not supporting hardlinks. */
|
|||
if (link(fnamevb.buf,fnametmpvb.buf)) |
|||
- ohshite(_("unable to make backup link of `%.255s' before installing new version"),
|
|||
- ohshite(_("unable to make backup link of '%.255s' before installing new version"),
|
|||
- ti->name);
|
|||
+ /* Termux modification: Try with rename(2) for systems not supporting hardlinks. */
|
|||
+ if (rename(fnamevb.buf,fnametmpvb.buf))
|
|||
+ ohshite(_("unable to make backup link of `%.255s' before installing new version"),
|
|||
+ if (rename(fnamevb.buf,fnametmpvb.buf)) {
|
|||
+ ohshite(_("unable to make backup link of '%.255s' before installing new version"),
|
|||
+ ti->name);
|
|||
+ }
|
|||
} |
|||
} |
|||
|
@ -0,0 +1,12 @@ |
|||
diff -u -r ../dpkg-1.18.2/src/help.c ./src/help.c
|
|||
--- ../dpkg-1.18.2/src/help.c 2015-07-13 09:53:37.000000000 -0400
|
|||
+++ ./src/help.c 2015-08-25 18:09:39.779664557 -0400
|
|||
@@ -91,7 +91,7 @@
|
|||
* an ldconfig. */ |
|||
#if defined(__APPLE__) && defined(__MACH__) |
|||
"update_dyld_shared_cache", |
|||
-#else
|
|||
+#elif !defined(__ANDROID__)
|
|||
"ldconfig", |
|||
#endif |
|||
#if BUILD_START_STOP_DAEMON |
@ -0,0 +1,14 @@ |
|||
diff -u -r ../dpkg-1.18.2/src/statcmd.c ./src/statcmd.c
|
|||
--- ../dpkg-1.18.2/src/statcmd.c 2015-07-12 22:38:47.000000000 -0400
|
|||
+++ ./src/statcmd.c 2015-08-25 18:07:59.388890175 -0400
|
|||
@@ -161,8 +161,10 @@
|
|||
static void |
|||
statdb_node_apply(const char *filename, struct file_stat *filestat) |
|||
{ |
|||
+#ifndef __ANDROID__
|
|||
if (chown(filename, filestat->uid, filestat->gid) < 0) |
|||
ohshite(_("error setting ownership of '%.255s'"), filename); |
|||
+#endif
|
|||
if (chmod(filename, filestat->mode & ~S_IFMT)) |
|||
ohshite(_("error setting permissions of '%.255s'"), filename); |
|||
|
@ -1,14 +0,0 @@ |
|||
diff -u -r ../dpkg-1.17.6/src/statcmd.c ./src/statcmd.c
|
|||
--- ../dpkg-1.17.6/src/statcmd.c 2013-12-14 06:46:59.000000000 +0100
|
|||
+++ ./src/statcmd.c 2014-02-26 08:22:05.000000000 +0100
|
|||
@@ -155,8 +155,10 @@
|
|||
static void |
|||
statdb_node_apply(const char *filename, struct file_stat *filestat) |
|||
{ |
|||
+#ifndef __ANDROID__
|
|||
if (chown(filename, filestat->uid, filestat->gid) < 0) |
|||
ohshite(_("error setting ownership of `%.255s'"), filename); |
|||
+#endif
|
|||
if (chmod(filename, filestat->mode)) |
|||
ohshite(_("error setting permissions of `%.255s'"), filename); |
|||
} |
@ -1,19 +0,0 @@ |
|||
strsignal.c is only compiled for the tests, but fails with: |
|||
|
|||
strsignal.c:66:31: error: invalid application of 'sizeof' to incomplete type 'const char * const[]' |
|||
if (s > 0 && s < (int)(sizeof(sys_siglist) / sizeof(sys_siglist[0]))) |
|||
diff -u -r ../dpkg-1.17.11/lib/compat/strsignal.c ./lib/compat/strsignal.c
|
|||
--- ../dpkg-1.17.11/lib/compat/strsignal.c 2014-08-09 22:03:58.000000000 +0200
|
|||
+++ ./lib/compat/strsignal.c 2014-08-13 20:57:32.998986392 +0200
|
|||
@@ -63,9 +63,10 @@
|
|||
{ |
|||
static char buf[100]; |
|||
|
|||
+#ifndef __ANDROID__
|
|||
if (s > 0 && s < (int)(sizeof(sys_siglist) / sizeof(sys_siglist[0]))) |
|||
return sys_siglist[s]; |
|||
-
|
|||
+#endif
|
|||
sprintf(buf, _("Unknown signal %d"), s); |
|||
|
|||
return buf; |
@ -1,18 +0,0 @@ |
|||
diff -u -r ../dpkg-1.17.6/lib/dpkg/triglib.c ./lib/dpkg/triglib.c
|
|||
--- ../dpkg-1.17.6/lib/dpkg/triglib.c 2013-12-14 06:30:58.000000000 +0100
|
|||
+++ ./lib/dpkg/triglib.c 2014-02-25 18:14:43.000000000 +0100
|
|||
@@ -776,10 +776,13 @@
|
|||
if (errno != EEXIST) |
|||
ohshite(_("unable to create triggers state" |
|||
" directory `%.250s'"), triggersdir); |
|||
- } else if (chown(triggersdir, 0, 0)) {
|
|||
+ }
|
|||
+#ifndef __ANDROID__
|
|||
+ else if (chown(triggersdir, 0, 0)) {
|
|||
ohshite(_("unable to set ownership of triggers state" |
|||
" directory `%.250s'"), triggersdir); |
|||
} |
|||
+#endif
|
|||
ur = trigdef_update_start(tduf); |
|||
} |
|||
switch (ur) { |
Loading…
Reference in new issue