diff --git a/packages/dpkg/build.sh b/packages/dpkg/build.sh index 7c81f4614..1f8a3847a 100755 --- a/packages/dpkg/build.sh +++ b/packages/dpkg/build.sh @@ -1,7 +1,6 @@ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/dpkg TERMUX_PKG_DESCRIPTION="Debian package management system" -TERMUX_PKG_VERSION=1.17.25 -TERMUX_PKG_BUILD_REVISION=1 +TERMUX_PKG_VERSION=1.18.2 TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/d/dpkg/dpkg_${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-dselect --disable-shared --disable-start-stop-daemon --disable-largefile --disable-update-alternatives --host=${TERMUX_ARCH}-linux --without-selinux dpkg_cv_c99_snprintf=yes ac_cv_lib_selinux_setexecfilecon=no HAVE_SETEXECFILECON_FALSE=#" TERMUX_PKG_RM_AFTER_INSTALL="lib/perl5 share/perl5 lib/dpkg/parsechangelog bin/dpkg-architecture bin/dpkg-buildflags bin/dpkg-buildpackage bin/dpkg-checkbuilddeps bin/dpkg-distaddfile bin/dpkg-genchanges bin/dpkg-gencontrol bin/dpkg-gensymbols bin/dpkg-maintscript-helper bin/dpkg-mergechangelogs bin/dpkg-name bin/dpkg-parsechangelog bin/dpkg-scanpackages bin/dpkg-scansources bin/dpkg-shlibdeps bin/dpkg-source bin/dpkg-statoverride bin/dpkg-vendor share/man/man1/dpkg-architecture.1 share/man/man1/dpkg-buildflags.1 share/man/man1/dpkg-buildpackage.1 share/man/man1/dpkg-checkbuilddeps.1 share/man/man1/dpkg-distaddfile.1 share/man/man1/dpkg-genchanges.1 share/man/man1/dpkg-gencontrol.1 share/man/man1/dpkg-gensymbols.1 share/man/man1/dpkg-maintscript-helper.1 share/man/man1/dpkg-mergechangelogs.1 share/man/man1/dpkg-name.1 share/man/man1/dpkg-parsechangelog.1 share/man/man1/dpkg-scanpackages.1 share/man/man1/dpkg-scansources.1 share/man/man1/dpkg-shlibdeps.1 share/man/man1/dpkg-source.1 share/man/man1/dpkg-vendor.1 share/man/man8/dpkg-statoverride.8 share/man/man3" diff --git a/packages/dpkg/help.c.patch b/packages/dpkg/help.c.patch deleted file mode 100644 index a64193748..000000000 --- a/packages/dpkg/help.c.patch +++ /dev/null @@ -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 ... */ diff --git a/packages/dpkg/lib-dpkg-atomic-file.c.patch b/packages/dpkg/lib-dpkg-atomic-file.c.patch index 0a5db775e..79f0156f0 100644 --- a/packages/dpkg/lib-dpkg-atomic-file.c.patch +++ b/packages/dpkg/lib-dpkg-atomic-file.c.patch @@ -1,7 +1,7 @@ -diff -u -r ../dpkg-1.17.25/lib/dpkg/atomic-file.c ./lib/dpkg/atomic-file.c ---- ../dpkg-1.17.25/lib/dpkg/atomic-file.c 2015-04-09 17:40:47.000000000 -0400 -+++ ./lib/dpkg/atomic-file.c 2015-07-08 22:18:48.766580146 -0400 -@@ -90,8 +90,12 @@ +diff -u -r ../dpkg-1.18.2/lib/dpkg/atomic-file.c ./lib/dpkg/atomic-file.c +--- ../dpkg-1.18.2/lib/dpkg/atomic-file.c 2015-07-12 22:38:47.000000000 -0400 ++++ ./lib/dpkg/atomic-file.c 2015-08-25 18:06:51.689715379 -0400 +@@ -90,8 +90,11 @@ if (unlink(name_old) && errno != ENOENT) ohshite(_("error removing old backup file '%s'"), name_old); @@ -9,9 +9,8 @@ diff -u -r ../dpkg-1.17.25/lib/dpkg/atomic-file.c ./lib/dpkg/atomic-file.c - ohshite(_("error creating new backup file '%s'"), name_old); + if (link(file->name, name_old) && errno != ENOENT) { + /* Termux modification: Try with rename(2) for systems not supporting hardlinks. */ -+ if (rename(file->name, name_old)) { ++ if (rename(file->name, name_old)) + ohshite(_("error creating new backup file '%s'"), name_old); -+ } + } free(name_old); diff --git a/packages/dpkg/lib-dpkg-path-remove.c.patch b/packages/dpkg/lib-dpkg-path-remove.c.patch new file mode 100644 index 000000000..7dadf256f --- /dev/null +++ b/packages/dpkg/lib-dpkg-path-remove.c.patch @@ -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 diff --git a/packages/dpkg/lib-dpkg-triglib.c.patch b/packages/dpkg/lib-dpkg-triglib.c.patch new file mode 100644 index 000000000..f15702aa3 --- /dev/null +++ b/packages/dpkg/lib-dpkg-triglib.c.patch @@ -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) { diff --git a/packages/dpkg/archives_dont_chown.patch b/packages/dpkg/src-archives.c.patch similarity index 51% rename from packages/dpkg/archives_dont_chown.patch rename to packages/dpkg/src-archives.c.patch index cc45f03d0..9ae0f41b2 100644 --- a/packages/dpkg/archives_dont_chown.patch +++ b/packages/dpkg/src-archives.c.patch @@ -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"), -+ ti->name); ++ if (rename(fnamevb.buf,fnametmpvb.buf)) { ++ ohshite(_("unable to make backup link of '%.255s' before installing new version"), ++ ti->name); ++ } } } diff --git a/packages/dpkg/src-help.c.patch b/packages/dpkg/src-help.c.patch new file mode 100644 index 000000000..48db6e51d --- /dev/null +++ b/packages/dpkg/src-help.c.patch @@ -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 diff --git a/packages/dpkg/src-statcmd.c.patch b/packages/dpkg/src-statcmd.c.patch new file mode 100644 index 000000000..e36af78e3 --- /dev/null +++ b/packages/dpkg/src-statcmd.c.patch @@ -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); + diff --git a/packages/dpkg/statcmd_dont_chown.patch b/packages/dpkg/statcmd_dont_chown.patch deleted file mode 100644 index a30efc339..000000000 --- a/packages/dpkg/statcmd_dont_chown.patch +++ /dev/null @@ -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); - } diff --git a/packages/dpkg/strsignal.c.patch b/packages/dpkg/strsignal.c.patch deleted file mode 100644 index a84650ee9..000000000 --- a/packages/dpkg/strsignal.c.patch +++ /dev/null @@ -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; diff --git a/packages/dpkg/triglib_dont_chown_root.patch b/packages/dpkg/triglib_dont_chown_root.patch deleted file mode 100644 index 097df6e60..000000000 --- a/packages/dpkg/triglib_dont_chown_root.patch +++ /dev/null @@ -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) {