summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2020-05-12 23:37:45 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-15 16:31:44 +0100
commite992ffd1623d25745beacbc5cabc1382dc9af79b (patch)
treecda0bc510cbea0a9faea1dbcd1c3fd6482169b72 /meta/recipes-devtools/apt
parentd91e47d9abc3c338ea61b26bded8d7171a17c15d (diff)
downloadpoky-e992ffd1623d25745beacbc5cabc1382dc9af79b.tar.gz
apt: Remove workarounds for host gcc < 5
(From OE-Core rev: f905eabaeb6b32ac9f3d6d8695fe9f8628c1bec5) Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/apt')
-rw-r--r--meta/recipes-devtools/apt/apt-native_1.2.31.bb4
-rw-r--r--meta/recipes-devtools/apt/apt/gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch80
-rw-r--r--meta/recipes-devtools/apt/apt/gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch46
-rw-r--r--meta/recipes-devtools/apt/apt/gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch33
4 files changed, 1 insertions, 162 deletions
diff --git a/meta/recipes-devtools/apt/apt-native_1.2.31.bb b/meta/recipes-devtools/apt/apt-native_1.2.31.bb
index 5b16b503d5..2952c21017 100644
--- a/meta/recipes-devtools/apt/apt-native_1.2.31.bb
+++ b/meta/recipes-devtools/apt/apt-native_1.2.31.bb
@@ -2,6 +2,4 @@ require apt-native.inc
2 2
3SRC_URI += "file://noconfigure.patch \ 3SRC_URI += "file://noconfigure.patch \
4 file://no-curl.patch \ 4 file://no-curl.patch \
5 file://gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch \ 5"
6 file://gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch \
7 file://gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch"
diff --git a/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch b/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch
deleted file mode 100644
index 438de209a2..0000000000
--- a/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch
+++ /dev/null
@@ -1,80 +0,0 @@
1From 7ef2b2dba0e0bee450da3c8450ea782a3e7d6429 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
3Date: Tue, 22 Aug 2017 11:49:01 -0500
4Subject: [PATCH 3/3] Revert "avoid changing the global LC_TIME for Release
5 writing"
6
7This reverts commit 78e7b683c645e907db12658405a4b201a6243ea8.
8
9After we drop debian8 and centos7 that has gcc < 5 (std::put_time not available)
10versions this patch can be remove.
11
12Signed-off-by: Anibal Limon <limon.anibal@gmail.com>
13
14Upstream-Status: Inappropriate [embedded specific]
15---
16 ftparchive/writer.cc | 29 +++++++++++++++++------------
17 1 file changed, 17 insertions(+), 12 deletions(-)
18
19diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
20index 2596382..e43a643 100644
21--- a/ftparchive/writer.cc
22+++ b/ftparchive/writer.cc
23@@ -37,7 +37,6 @@
24 #include <unistd.h>
25 #include <ctime>
26 #include <iostream>
27-#include <iomanip>
28 #include <sstream>
29 #include <memory>
30 #include <utility>
31@@ -984,29 +983,35 @@ ReleaseWriter::ReleaseWriter(FileFd * const GivenOutput, string const &/*DB*/) :
32 AddPatterns(_config->FindVector("APT::FTPArchive::Release::Patterns"));
33
34 time_t const now = time(NULL);
35- auto const posix = std::locale("C.UTF-8");
36
37- // FIXME: use TimeRFC1123 here? But that uses GMT to satisfy HTTP/1.1
38- std::ostringstream datestr;
39- datestr.imbue(posix);
40- datestr << std::put_time(gmtime(&now), "%a, %d %b %Y %H:%M:%S UTC");
41+ setlocale(LC_TIME, "C");
42+
43+ char datestr[128];
44+ if (strftime(datestr, sizeof(datestr), "%a, %d %b %Y %H:%M:%S UTC",
45+ gmtime(&now)) == 0)
46+ {
47+ datestr[0] = '\0';
48+ }
49
50 time_t const validuntil = now + _config->FindI("APT::FTPArchive::Release::ValidTime", 0);
51- std::ostringstream validstr;
52- if (validuntil != now)
53+ char validstr[128];
54+ if (now == validuntil ||
55+ strftime(validstr, sizeof(validstr), "%a, %d %b %Y %H:%M:%S UTC",
56+ gmtime(&validuntil)) == 0)
57 {
58- datestr.imbue(posix);
59- validstr << std::put_time(gmtime(&validuntil), "%a, %d %b %Y %H:%M:%S UTC");
60+ validstr[0] = '\0';
61 }
62
63+ setlocale(LC_TIME, "");
64+
65 map<string,string> Fields;
66 Fields["Origin"] = "";
67 Fields["Label"] = "";
68 Fields["Suite"] = "";
69 Fields["Version"] = "";
70 Fields["Codename"] = "";
71- Fields["Date"] = datestr.str();
72- Fields["Valid-Until"] = validstr.str();
73+ Fields["Date"] = datestr;
74+ Fields["Valid-Until"] = validstr;
75 Fields["Architectures"] = "";
76 Fields["Components"] = "";
77 Fields["Description"] = "";
78--
792.1.4
80
diff --git a/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch b/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch
deleted file mode 100644
index 088a66a3c8..0000000000
--- a/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch
+++ /dev/null
@@ -1,46 +0,0 @@
1From c72ef9b6ae83a0a2fbbefd5c050335f65f0d2bc9 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
3Date: Tue, 22 Aug 2017 11:48:46 -0500
4Subject: [PATCH 2/3] Revert "use de-localed std::put_time instead rolling our
5 own"
6
7This reverts commit 4ed2a17ab4334f019c00512aa54a162f0bf083c4.
8
9After we drop debian8 and centos7 that has gcc < 5 (std::put_time not available)
10versions this patch can be remove.
11
12Signed-off-by: Anibal Limon <limon.anibal@gmail.com>
13
14Upstream-Status: Inappropriate [embedded specific]
15---
16 apt-pkg/contrib/strutl.cc | 14 +++++++++-----
17 1 file changed, 9 insertions(+), 5 deletions(-)
18
19diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
20index c2ff01d..e9ef2be 100644
21--- a/apt-pkg/contrib/strutl.cc
22+++ b/apt-pkg/contrib/strutl.cc
23@@ -760,11 +760,15 @@ string TimeRFC1123(time_t Date)
24 if (gmtime_r(&Date, &Conv) == NULL)
25 return "";
26
27- auto const posix = std::locale::classic();
28- std::ostringstream datestr;
29- datestr.imbue(posix);
30- datestr << std::put_time(&Conv, "%a, %d %b %Y %H:%M:%S GMT");
31- return datestr.str();
32+ char Buf[300];
33+ const char *Day[] = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
34+ const char *Month[] = {"Jan","Feb","Mar","Apr","May","Jun","Jul",
35+ "Aug","Sep","Oct","Nov","Dec"};
36+
37+ snprintf(Buf, sizeof(Buf), "%s, %02i %s %i %02i:%02i:%02i GMT",Day[Conv.tm_wday],
38+ Conv.tm_mday,Month[Conv.tm_mon],Conv.tm_year+1900,Conv.tm_hour,
39+ Conv.tm_min,Conv.tm_sec);
40+ return Buf;
41 }
42 /*}}}*/
43 // ReadMessages - Read messages from the FD /*{{{*/
44--
452.1.4
46
diff --git a/meta/recipes-devtools/apt/apt/gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch b/meta/recipes-devtools/apt/apt/gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch
deleted file mode 100644
index cb32591876..0000000000
--- a/meta/recipes-devtools/apt/apt/gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From ff8562f7724c4db4b83635af9e627f3495222327 Mon Sep 17 00:00:00 2001
2From: Anibal Limon <limon.anibal@gmail.com>
3Date: Tue, 22 Aug 2017 04:41:31 -0500
4Subject: [PATCH 1/3] apt-pkg/contrib/strutl.cc: Include array header
5
6If GCC version is less than 5 the array header needs to be included
7to support std::array.
8
9After we drop debian8 and centos7 that has gcc < 5 versions this patch
10can be remove.
11
12Signed-off-by: Anibal Limon <limon.anibal@gmail.com>
13
14Upstream-Status: Inappropriate [embedded specific]
15---
16 apt-pkg/contrib/strutl.cc | 1 +
17 1 file changed, 1 insertion(+)
18
19diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
20index 60d0ca8..c2ff01d 100644
21--- a/apt-pkg/contrib/strutl.cc
22+++ b/apt-pkg/contrib/strutl.cc
23@@ -27,6 +27,7 @@
24 #include <sstream>
25 #include <string>
26 #include <vector>
27+#include <array>
28
29 #include <stddef.h>
30 #include <stdlib.h>
31--
322.1.4
33