apt: Update from 1.2.12 to 1.4.7

This commit is contained in:
Fredrik Fornwall 2017-09-17 20:51:20 +02:00
parent 3302b5d631
commit d4c093ad5f
38 changed files with 123 additions and 851 deletions

View File

@ -1,28 +0,0 @@
diff -u -r ../apt-1.1.3/apt-pkg/contrib/srvrec.cc ./apt-pkg/contrib/srvrec.cc
--- ../apt-1.1.3/apt-pkg/contrib/srvrec.cc 2015-11-30 03:08:24.000000000 -0500
+++ ./apt-pkg/contrib/srvrec.cc 2015-12-03 16:21:54.397715576 -0500
@@ -40,14 +40,24 @@
struct servent *s_ent = nullptr;
std::vector<char> buf(1024);
+#ifdef __ANDROID__
+ s_ent = getservbyport(htons(port), "tcp");
+ if (s_ent == nullptr) return false;
+#else
res = getservbyport_r(htons(port), "tcp", &s_ent_buf, buf.data(), buf.size(), &s_ent);
if (res != 0 || s_ent == nullptr)
return false;
+#endif
strprintf(target, "_%s._tcp.%s", s_ent->s_name, host.c_str());
return GetSrvRecords(target, Result);
}
+#ifdef __ANDROID__
+extern "C" int __dn_skipname(const unsigned char* comp_dn, const unsigned char* eom);
+static inline int dn_skipname(const unsigned char* a, const unsigned char* b) { return __dn_skipname(a,b); }
+#endif
+
bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result)
{
unsigned char answer[PACKETSZ];

View File

@ -1,19 +0,0 @@
diff -u -r ../apt-1.4.7/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc
--- ../apt-1.4.7/apt-pkg/contrib/strutl.cc 2017-07-13 23:45:39.000000000 +0200
+++ ./apt-pkg/contrib/strutl.cc 2017-07-23 22:58:23.103247428 +0200
@@ -100,6 +100,7 @@
}
}
/*}}}*/
+#ifndef __ANDROID__
// UTF8ToCodeset - Convert some UTF-8 string for some codeset /*{{{*/
// ---------------------------------------------------------------------
/* This is handy to use before display some information for enduser */
@@ -169,6 +170,7 @@
return true;
}
+#endif
/*}}}*/
// strstrip - Remove white space from the front and back of a string /*{{{*/
// ---------------------------------------------------------------------

View File

@ -1,28 +0,0 @@
diff -u -r ../apt-1.1.3/apt-pkg/deb/debrecords.cc ./apt-pkg/deb/debrecords.cc
--- ../apt-1.1.3/apt-pkg/deb/debrecords.cc 2015-11-30 03:08:24.000000000 -0500
+++ ./apt-pkg/deb/debrecords.cc 2015-12-03 16:30:51.506746167 -0500
@@ -25,7 +25,9 @@
#include <sstream>
#include <string>
#include <vector>
+#ifndef __ANDROID__
#include <langinfo.h>
+#endif
#include <apti18n.h>
/*}}}*/
@@ -143,12 +145,14 @@
orig = Section.FindS("Description");
}
+#ifndef __ANDROID__
char const * const codeset = nl_langinfo(CODESET);
if (strcmp(codeset,"UTF-8") != 0) {
string dest;
UTF8ToCodeset(codeset, orig, &dest);
return dest;
}
+#endif
return orig;
}

View File

@ -1,50 +0,0 @@
--- ../cache/apt-1.4.7/apt-pkg/init.cc 2017-07-14 07:45:39.000000000 +1000
+++ ./apt-pkg/init.cc 2017-07-19 17:03:07.949752843 +1000
@@ -51,7 +51,7 @@
return vec;
}
-
+#ifndef __ANDROID__
// pkgInitArchTupleMap - Initialize the architecture tuple map /*{{{*/
// ---------------------------------------------------------------------
/* This initializes */
@@ -116,7 +116,7 @@
return true;
}
- /*}}}*/
+#endif /*}}}*/
// pkgInitConfig - Initialize the configuration class /*{{{*/
@@ -133,6 +133,7 @@
Cnf.CndSet("APT::Install-Recommends", true);
Cnf.CndSet("APT::Install-Suggests", false);
Cnf.CndSet("Dir","/");
+ Cnf.CndSet("Acquire::Languages", "none");
// State
Cnf.CndSet("Dir::State", STATE_DIR + 1);
@@ -158,9 +159,9 @@
Cnf.CndSet("Dir::Etc::trusted", "trusted.gpg");
Cnf.CndSet("Dir::Etc::trustedparts","trusted.gpg.d");
Cnf.CndSet("Dir::Bin::methods", LIBEXEC_DIR "/methods");
- Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers");
- Cnf.CndSet("Dir::Bin::planners::",LIBEXEC_DIR "/planners");
- Cnf.CndSet("Dir::Media::MountPath","/media/apt");
+ Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers");
+ Cnf.CndSet("Dir::Bin::planners::", LIBEXEC_DIR "/planners");
+ Cnf.CndSet("Dir::Media::MountPath","media/apt");
// State
Cnf.CndSet("Dir::Log", LOG_DIR + 1);
@@ -283,8 +284,6 @@
return _error->Error(_("Unable to determine a suitable packaging system type"));
}
- if (pkgInitArchTupleMap() == false)
- return false;
return Sys->Initialize(Cnf);
}

View File

