dpkg: Fix conffiles handling
authorFredrik Fornwall <fredrik@fornwall.net>
Thu, 3 Mar 2016 22:45:46 +0000 (17:45 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Thu, 3 Mar 2016 22:45:46 +0000 (17:45 -0500)
- Use 'less' as default pager instead of 'pager'.
- Fix configure.c to work without hard links.

packages/dpkg/build.sh
packages/dpkg/lib-dpkg-dpkg.h.patch [new file with mode: 0644]
packages/dpkg/src-configure.c.patch [new file with mode: 0644]

index b6840d7..af5b7a5 100755 (executable)
@@ -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 (file)
index 0000000..a3a85e5
--- /dev/null
@@ -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 (file)
index 0000000..b586375
--- /dev/null
@@ -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. */