summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-08-16 09:58:55 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-17 19:57:32 +0100
commit59cc19b64d276c65cc915595870f18a2948c7182 (patch)
treebb45338876b37b05d687f895eec7c5fe90735668 /meta/recipes-devtools/apt
parentf7e8bf37bcd6c9b5c157116483e613939e4a321d (diff)
downloadpoky-59cc19b64d276c65cc915595870f18a2948c7182.tar.gz
apt: Do not use std::binary_function
This feature is removed from c++17 (From OE-Core rev: 7fcf108c4e115077cf01754c37bb8ce216c24dc8) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/apt')
-rw-r--r--meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch4
-rw-r--r--meta/recipes-devtools/apt/apt/0001-Remove-using-std-binary_function.patch87
-rw-r--r--meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch4
-rw-r--r--meta/recipes-devtools/apt/apt_2.4.5.bb1
4 files changed, 92 insertions, 4 deletions
diff --git a/meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch b/meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch
index 59b9cd190f..37a3133010 100644
--- a/meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch
+++ b/meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch
@@ -1,4 +1,4 @@
1From 11ba49594ae9d11f0070198c146b5e437fa83022 Mon Sep 17 00:00:00 2001 1From b84280fec4e1d0d33eca78e76556023f8f8fe5b7 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 10 May 2019 16:47:38 +0200 3Date: Fri, 10 May 2019 16:47:38 +0200
4Subject: [PATCH] Do not init tables from dpkg configuration 4Subject: [PATCH] Do not init tables from dpkg configuration
@@ -13,7 +13,7 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13 1 file changed, 2 insertions(+), 2 deletions(-) 13 1 file changed, 2 insertions(+), 2 deletions(-)
14 14
15diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc 15diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
16index b9d9b15..1725c59 100644 16index b9d9b15d2..1725c5966 100644
17--- a/apt-pkg/init.cc 17--- a/apt-pkg/init.cc
18+++ b/apt-pkg/init.cc 18+++ b/apt-pkg/init.cc
19@@ -281,8 +281,8 @@ bool pkgInitSystem(Configuration &Cnf,pkgSystem *&Sys) 19@@ -281,8 +281,8 @@ bool pkgInitSystem(Configuration &Cnf,pkgSystem *&Sys)
diff --git a/meta/recipes-devtools/apt/apt/0001-Remove-using-std-binary_function.patch b/meta/recipes-devtools/apt/apt/0001-Remove-using-std-binary_function.patch
new file mode 100644
index 0000000000..3065210a04
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/0001-Remove-using-std-binary_function.patch
@@ -0,0 +1,87 @@
1From e91fb0618ce0a5d42f239d0fca602544858f0819 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 16 Aug 2022 08:44:18 -0700
4Subject: [PATCH] Remove using std::binary_function
5
6std::binary_function and std::unary_function are deprecated since c++11
7and removed in c++17, therefore remove it and use lambda functions to get same
8functionality implemented.
9
10Upstream-Status: Submitted [https://salsa.debian.org/apt-team/apt/-/merge_requests/253]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 ftparchive/apt-ftparchive.cc | 33 ++++++++++-----------------------
14 1 file changed, 10 insertions(+), 23 deletions(-)
15
16diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
17index 87ce9153c..56fdc2246 100644
18--- a/ftparchive/apt-ftparchive.cc
19+++ b/ftparchive/apt-ftparchive.cc
20@@ -48,6 +48,11 @@
21 using namespace std;
22 unsigned Quiet = 0;
23
24+auto ContentsCompare = [](const auto &a, const auto &b) { return a.ContentsMTime < b.ContentsMTime; };
25+auto DBCompare = [](const auto &a, const auto &b) { return a.BinCacheDB < b.BinCacheDB; };
26+auto SrcDBCompare = [](const auto &a, const auto &b) { return a.SrcCacheDB < b.SrcCacheDB; };
27+
28+
29 static struct timeval GetTimevalFromSteadyClock() /*{{{*/
30 {
31 auto const Time = std::chrono::steady_clock::now().time_since_epoch();
32@@ -116,24 +121,6 @@ struct PackageMap
33 bool SrcDone;
34 time_t ContentsMTime;
35
36- struct ContentsCompare : public binary_function<PackageMap,PackageMap,bool>
37- {
38- inline bool operator() (const PackageMap &x,const PackageMap &y)
39- {return x.ContentsMTime < y.ContentsMTime;};
40- };
41-
42- struct DBCompare : public binary_function<PackageMap,PackageMap,bool>
43- {
44- inline bool operator() (const PackageMap &x,const PackageMap &y)
45- {return x.BinCacheDB < y.BinCacheDB;};
46- };
47-
48- struct SrcDBCompare : public binary_function<PackageMap,PackageMap,bool>
49- {
50- inline bool operator() (const PackageMap &x,const PackageMap &y)
51- {return x.SrcCacheDB < y.SrcCacheDB;};
52- };
53-
54 void GetGeneral(Configuration &Setup,Configuration &Block);
55 bool GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats);
56 bool GenSources(Configuration &Setup,struct CacheDB::Stats &Stats);
57@@ -869,7 +856,7 @@ static bool DoGenerateContents(Configuration &Setup,
58 else
59 I->ContentsMTime = A.st_mtime;
60 }
61- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::ContentsCompare());
62+ stable_sort(PkgList.begin(),PkgList.end(),ContentsCompare);
63
64 /* Now for Contents.. The process here is to do a make-like dependency
65 check. Each contents file is verified to be newer than the package files
66@@ -941,8 +928,8 @@ static bool Generate(CommandLine &CmdL)
67 LoadBinDir(PkgList,Setup);
68
69 // Sort by cache DB to improve IO locality.
70- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::DBCompare());
71- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::SrcDBCompare());
72+ stable_sort(PkgList.begin(),PkgList.end(),DBCompare);
73+ stable_sort(PkgList.begin(),PkgList.end(),SrcDBCompare);
74
75 // Generate packages
76 if (_config->FindB("APT::FTPArchive::ContentsOnly", false) == false)
77@@ -993,8 +980,8 @@ static bool Clean(CommandLine &CmdL)
78 LoadBinDir(PkgList,Setup);
79
80 // Sort by cache DB to improve IO locality.
81- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::DBCompare());
82- stable_sort(PkgList.begin(),PkgList.end(),PackageMap::SrcDBCompare());
83+ stable_sort(PkgList.begin(),PkgList.end(),DBCompare);
84+ stable_sort(PkgList.begin(),PkgList.end(),SrcDBCompare);
85
86 string CacheDir = Setup.FindDir("Dir::CacheDir");
87
diff --git a/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
index 593ed7d096..6f4d5b6e72 100644
--- a/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
+++ b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
@@ -1,4 +1,4 @@
1From 47c2b42af60ceefd8ed52b32a3a365facf0e05b8 Mon Sep 17 00:00:00 2001 1From a2dd661484536492b47d4c88998f2bf516749bc8 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 21 May 2020 20:13:25 +0000 3Date: Thu, 21 May 2020 20:13:25 +0000
4Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our 4Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
@@ -20,7 +20,7 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
20 1 file changed, 2 insertions(+), 7 deletions(-) 20 1 file changed, 2 insertions(+), 7 deletions(-)
21 21
22diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc 22diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
23index 93effa9..4375781 100644 23index 93effa959..4375781d1 100644
24--- a/apt-pkg/deb/dpkgpm.cc 24--- a/apt-pkg/deb/dpkgpm.cc
25+++ b/apt-pkg/deb/dpkgpm.cc 25+++ b/apt-pkg/deb/dpkgpm.cc
26@@ -1199,12 +1199,6 @@ void pkgDPkgPM::BuildPackagesProgressMap() 26@@ -1199,12 +1199,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
diff --git a/meta/recipes-devtools/apt/apt_2.4.5.bb b/meta/recipes-devtools/apt/apt_2.4.5.bb
index 53849f80a3..564bdeec41 100644
--- a/meta/recipes-devtools/apt/apt_2.4.5.bb
+++ b/meta/recipes-devtools/apt/apt_2.4.5.bb
@@ -13,6 +13,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \
13 file://0001-cmake-Do-not-build-po-files.patch \ 13 file://0001-cmake-Do-not-build-po-files.patch \
14 file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \ 14 file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \
15 file://0001-aptwebserver.cc-Include-array.patch \ 15 file://0001-aptwebserver.cc-Include-array.patch \
16 file://0001-Remove-using-std-binary_function.patch \
16 " 17 "
17 18
18SRC_URI:append:class-native = " \ 19SRC_URI:append:class-native = " \