@ -1,11 +0,0 @@
diff -u -r ../apt-1.2.12/apt-private/private-download.cc ./apt-private/private-download.cc
--- ../apt-1.2.12/apt-private/private-download.cc 2016-05-11 10:57:51.000000000 +0200
+++ ./apt-private/private-download.cc 2017-07-01 00:31:32.131776100 +0200
@@ -121,7 +121,6 @@
/*}}}*/
bool CheckFreeSpaceBeforeDownload(std::string const &Dir, unsigned long long FetchBytes)/*{{{*/
{
- uint32_t const RAMFS_MAGIC = 0x858458f6;
/* Check for enough free space, but only if we are actually going to
download */
if (_config->FindB("APT::Get::Print-URIs", false) == true ||

View File

@ -1,41 +0,0 @@
TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt
TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager"
TERMUX_PKG_DEPENDS="libutil, libcurl, liblzma, dpkg, gpgv, libc++"
TERMUX_PKG_VERSION=1.4.7
TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=ea2a2e8e08daf8ea11aeaa86928d943a42ce53989165a30cc828838d470b7719
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DPERL_EXECUTABLE=`which perl`
-DCMAKE_INSTALL_FULL_LOCALSTATEDIR=$TERMUX_PREFIX
-DCOMMON_ARCH=$TERMUX_ARCH
-DDPKG_DATADIR=$TERMUX_PREFIX/share/dpkg
-DUSE_NLS=OFF
-DWITH_DOC=OFF
"
TERMUX_PKG_FOLDERNAME=apt-${TERMUX_PKG_VERSION}
TERMUX_PKG_ESSENTIAL=yes
TERMUX_PKG_CONFFILES="etc/apt/sources.list"
TERMUX_PKG_CONFLICTS=apt-transport-https
TERMUX_PKG_REPLACES=apt-transport-https
TERMUX_PKG_RM_AFTER_INSTALL="
bin/apt-cdrom
bin/apt-extracttemplates
bin/apt-mark
bin/apt-sortpkgs
etc/apt/apt.conf.d
lib/apt/apt-helper
lib/apt/methods/bzip2
lib/apt/methods/cdrom
lib/apt/methods/mirror
lib/apt/methods/rred
lib/apt/planners/
lib/apt/solvers/
lib/dpkg/
lib/libapt-inst.so
"
termux_step_post_make_install() {
printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] https://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list
cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/
rm /data/data/com.termux/files/usr/include/apt-pkg -r
}

View File

@ -1,43 +0,0 @@
diff -u -r ../apt-1.4.7/cmdline/apt-key.in ./cmdline/apt-key.in
--- ../apt-1.4.7/cmdline/apt-key.in 2017-07-13 23:45:39.000000000 +0200
+++ ./cmdline/apt-key.in 2017-07-26 12:18:17.424086422 +0200
@@ -16,10 +16,7 @@
aptkey_echo() { echo "$@"; }
requires_root() {
- if [ "$(id -u)" -ne 0 ]; then
- apt_error "This command can only be used by root."
- exit 1
- fi
+continue
}
command_available() {
@@ -260,7 +257,7 @@
if accessible_file_exists "$TRUSTEDFILE"; then
$ACTION "$TRUSTEDFILE" "$@"
fi
- local TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
+ local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d"
eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)"
if [ -d "$TRUSTEDPARTS" ]; then
TRUSTEDPARTS="$(readlink -f "$TRUSTEDPARTS")"
@@ -542,7 +539,7 @@
done
if [ -z "$TRUSTEDFILE" ]; then
- TRUSTEDFILE="/etc/apt/trusted.gpg"
+ TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg"
eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
fi
@@ -612,7 +609,8 @@
unset TMPDIR
fi
fi
- GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')"
+ # Use short options as busybox mktemp does not support long ones:
+ GPGHOMEDIR="$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')"
CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;"
trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
if [ -z "$GPGHOMEDIR" ]; then

View File

@ -1,18 +0,0 @@
diff -u -r ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc ./apt-pkg/contrib/cmndline.cc
--- ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc 2014-03-15 17:23:45.000000000 +0100
+++ ./apt-pkg/contrib/cmndline.cc 2014-03-25 01:10:30.764711007 +0100
@@ -27,6 +27,14 @@
/*}}}*/
using namespace std;
+#if defined(__ANDROID__)
+static char* strchrnul(char const* s, int c)
+{
+ char const* result = strchr(s, c);
+ return const_cast<char*>((result == NULL) ? (s + strlen(s)) : result);
+}
+#endif
+
// CommandLine::CommandLine - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */

View File

@ -1,18 +0,0 @@
diff -u -r ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc ./apt-pkg/deb/debsrcrecords.cc
--- ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc 2014-03-15 17:23:45.000000000 +0100
+++ ./apt-pkg/deb/debsrcrecords.cc 2014-03-25 01:23:30.652689687 +0100
@@ -26,6 +26,14 @@
#include <string>
#include <vector>
/*}}}*/
+#if defined(__ANDROID__)
+static char* strchrnul(char const* s, int c)
+{
+ char const* result = strchr(s, c);
+ return const_cast<char*>((result == NULL) ? (s + strlen(s)) : result);
+}
+#endif
+
using std::max;
using std::string;

View File

@ -1,23 +0,0 @@
--- ../cache/apt-1.4.7/methods/connect.cc 2017-07-14 07:45:39.000000000 +1000
+++ ./methods/connect.cc 2017-07-23 10:50:27.755510218 +1000
@@ -129,7 +129,7 @@
// Check the socket for an error condition
unsigned int Err;
- unsigned int Len = sizeof(Err);
+ socklen_t Len = sizeof(Err);
if (getsockopt(Fd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0)
return _error->Errno("getsockopt",_("Failed"));
@@ -301,7 +301,10 @@
if(LastHost != Host || LastPort != Port)
{
SrvRecords.clear();
- if (_config->FindB("Acquire::EnableSrvRecords", true) == true)
+ /* Disable by default in Termux due to it breaking on (some) HTC
+ devices (https://github.com/termux/termux-packages/issues/99). */
+
+ if (_config->FindB("Acquire::EnableSrvRecords", false) == true)
{
GetSrvRecords(Host, DefPort, SrvRecords);
// RFC2782 defines that a lonely '.' target is an abort reason

View File

@ -1,25 +0,0 @@
diff -u -r ../upstream.git/apt-private/private-output.cc ./apt-private/private-output.cc
--- ../upstream.git/apt-private/private-output.cc 2014-06-10 15:24:50.000000000 +0200
+++ ./apt-private/private-output.cc 2014-06-15 02:40:10.539223656 +0200
@@ -20,7 +20,11 @@
#include <string.h>
#include <iomanip>
#include <iostream>
-#include <langinfo.h>
+#ifdef __ANDROID__
+# include <termios.h>
+# else
+# include <langinfo.h>
+#endif
#include <unistd.h>
#include <signal.h>
#include <sys/ioctl.h>
@@ -764,7 +768,7 @@
regex_t Pattern;
int Res;
- Res = regcomp(&Pattern, nl_langinfo(YESEXPR),
+ Res = regcomp(&Pattern, "^[yY]",
REG_EXTENDED|REG_ICASE|REG_NOSUB);
if (Res != 0) {

Binary file not shown.

View File

@ -1,16 +0,0 @@
diff -u -r ../upstream.git/vendor/ubuntu/apt-vendor.ent ./vendor/ubuntu/apt-vendor.ent
--- ../upstream.git/vendor/ubuntu/apt-vendor.ent 2014-04-25 13:39:00.000000000 +0200
+++ ./vendor/ubuntu/apt-vendor.ent 2014-06-03 11:53:11.535752314 +0200
@@ -1,7 +1,7 @@
<!-- details about the keys used by the distribution -->
-<!ENTITY keyring-distro "Ubuntu">
-<!ENTITY keyring-package "<package>ubuntu-keyring</package>">
-<!ENTITY keyring-filename "<filename>/usr/share/keyrings/ubuntu-archive-keyring.gpg</filename>">
-<!ENTITY keyring-removed-filename "<filename>/usr/share/keyrings/ubuntu-archive-removed-keys.gpg</filename>">
-<!ENTITY keyring-master-filename "/usr/share/keyrings/ubuntu-master-keyring.gpg">
+<!ENTITY keyring-distro "Termux">
+<!ENTITY keyring-package "<package>termux-keyring</package>">
+<!ENTITY keyring-filename "<filename>@TERMUX_PREFIX@/share/keyrings/termux-archive-keyring.gpg</filename>">
+<!ENTITY keyring-removed-filename "<filename>@TERMUX_PREFIX@/share/keyrings/termux-archive-removed-keys.gpg</filename>">
+<!ENTITY keyring-master-filename "@TERMUX_PREFIX@/share/keyrings/termux-master-keyring.gpg">
<!ENTITY keyring-uri "http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg">

View File

@ -1,34 +0,0 @@
diff -u -r ../apt-1.1.3/Makefile ./Makefile
--- ../apt-1.1.3/Makefile 2015-11-30 03:08:24.000000000 -0500
+++ ./Makefile 2015-12-04 05:05:01.447148671 -0500
@@ -9,8 +9,8 @@
.PHONY: default
default: startup all
-.PHONY: fast headers library clean veryclean all binary program doc test update-po
-all headers library clean veryclean binary program doc manpages docbook test update-po startup dirs:
+.PHONY: fast headers library clean veryclean all binary program doc update-po
+all headers library clean veryclean binary program doc manpages docbook update-po startup dirs:
$(MAKE) -C vendor $@
$(MAKE) -C apt-pkg $@
$(MAKE) -C apt-inst $@
@@ -21,8 +21,6 @@
$(MAKE) -C dselect $@
$(MAKE) -C doc $@
$(MAKE) -C po $@
- # FIXME: -C test has issue swith parallel builds, investigate!
- -$(MAKE) -C test $@
fast:
$(MAKE) -C vendor all
@@ -32,9 +30,8 @@
$(MAKE) -C methods all
$(MAKE) -C cmdline all
$(MAKE) -C ftparchive all
- $(MAKE) -C test all
-all headers library clean veryclean binary program doc manpages docbook test update-po: startup dirs
+all headers library clean veryclean binary program doc manpages docbook update-po: startup dirs
dirs: startup

View File

@ -1,34 +0,0 @@
diff -u -r ../apt-1.2/apt-pkg/aptconfiguration.cc ./apt-pkg/aptconfiguration.cc
--- ../apt-1.2/apt-pkg/aptconfiguration.cc 2016-01-15 13:53:52.000000000 -0500
+++ ./apt-pkg/aptconfiguration.cc 2016-01-25 06:12:27.102248821 -0500
@@ -35,9 +35,9 @@
// setDefaultConfigurationForCompressors /*{{{*/
static void setDefaultConfigurationForCompressors() {
// Set default application paths to check for optional compression types
- _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
- _config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
- _config->CndSet("Dir::Bin::lz4", "/usr/bin/lz4");
+ _config->CndSet("Dir::Bin::bzip2", "bin/bzip2");
+ _config->CndSet("Dir::Bin::xz", "bin/xz");
+ _config->CndSet("Dir::Bin::lz4", "bin/lz4");
if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
_config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz"));
_config->Set("APT::Compressor::lzma::Binary", "xz");
@@ -50,7 +50,7 @@
_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
}
} else {
- _config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
+ _config->CndSet("Dir::Bin::lzma", "bin/lzma");
if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
_config->Set("APT::Compressor::lzma::CompressArg::", "--suffix=");
_config->Set("APT::Compressor::lzma::CompressArg::", "-6");
@@ -220,7 +220,7 @@
// get the environment language codes: LC_MESSAGES (and later LANGUAGE)
// we extract both, a long and a short code and then we will
// check if we actually need both (rare) or if the short is enough
- string const envMsg = string(Locale == 0 ? ::setlocale(LC_MESSAGES, NULL) : *Locale);
+ string const envMsg = "en_US.UTF-8"; // string(Locale == 0 ? ::setlocale(LC_MESSAGES, NULL) : *Locale);
size_t const lenShort = (envMsg.find('_') != string::npos) ? envMsg.find('_') : 2;
size_t const lenLong = (envMsg.find_first_of(".@") != string::npos) ? envMsg.find_first_of(".@") : (lenShort + 3);

View File

@ -1,7 +1,17 @@
diff -u -r ../apt-1.4.7/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc
--- ../apt-1.4.7/apt-pkg/contrib/fileutl.cc 2017-07-13 23:45:39.000000000 +0200
+++ ./apt-pkg/contrib/fileutl.cc 2017-07-23 21:02:20.571611631 +0200
@@ -2752,6 +2752,7 @@
+++ ./apt-pkg/contrib/fileutl.cc 2017-09-17 20:46:39.567888481 +0200
@@ -46,7 +46,9 @@
#include <dirent.h>
#include <signal.h>
#include <errno.h>
+#ifndef __ANDROID__
#include <glob.h>
+#endif
#include <pwd.h>
#include <grp.h>
@@ -2752,6 +2754,7 @@
}
/*}}}*/
@ -9,7 +19,7 @@ diff -u -r ../apt-1.4.7/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc
// Glob - wrapper around "glob()" /*{{{*/
std::vector<std::string> Glob(std::string const &pattern, int flags)
{
@@ -2777,6 +2778,7 @@
@@ -2777,6 +2780,7 @@
globfree(&globbuf);
return result;
}
@ -19,7 +29,7 @@ diff -u -r ../apt-1.4.7/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc
{
diff -u -r ../apt-1.4.7/apt-pkg/contrib/fileutl.h ./apt-pkg/contrib/fileutl.h
--- ../apt-1.4.7/apt-pkg/contrib/fileutl.h 2017-07-13 23:45:39.000000000 +0200
+++ ./apt-pkg/contrib/fileutl.h 2017-07-23 21:02:02.051824374 +0200
+++ ./apt-pkg/contrib/fileutl.h 2017-08-26 22:05:52.875932441 +0200
@@ -239,7 +239,9 @@
APT_HIDDEN std::string flNormalize(std::string file);

View File

@ -1,12 +0,0 @@
diff -u -r ../apt-1.1.3/apt-pkg/contrib/gpgv.cc ./apt-pkg/contrib/gpgv.cc
--- ../apt-1.1.3/apt-pkg/contrib/gpgv.cc 2015-11-30 03:08:24.000000000 -0500
+++ ./apt-pkg/contrib/gpgv.cc 2015-12-03 16:57:57.183003187 -0500
@@ -47,7 +47,7 @@
int const &statusfd, int fd[2], std::string const &key)
{
#define EINTERNAL 111
- std::string const aptkey = _config->FindFile("Dir::Bin::apt-key", "/usr/bin/apt-key");
+ std::string const aptkey = _config->FindFile("Dir::Bin::apt-key", "@TERMUX_PREFIX@/bin/apt-key");
bool const Debug = _config->FindB("Debug::Acquire::gpgv", false);

View File

@ -1,25 +1,15 @@
diff -u -r ../apt-1.1.3/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc
--- ../apt-1.1.3/apt-pkg/contrib/strutl.cc 2015-11-30 03:08:24.000000000 -0500
+++ ./apt-pkg/contrib/strutl.cc 2015-12-03 18:36:34.555425494 -0500
@@ -35,7 +35,9 @@
#include <regex.h>
#include <errno.h>
#include <stdarg.h>
+#ifndef __ANDROID__
#include <iconv.h>
+#endif
#include <apti18n.h>
diff -u -r ../apt-1.4.7/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc
--- ../apt-1.4.7/apt-pkg/contrib/strutl.cc 2017-07-13 23:45:39.000000000 +0200
+++ ./apt-pkg/contrib/strutl.cc 2017-07-23 22:58:23.103247428 +0200
@@ -100,6 +100,7 @@
}
}
/*}}}*/
@@ -87,6 +89,7 @@
+#ifndef __ANDROID__
// UTF8ToCodeset - Convert some UTF-8 string for some codeset /*{{{*/
// ---------------------------------------------------------------------
/* This is handy to use before display some information for enduser */
+#ifndef __ANDROID__
bool UTF8ToCodeset(const char *codeset, const string &orig, string *dest)
{
iconv_t cd;
@@ -153,6 +156,7 @@
@@ -169,6 +170,7 @@
return true;
}
@ -27,40 +17,3 @@ diff -u -r ../apt-1.1.3/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc
/*}}}*/
// strstrip - Remove white space from the front and back of a string /*{{{*/
// ---------------------------------------------------------------------
@@ -392,14 +396,14 @@
if (ASize < 100 && I != 0)
{
std::string S;
- strprintf(S, "%'.1f %c", ASize, Ext[I]);
+ strprintf(S, "%.1f %c", ASize, Ext[I]);
return S;
}
if (ASize < 10000)
{
std::string S;
- strprintf(S, "%'.0f %c", ASize, Ext[I]);
+ strprintf(S, "%.0f %c", ASize, Ext[I]);
return S;
}
ASize /= 1000.0;
@@ -928,14 +932,16 @@
setlocale (LC_ALL,"C");
bool const invalid =
// Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
- (strptime(str, "%a, %d %b %Y %H:%M:%S %Z", &Tm) == NULL &&
+ (strptime(str, "%a, %d %b %Y %H:%M:%S", &Tm) == NULL &&
// Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
- strptime(str, "%A, %d-%b-%y %H:%M:%S %Z", &Tm) == NULL &&
+ strptime(str, "%A, %d-%b-%y %H:%M:%S", &Tm) == NULL &&
// Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
strptime(str, "%a %b %d %H:%M:%S %Y", &Tm) == NULL);
setlocale (LC_ALL,"");
- if (invalid == true)
+ if (invalid == true) {
+ if (str != NULL && strlen(str) > 1) printf("Invalid time str '%s'\n", str);
return false;
+ }
time = timegm(&Tm);
return true;

View File

@ -1,14 +0,0 @@
diff -u -r ../apt-1.2.3/apt-pkg/deb/debindexfile.cc ./apt-pkg/deb/debindexfile.cc
--- ../apt-1.2.3/apt-pkg/deb/debindexfile.cc 2016-02-10 12:02:45.000000000 -0500
+++ ./apt-pkg/deb/debindexfile.cc 2016-02-18 02:44:56.707323056 -0500
@@ -26,8 +26,10 @@
#include <stdio.h>
#include <iostream>
+#include <stdlib.h>
#include <string>
#include <sstream>
+#include <unistd.h>
#include <sys/stat.h>
/*}}}*/

View File

@ -1,26 +1,50 @@
diff -u -r ../upstream.git/apt-pkg/init.cc ./apt-pkg/init.cc
--- ../upstream.git/apt-pkg/init.cc 2014-05-05 14:01:59.000000000 +0200
+++ ./apt-pkg/init.cc 2014-06-04 13:57:49.848604233 +0200
@@ -44,7 +44,8 @@
Cnf.Set("APT::Build-Essential::", "build-essential");
--- ../cache/apt-1.4.7/apt-pkg/init.cc 2017-07-14 07:45:39.000000000 +1000
+++ ./apt-pkg/init.cc 2017-07-19 17:03:07.949752843 +1000
@@ -51,7 +51,7 @@
return vec;
}
-
+#ifndef __ANDROID__
// pkgInitArchTupleMap - Initialize the architecture tuple map /*{{{*/
// ---------------------------------------------------------------------
/* This initializes */
@@ -116,7 +116,7 @@
return true;
}
- /*}}}*/
+#endif /*}}}*/
// pkgInitConfig - Initialize the configuration class /*{{{*/
@@ -133,6 +133,7 @@
Cnf.CndSet("APT::Install-Recommends", true);
Cnf.CndSet("APT::Install-Suggests", false);
- Cnf.CndSet("Dir","/");
+ Cnf.CndSet("Dir","@TERMUX_PREFIX@/");
Cnf.CndSet("Dir","/");
+ Cnf.CndSet("Acquire::Languages", "none");
// State
Cnf.CndSet("Dir::State","var/lib/apt/");
@@ -71,9 +72,9 @@
Cnf.CndSet("Dir::Etc::preferencesparts","preferences.d");
Cnf.CndSet("Dir::State", STATE_DIR + 1);
@@ -158,9 +159,9 @@
Cnf.CndSet("Dir::Etc::trusted", "trusted.gpg");
Cnf.CndSet("Dir::Etc::trustedparts","trusted.gpg.d");
- Cnf.CndSet("Dir::Bin::methods","/usr/lib/apt/methods");
- Cnf.CndSet("Dir::Bin::solvers::","/usr/lib/apt/solvers");
Cnf.CndSet("Dir::Bin::methods", LIBEXEC_DIR "/methods");
- Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers");
- Cnf.CndSet("Dir::Bin::planners::",LIBEXEC_DIR "/planners");
- Cnf.CndSet("Dir::Media::MountPath","/media/apt");
+ Cnf.CndSet("Dir::Bin::methods","lib/apt/methods");
+ Cnf.CndSet("Dir::Bin::solvers::","lib/apt/solvers");
+ Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/solvers");
+ Cnf.CndSet("Dir::Bin::planners::", LIBEXEC_DIR "/planners");
+ Cnf.CndSet("Dir::Media::MountPath","media/apt");
// State
Cnf.CndSet("Dir::Log","var/log/apt");
// State
Cnf.CndSet("Dir::Log", LOG_DIR + 1);
@@ -283,8 +284,6 @@
return _error->Error(_("Unable to determine a suitable packaging system type"));
}
- if (pkgInitArchTupleMap() == false)
- return false;
return Sys->Initialize(Cnf);
}

View File

@ -1,12 +0,0 @@
diff -u -r ../apt-1.1.3/apt-pkg/makefile ./apt-pkg/makefile
--- ../apt-1.1.3/apt-pkg/makefile 2015-11-30 03:08:24.000000000 -0500
+++ ./apt-pkg/makefile 2015-12-03 16:37:32.041569392 -0500
@@ -15,7 +15,7 @@
LIBRARY=apt-pkg
MAJOR=$(LIBAPTPKG_MAJOR)
MINOR=$(LIBAPTPKG_RELEASE)
-SLIBS=$(PTHREADLIB) $(INTLLIBS) -lutil -ldl -lresolv
+SLIBS=$(PTHREADLIB) $(INTLLIBS) -ldl
ifeq ($(HAVE_ZLIB),yes)
SLIBS+= -lz
endif

View File

@ -1,3 +0,0 @@
TERMUX_SUBPKG_INCLUDE="lib/apt/methods/https"
TERMUX_SUBPKG_DESCRIPTION="Https download support for APT"
TERMUX_SUBPKG_DEPENDS="apt, libcurl"

View File

@ -1,52 +1,41 @@
TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt
TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager"
TERMUX_PKG_DEPENDS="liblzma, dpkg, gpgv, libc++"
# Wait with updating to later version until the NDK supports std::to_string() and other
# functions (hopefully in r15, https://github.com/android-ndk/ndk/issues/82).
# Updating to apt 1.4 will also get rid of the build hacks used as apt has transitioned
# to a clean cmake build system.
TERMUX_PKG_VERSION=1.2.12
TERMUX_PKG_REVISION=3
# TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SRCURL=https://launchpad.net/ubuntu/+archive/primary/+files/apt_${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=e820d27cba73476df4abcff27dadd1b5847474bfe85f7e9202a9a07526973ea6
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--no-create"
TERMUX_PKG_DEPENDS="libutil, libcurl, liblzma, dpkg, gpgv, libc++"
TERMUX_PKG_VERSION=1.4.7
TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=ea2a2e8e08daf8ea11aeaa86928d943a42ce53989165a30cc828838d470b7719
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DPERL_EXECUTABLE=`which perl`
-DCMAKE_INSTALL_FULL_LOCALSTATEDIR=$TERMUX_PREFIX
-DCOMMON_ARCH=$TERMUX_ARCH
-DDPKG_DATADIR=$TERMUX_PREFIX/share/dpkg
-DUSE_NLS=OFF
-DWITH_DOC=OFF
"
TERMUX_PKG_FOLDERNAME=apt-${TERMUX_PKG_VERSION}
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_ESSENTIAL=yes
TERMUX_PKG_CONFFILES="etc/apt/sources.list"
TERMUX_PKG_CONFLICTS=apt-transport-https
TERMUX_PKG_REPLACES=apt-transport-https
TERMUX_PKG_RM_AFTER_INSTALL="
bin/apt-cdrom
bin/apt-extracttemplates
bin/apt-mark
bin/apt-sortpkgs
etc/apt/apt.conf.d
lib/apt/apt-helper
lib/apt/methods/bzip2
lib/apt/methods/cdrom
lib/apt/methods/mirror
lib/apt/methods/rred
lib/apt/planners/
lib/apt/solvers/
lib/dpkg/
lib/libapt-inst.so
"
termux_step_pre_configure () {
# Some files use STD*_FILENO without including <unistd.h> where they are declared.
# Define them here to avoid having to patch files:
CXXFLAGS+=" -DSTDIN_FILENO=0 -DSTDOUT_FILENO=1 -DSTDERR_FILENO=2 -DAI_IDN=0"
cp $TERMUX_SCRIPTDIR/scripts/config.{guess,sub} $TERMUX_PKG_SRCDIR/buildlib
perl -p -i -e "s/TERMUX_ARCH/$TERMUX_ARCH/" $TERMUX_PKG_SRCDIR/configure
rm $TERMUX_PKG_SRCDIR/apt-pkg/{cdrom.cc,indexcopy.cc}
export ac_cv_lib_bz2_BZ2_bzopen=no
}
termux_step_make_install () {
cp $TERMUX_PKG_BUILDDIR/build/bin/apt{,-get,-cache,-config,-key} $TERMUX_PREFIX/bin/
cp $TERMUX_PKG_BUILDDIR/build/bin/libapt-{pkg.so.5.0.0,private.so.0.0} $TERMUX_PREFIX/lib/
(cd $TERMUX_PREFIX/lib; ln -s -f libapt-pkg.so.5.0.0 libapt-pkg.so.5.0; ln -s -f libapt-pkg.so.5.0.0 libapt-pkg.so )
mkdir -p $TERMUX_PREFIX/lib/apt/methods $TERMUX_PREFIX/share/man/man{5,8}
cp $TERMUX_PKG_BUILDDIR/build/docs/apt{,-cache,-get}.8 $TERMUX_PREFIX/share/man/man8/
cp $TERMUX_PKG_BUILDDIR/build/docs/{apt.conf,sources.list}.5 $TERMUX_PREFIX/share/man/man5/
cp $TERMUX_PKG_BUILDDIR/build/bin/methods/{copy,file,gpgv,gzip,http,https,rsh,store} $TERMUX_PREFIX/lib/apt/methods
(cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s gzip xz)
(cd $TERMUX_PREFIX/lib/apt/methods; ln -f -s rsh ssh)
mkdir -p $TERMUX_PREFIX/etc/apt
printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] http://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list
# The trusted.gpg was created with "apt-key add public-key.key":
cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/
mkdir -p $TERMUX_PREFIX/etc/bash_completion.d/
cp $TERMUX_PKG_SRCDIR/completions/bash/apt \
$TERMUX_PREFIX/etc/bash_completion.d/
termux_step_post_make_install() {
printf "# The main termux repository:\ndeb [arch=all,${TERMUX_ARCH}] https://termux.net stable main\n" > $TERMUX_PREFIX/etc/apt/sources.list
cp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/
rm /data/data/com.termux/files/usr/include/apt-pkg -r
}

View File

@ -1,51 +1,28 @@
diff -u -r ../apt-1.1.6/cmdline/apt-key.in ./cmdline/apt-key.in
--- ../apt-1.1.6/cmdline/apt-key.in 2015-12-24 11:14:15.000000000 -0500
+++ ./cmdline/apt-key.in 2015-12-25 17:58:37.186396718 -0500
diff -u -r ../apt-1.4.7/cmdline/apt-key.in ./cmdline/apt-key.in
--- ../apt-1.4.7/cmdline/apt-key.in 2017-07-13 23:45:39.000000000 +0200
+++ ./cmdline/apt-key.in 2017-07-26 12:18:17.424086422 +0200
@@ -16,10 +16,7 @@
aptkey_echo() { echo "$@"; }
requires_root() {
- if [ "$(id -u)" -ne 0 ]; then
- echo >&2 "ERROR: This command can only be used by root."
- apt_error "This command can only be used by root."
- exit 1
- fi
+ continue
+continue
}
command_available() {
@@ -231,7 +228,7 @@
if [ -s "$TRUSTEDFILE" ]; then
@@ -260,7 +257,7 @@
if accessible_file_exists "$TRUSTEDFILE"; then
$ACTION "$TRUSTEDFILE" "$@"
fi
- local TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
+ local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d"
eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)"
if [ -d "$TRUSTEDPARTS" ]; then
# strip / suffix as gpg will double-slash in that case (#665411)
@@ -301,11 +298,11 @@
# if a --keyring was given, just use this one
if [ -n "$FORCED_KEYRING" ]; then
if [ -s "$FORCED_KEYRING" ]; then
- cp --dereference "$FORCED_KEYRING" "$PUBRING"
+ cp "$FORCED_KEYRING" "$PUBRING"
fi
else
# otherwise all known keyrings are merged
- local TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
+ local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d"
eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
if [ -d "$TRUSTEDPARTS" ]; then
# ignore errors mostly for non-existing $TRUSTEDFILE
@@ -316,7 +313,7 @@
done
} > "$PUBRING" 2>/dev/null
elif [ -s "$TRUSTEDFILE" ]; then
- cp --dereference "$TRUSTEDFILE" "$PUBRING"
+ cp "$TRUSTEDFILE" "$PUBRING"
fi
fi
@@ -460,7 +457,7 @@
TRUSTEDPARTS="$(readlink -f "$TRUSTEDPARTS")"
@@ -542,7 +539,7 @@
done
if [ -z "$TRUSTEDFILE" ]; then
@ -54,3 +31,13 @@ diff -u -r ../apt-1.1.6/cmdline/apt-key.in ./cmdline/apt-key.in
eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
fi
@@ -612,7 +609,8 @@
unset TMPDIR
fi
fi
- GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')"
+ # Use short options as busybox mktemp does not support long ones:
+ GPGHOMEDIR="$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')"
CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;"
trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
if [ -z "$GPGHOMEDIR" ]; then

