termux-packages/packages/apt/0003-no-srv-records.patch

102 lines
3.3 KiB
Diff
Raw Normal View History

diff -uNr apt-2.1.18/apt-pkg/contrib/srvrec.cc apt-2.1.18.mod/apt-pkg/contrib/srvrec.cc
--- apt-2.1.18/apt-pkg/contrib/srvrec.cc 2021-01-13 18:37:30.000000000 +0200
+++ apt-2.1.18.mod/apt-pkg/contrib/srvrec.cc 2021-02-03 21:38:17.382553856 +0200
2020-11-05 16:05:50 +01:00
@@ -6,6 +6,7 @@
##################################################################### */
/*}}}*/
+#ifndef __ANDROID__
#include <config.h>
#include <netdb.h>
@@ -202,3 +203,4 @@
return selected;
}
+#endif
diff -uNr apt-2.1.18/apt-pkg/contrib/srvrec.h apt-2.1.18.mod/apt-pkg/contrib/srvrec.h
--- apt-2.1.18/apt-pkg/contrib/srvrec.h 2021-01-13 18:37:30.000000000 +0200
+++ apt-2.1.18.mod/apt-pkg/contrib/srvrec.h 2021-02-03 21:38:17.386553898 +0200
2020-11-05 16:05:50 +01:00
@@ -8,6 +8,7 @@
/*}}}*/
#ifndef SRVREC_H
#define SRVREC_H
+#ifndef __ANDROID__
#include <string>
#include <vector>
@@ -54,3 +55,4 @@
APT_PUBLIC SrvRec PopFromSrvRecs(std::vector<SrvRec> &Recs);
#endif
+#endif
diff -uNr apt-2.1.18/cmdline/apt-helper.cc apt-2.1.18.mod/cmdline/apt-helper.cc
--- apt-2.1.18/cmdline/apt-helper.cc 2021-01-13 18:37:30.000000000 +0200
+++ apt-2.1.18.mod/cmdline/apt-helper.cc 2021-02-03 21:38:17.386553898 +0200
2020-11-05 16:05:50 +01:00
@@ -106,6 +106,7 @@
return true;
}
+#ifndef __ANDROID__
/*}}}*/
static bool DoSrvLookup(CommandLine &CmdL) /*{{{*/
{
@@ -134,6 +135,7 @@
return true;
}
/*}}}*/
+#endif
static const APT::Configuration::Compressor *FindCompressor(std::vector<APT::Configuration::Compressor> const &compressors, std::string const &name) /*{{{*/
{
APT::Configuration::Compressor const * compressor = NULL;
@@ -311,7 +313,9 @@
2020-11-05 16:05:50 +01:00
{
return {
{"download-file", &DoDownloadFile, _("download the given uri to the target-path")},
+#ifndef __ANDROID__
{"srv-lookup", &DoSrvLookup, _("lookup a SRV record (e.g. _http._tcp.ftp.debian.org)")},
+#endif
{"cat-file", &DoCatFile, _("concatenate files, with automatic decompression")},
{"auto-detect-proxy", &DoAutoDetectProxy, _("detect proxy using apt.conf")},
{"wait-online", &DoWaitOnline, _("wait for system to be online")},
diff -uNr apt-2.1.18/methods/connect.cc apt-2.1.18.mod/methods/connect.cc
--- apt-2.1.18/methods/connect.cc 2021-01-13 18:37:30.000000000 +0200
+++ apt-2.1.18.mod/methods/connect.cc 2021-02-03 21:41:48.220687372 +0200
2020-11-05 16:05:50 +01:00
@@ -49,7 +49,9 @@
static struct addrinfo *LastHostAddr = 0;
static struct addrinfo *LastUsed = 0;
+#ifndef __ANDROID__
static std::vector<SrvRec> SrvRecords;
+#endif
// Set of IP/hostnames that we timed out before or couldn't resolve
static std::set<std::string> bad_addr;
@@ -486,6 +488,10 @@
// Used by getaddrinfo(); prefer port if given, else fallback to service
std::string ServiceNameOrPort = Port != 0 ? std::to_string(Port) : Service;
2020-11-05 16:05:50 +01:00
+ size_t stackSize = 0;
2020-11-05 16:05:50 +01:00
+
+#ifndef __ANDROID__
+
if(LastHost != Host || LastService != ServiceNameOrPort)
2020-11-05 16:05:50 +01:00
{
SrvRecords.clear();
@@ -503,7 +509,6 @@
2020-11-05 16:05:50 +01:00
}
}
- size_t stackSize = 0;
// try to connect in the priority order of the srv records
std::string initialHost{std::move(Host)};
auto const initialPort = Port;
@@ -525,6 +530,7 @@
2020-11-05 16:05:50 +01:00
}
Host = std::move(initialHost);
Port = initialPort;
+#endif
// we have no (good) SrvRecords for this host, connect right away
_error->PushToStack();