From 257b3744d17bece52f51f3dfef14e20eb0386046 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Wed, 16 Mar 2016 10:53:16 -0400 Subject: [PATCH 1/1] dpkg: Do not even try creating hardlinks We now that it will fail on Android (from 6.0 on), and this only causes a lot of warning output about denied system call in logcat. --- packages/dpkg/build.sh | 2 +- packages/dpkg/lib-dpkg-atomic-file.c.patch | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/dpkg/build.sh b/packages/dpkg/build.sh index af5b7a5f..a03d2456 100755 --- a/packages/dpkg/build.sh +++ b/packages/dpkg/build.sh @@ -1,7 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://packages.debian.org/dpkg TERMUX_PKG_DESCRIPTION="Debian package management system" TERMUX_PKG_VERSION=1.18.4 -TERMUX_PKG_BUILD_REVISION=1 +TERMUX_PKG_BUILD_REVISION=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_EXTRA_CONFIGURE_ARGS+=" --without-bz2" diff --git a/packages/dpkg/lib-dpkg-atomic-file.c.patch b/packages/dpkg/lib-dpkg-atomic-file.c.patch index 79f0156f..a4cf91a0 100644 --- a/packages/dpkg/lib-dpkg-atomic-file.c.patch +++ b/packages/dpkg/lib-dpkg-atomic-file.c.patch @@ -1,16 +1,19 @@ 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 @@ +@@ -90,8 +90,14 @@ if (unlink(name_old) && errno != ENOENT) ohshite(_("error removing old backup file '%s'"), name_old); - if (link(file->name, name_old) && errno != ENOENT) - ohshite(_("error creating new backup file '%s'"), name_old); ++#ifdef __ANDROID__ ++ /* Termux: Use rename(2) since Android does not support hardlinks. */ ++ if (rename(file->name, name_old) && errno != ENOENT) { ++#else + 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)) -+ ohshite(_("error creating new backup file '%s'"), name_old); ++#endif ++ ohshite(_("error creating new backup file '%s'"), name_old); + } free(name_old); -- 2.11.0