View File

@ -1,26 +0,0 @@
diff -u -r ../apt-1.1.3/cmdline/makefile ./cmdline/makefile
--- ../apt-1.1.3/cmdline/makefile 2015-11-30 03:08:24.000000000 -0500
+++ ./cmdline/makefile 2015-12-03 20:09:21.860089855 -0500
@@ -33,13 +33,6 @@
SOURCE = apt-config.cc
include $(PROGRAM_H)
-# The apt-cdrom program
-PROGRAM=apt-cdrom
-SLIBS = -lapt-pkg -lapt-private $(INTLLIBS)
-LIB_MAKES = apt-pkg/makefile apt-private/makefile
-SOURCE = apt-cdrom.cc
-include $(PROGRAM_H)
-
# The apt-mark program
PROGRAM=apt-mark
SLIBS = -lapt-pkg -lapt-private $(INTLLIBS)
@@ -49,7 +42,7 @@
# The apt-helper
PROGRAM=apt-helper
-SLIBS = -lapt-pkg -lapt-private $(INTLLIBS) -lresolv
+SLIBS = -lapt-pkg -lapt-private $(INTLLIBS)
LIB_MAKES = apt-pkg/makefile apt-private/makefile
SOURCE = apt-helper.cc
include $(PROGRAM_H)

