From ee1dcc97547e2c852cd20ec994ac903a37d1e03d Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Thu, 3 Mar 2016 17:45:46 -0500 Subject: [PATCH] dpkg: Fix conffiles handling - Use 'less' as default pager instead of 'pager'. - Fix configure.c to work without hard links. --- packages/dpkg/build.sh | 1 + packages/dpkg/lib-dpkg-dpkg.h.patch | 12 ++++++++++++ packages/dpkg/src-configure.c.patch | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 packages/dpkg/lib-dpkg-dpkg.h.patch create mode 100644 packages/dpkg/src-configure.c.patch diff --git a/packages/dpkg/build.sh b/packages/dpkg/build.sh index b6840d705..af5b7a5f7 100755 --- a/packages/dpkg/build.sh +++ b/packages/dpkg/build.sh @@ -1,6 +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_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-dpkg.h.patch b/packages/dpkg/lib-dpkg-dpkg.h.patch new file mode 100644 index 000000000..a3a85e5cf --- /dev/null +++ b/packages/dpkg/lib-dpkg-dpkg.h.patch @@ -0,0 +1,12 @@ +diff -u -r ../dpkg-1.18.4/lib/dpkg/dpkg.h ./lib/dpkg/dpkg.h +--- ../dpkg-1.18.4/lib/dpkg/dpkg.h 2015-12-12 15:49:24.000000000 -0500 ++++ ./lib/dpkg/dpkg.h 2016-03-03 17:30:57.812372682 -0500 +@@ -92,7 +92,7 @@ + #define MAXUPDATES 250 + + #define DEFAULTSHELL "sh" +-#define DEFAULTPAGER "pager" ++#define DEFAULTPAGER "less" + + #define MD5HASHLEN 32 + #define MAXTRIGDIRECTIVE 256 diff --git a/packages/dpkg/src-configure.c.patch b/packages/dpkg/src-configure.c.patch new file mode 100644 index 000000000..b5863759d --- /dev/null +++ b/packages/dpkg/src-configure.c.patch @@ -0,0 +1,16 @@ +diff -u -r ../dpkg-1.18.4/src/configure.c ./src/configure.c +--- ../dpkg-1.18.4/src/configure.c 2015-11-26 18:53:41.000000000 -0500 ++++ ./src/configure.c 2016-03-03 17:41:42.494272593 -0500 +@@ -496,8 +496,10 @@ + pkg_name(pkg, pnaw_nonambig), cdr2.buf, + strerror(errno)); + if (!(what & CFOF_USER_DEL)) +- if (link(cdr.buf, cdr2.buf)) +- warning(_("%s: failed to link '%.250s' to '%.250s': %s"), ++ /** Termux modification: Use rename(2) instead of link(2), to avoid hard ++ links which does not work on Android 6.0 or later. */ ++ if (rename(cdr.buf, cdr2.buf)) ++ warning(_("%s: failed to rename '%.250s' to '%.250s': %s"), + pkg_name(pkg, pnaw_nonambig), cdr.buf, + cdr2.buf, strerror(errno)); + /* Fall through. */