apt: Fix building with unified headers
authorFredrik Fornwall <fredrik@fornwall.net>
Fri, 30 Jun 2017 22:32:45 +0000 (00:32 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 30 Jun 2017 22:32:45 +0000 (00:32 +0200)
packages/apt/apt-private-private-download.cc.patch [new file with mode: 0644]
packages/apt/cmndline-no-strchrnul.patch
packages/apt/debsrcrecords.patch

diff --git a/packages/apt/apt-private-private-download.cc.patch b/packages/apt/apt-private-private-download.cc.patch
new file mode 100644 (file)
index 0000000..55e3d46
--- /dev/null
@@ -0,0 +1,11 @@
+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 ||
index 61b0479..55a0872 100644 (file)
@@ -8,8 +8,8 @@ diff -u -r ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc ./apt-pkg/contrib/cmndlin
 +#if defined(__ANDROID__)
 +static char* strchrnul(char const* s, int c)
 +{
-+        char* result = strchr(s, c);
-+        return (result == NULL) ? const_cast<char*>(s + strlen(s)) : result;
++        char const* result = strchr(s, c);
++        return const_cast<char*>((result == NULL) ? (s + strlen(s)) : result);
 +}
 +#endif
 +
index bf34220..bedcbc0 100644 (file)
@@ -8,8 +8,8 @@ diff -u -r ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc ./apt-pkg/deb/debsrcreco
 +#if defined(__ANDROID__)
 +static char* strchrnul(char const* s, int c)
 +{
-+                char* result = strchr(s, c);
-+                        return (result == NULL) ? const_cast<char*>(s + strlen(s)) : result;
++      char const* result = strchr(s, c);
++      return const_cast<char*>((result == NULL) ? (s + strlen(s)) : result);
 +}
 +#endif
 +