View File

@ -1,27 +0,0 @@
diff -u -r ../apt-1.2/completions/bash/apt ./completions/bash/apt
--- ../apt-1.2/completions/bash/apt 2016-01-15 13:53:52.000000000 -0500
+++ ./completions/bash/apt 2016-01-25 06:15:46.747246153 -0500
@@ -2,7 +2,7 @@
_apt()
{
- local sourcesdir="/etc/apt/sources.list.d"
+ local sourcesdir="@TERMUX_PREFIX@/etc/apt/sources.list.d"
local cur prev words cword
_init_completion || return
@@ -66,14 +66,9 @@
if [[ -n $command ]]; then
case $command in
remove|purge|autoremove)
- if [[ -f /etc/debian_version ]]; then
# Debian system
COMPREPLY=( $( \
_xfunc dpkg _comp_dpkg_installed_packages $cur ) )
- else
- # assume RPM based
- _xfunc rpm _rpm_installed_packages
- fi
return 0
;;
show|list)

View File

@ -1,30 +0,0 @@
diff -u -r ../apt-1.2.12/configure ./configure
--- ../apt-1.2.12/configure 2016-05-11 10:58:04.000000000 +0200
+++ ./configure 2017-03-03 13:31:05.373948035 +0100
@@ -569,7 +569,7 @@
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
-cross_compiling=no
+cross_compiling=yes
subdirs=
MFLAGS=
MAKEFLAGS=
@@ -4611,7 +4611,7 @@
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if false; then :
$as_echo "#define HAVE_BDB 1" >>confdefs.h
BDBLIB="-ldb"
@@ -5056,7 +5056,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking debian architecture" >&5
$as_echo_n "checking debian architecture... " >&6; }
-archset="`dpkg-architecture -qDEB_HOST_ARCH`"
+archset=TERMUX_ARCH
if test "x$archset" = "x"; then
as_fn_error $? "failed: use --host= or output from dpkg-architecture" "$LINENO" 5
fi

View File

@ -1,51 +0,0 @@
diff -u -r ../apt-1.1.3/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc
--- ../apt-1.1.3/apt-pkg/contrib/fileutl.cc 2015-11-30 03:08:24.000000000 -0500
+++ ./apt-pkg/contrib/fileutl.cc 2015-12-04 07:11:09.531546721 -0500
@@ -46,7 +46,9 @@
#include <dirent.h>
#include <signal.h>
#include <errno.h>
+#ifndef __ANDROID__
#include <glob.h>
+#endif
#include <pwd.h>
#include <grp.h>
@@ -100,7 +102,7 @@
_exit(100);
}
- if (chdir("/tmp/") != 0)
+ if (chdir("@TERMUX_PREFIX@/tmp/") != 0)
_exit(100);
unsigned int Count = 1;
@@ -2102,6 +2104,7 @@
std::vector<std::string> Glob(std::string const &pattern, int flags)
{
std::vector<std::string> result;
+#ifndef __ANDROID__
glob_t globbuf;
int glob_res;
unsigned int i;
@@ -2121,6 +2124,7 @@
result.push_back(string(globbuf.gl_pathv[i]));
globfree(&globbuf);
+#endif
return result;
}
/*}}}*/
@@ -2136,10 +2140,10 @@
struct stat st;
if (!tmpdir || strlen(tmpdir) == 0 || // tmpdir is set
stat(tmpdir, &st) != 0 || (st.st_mode & S_IFDIR) == 0) // exists and is directory
- tmpdir = "/tmp";
+ tmpdir = "@TERMUX_PREFIX@/tmp";
else if (geteuid() != 0 && // root can do everything anyway
faccessat(-1, tmpdir, R_OK | W_OK | X_OK, AT_EACCESS | AT_SYMLINK_NOFOLLOW) != 0) // current user has rwx access to directory
- tmpdir = "/tmp";
+ tmpdir = "@TERMUX_PREFIX@/tmp";
return string(tmpdir);
}

View File

@ -1,26 +0,0 @@
diff -u -r ../apt-0.9.16.1/apt-pkg/deb/debsystem.cc ./apt-pkg/deb/debsystem.cc
--- ../apt-0.9.16.1/apt-pkg/deb/debsystem.cc 2014-03-15 17:23:45.000000000 +0100
+++ ./apt-pkg/deb/debsystem.cc 2014-03-27 13:39:56.648378401 +0100
@@ -187,8 +187,8 @@
which is yet to be determined. The functions in pkgcachegen should
be the only users of these */
Cnf.CndSet("Dir::State::extended_states", "extended_states");
- Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status");
- Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg");
+ Cnf.CndSet("Dir::State::status","@TERMUX_PREFIX@/var/lib/dpkg/status");
+ Cnf.CndSet("Dir::Bin::dpkg","@TERMUX_PREFIX@/bin/dpkg");
if (d->StatusFile) {
delete d->StatusFile;
@@ -216,9 +216,9 @@
signed debSystem::Score(Configuration const &Cnf)
{
signed Score = 0;
- if (FileExists(Cnf.FindFile("Dir::State::status","/var/lib/dpkg/status")) == true)
+ if (FileExists(Cnf.FindFile("Dir::State::status","@TERMUX_PREFIX@/var/lib/dpkg/status")) == true)
Score += 10;
- if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","/usr/bin/dpkg")) == true)
+ if (FileExists(Cnf.FindFile("Dir::Bin::dpkg","@TERMUX_PREFIX@/bin/dpkg")) == true)
Score += 10;
if (FileExists("/etc/debian_version") == true)
Score += 10;

View File

@ -1,13 +0,0 @@
diff -u -r ../apt-1.2.12/doc/makefile ./doc/makefile
--- ../apt-1.2.12/doc/makefile 2016-05-11 08:57:51.000000000 +0000
+++ ./doc/makefile 2016-05-24 20:14:30.535233236 +0000
@@ -10,7 +10,7 @@
LC = en
include $(DOCBOOK_H)
-doc: manpages docbook
+doc: manpages
examples/sources.list: ../vendor/current/sources.list
ln -sf '$(abspath $^)' $@

View File

@ -1,12 +0,0 @@
diff -u -r ../apt-0.9.16.1/methods/ftp.cc ./methods/ftp.cc
--- ../apt-0.9.16.1/methods/ftp.cc 2014-03-15 17:23:45.000000000 +0100
+++ ./methods/ftp.cc 2014-03-25 01:31:05.464677254 +0100
@@ -711,7 +711,7 @@
if (WaitFd(DataFd,true,TimeOut) == false)
return _error->Error(_("Could not connect data socket, connection timed out"));
unsigned int Err;
- unsigned int Len = sizeof(Err);
+ socklen_t Len = sizeof(Err);
if (getsockopt(DataFd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0)
return _error->Errno("getsockopt",_("Failed"));
if (Err != 0)

View File

@ -1,7 +1,6 @@
diff -u -r ../apt-1.1.5/methods/connect.cc ./methods/connect.cc
--- ../apt-1.1.5/methods/connect.cc 2015-12-14 10:57:32.000000000 -0500
+++ ./methods/connect.cc 2015-12-25 17:51:38.055723065 -0500
@@ -114,7 +114,7 @@
--- ../cache/apt-1.4.7/methods/connect.cc 2017-07-14 07:45:39.000000000 +1000
+++ ./methods/connect.cc 2017-07-23 10:50:27.755510218 +1000
@@ -129,7 +129,7 @@
// Check the socket for an error condition
unsigned int Err;
@ -10,14 +9,15 @@ diff -u -r ../apt-1.1.5/methods/connect.cc ./methods/connect.cc
if (getsockopt(Fd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0)
return _error->Errno("getsockopt",_("Failed"));
@@ -277,7 +277,9 @@
@@ -301,7 +301,10 @@
if(LastHost != Host || LastPort != Port)
{
SrvRecords.clear();
- if (_config->FindB("Acquire::EnableSrvRecords", true) == true)
+ /* Disable by default in Termux due to it breaking on (some) HTC
+ devices (https://github.com/termux/termux-packages/issues/99). */
+ if (_config->FindB("Acquire::EnableSrvRecords", false) == true)
+
+ if (_config->FindB("Acquire::EnableSrvRecords", false) == true)
{
GetSrvRecords(Host, DefPort, SrvRecords);
}
// we have no SrvRecords for this host, connect right away
// RFC2782 defines that a lonely '.' target is an abort reason

View File

@ -1,46 +0,0 @@
diff -u -r ../apt-1.1.3/methods/makefile ./methods/makefile
--- ../apt-1.1.3/methods/makefile 2015-11-30 03:08:24.000000000 -0500
+++ ./methods/makefile 2015-12-03 20:07:25.853599149 -0500
@@ -37,30 +37,23 @@
SOURCE = gpgv.cc
include $(PROGRAM_H)
-# The cdrom method
-PROGRAM=cdrom
-SLIBS = -lapt-pkg $(INTLLIBS)
-LIB_MAKES = apt-pkg/makefile
-SOURCE = cdrom.cc
-include $(PROGRAM_H)
-
# The http method
PROGRAM=http
-SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -lresolv
+SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS)
LIB_MAKES = apt-pkg/makefile
SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc server.cc
include $(PROGRAM_H)
# The https method
PROGRAM=https
-SLIBS = -lapt-pkg -lcurl $(INTLLIBS) -lresolv
+SLIBS = -lapt-pkg -lcurl $(INTLLIBS)
LIB_MAKES = apt-pkg/makefile
SOURCE = https.cc server.cc
include $(PROGRAM_H)
# The ftp method
PROGRAM=ftp
-SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -lresolv
+SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS)
LIB_MAKES = apt-pkg/makefile
SOURCE = ftp.cc rfc2553emu.cc connect.cc
include $(PROGRAM_H)
@@ -81,7 +74,7 @@
# The mirror method
PROGRAM=mirror
-SLIBS = -lapt-pkg $(SOCKETLIBS) -lresolv
+SLIBS = -lapt-pkg $(SOCKETLIBS)
LIB_MAKES = apt-pkg/makefile
SOURCE = mirror.cc http.cc rfc2553emu.cc connect.cc server.cc
include $(PROGRAM_H)

View File

@ -1,19 +0,0 @@
diff -u -r ../apt-0.9.16.1/apt-pkg/contrib/netrc.cc ./apt-pkg/contrib/netrc.cc
--- ../apt-0.9.16.1/apt-pkg/contrib/netrc.cc 2014-03-15 17:23:45.000000000 +0100
+++ ./apt-pkg/contrib/netrc.cc 2014-03-25 01:01:34.692725662 +0100
@@ -84,6 +84,7 @@
int state_our_login = false; /* With specific_login,
found *our* login name */
+#ifndef __ANDROID__
while (!done && getline(&netrcbuffer, &netrcbuffer_size, file) != -1) {
tok = strtok_r (netrcbuffer, " \t\n", &tok_buf);
while (!done && tok) {
@@ -142,6 +143,7 @@
tok = strtok_r (NULL, " \t\n", &tok_buf);
} /* while(tok) */
} /* while getline() */
+#endif
free(netrcbuffer);
fclose(file);

View File

@ -1,12 +0,0 @@
diff -u -r ../apt-0.9.16.1/test/interactive-helper/makefile ./test/interactive-helper/makefile
--- ../apt-0.9.16.1/test/interactive-helper/makefile 2014-01-05 20:06:21.000000000 +0100
+++ ./test/interactive-helper/makefile 2014-03-25 01:33:54.600672630 +0100
@@ -41,7 +41,7 @@
# Program for testing udevcdrom
PROGRAM=aptwebserver
-SLIBS = -lapt-pkg -lpthread
+SLIBS = -lapt-pkg
LIB_MAKES = apt-pkg/makefile
SOURCE = aptwebserver.cc
include $(PROGRAM_H)