diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-08-16 09:58:55 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-17 19:57:32 +0100 |
commit | 59cc19b64d276c65cc915595870f18a2948c7182 (patch) | |
tree | bb45338876b37b05d687f895eec7c5fe90735668 /meta/recipes-devtools/apt | |
parent | f7e8bf37bcd6c9b5c157116483e613939e4a321d (diff) | |
download | poky-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')
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 @@ | |||
1 | From 11ba49594ae9d11f0070198c146b5e437fa83022 Mon Sep 17 00:00:00 2001 | 1 | From b84280fec4e1d0d33eca78e76556023f8f8fe5b7 Mon Sep 17 00:00:00 2001 |
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
3 | Date: Fri, 10 May 2019 16:47:38 +0200 | 3 | Date: Fri, 10 May 2019 16:47:38 +0200 |
4 | Subject: [PATCH] Do not init tables from dpkg configuration | 4 | Subject: [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 | ||
15 | diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc | 15 | diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc |
16 | index b9d9b15..1725c59 100644 | 16 | index 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 @@ | |||
1 | From e91fb0618ce0a5d42f239d0fca602544858f0819 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 16 Aug 2022 08:44:18 -0700 | ||
4 | Subject: [PATCH] Remove using std::binary_function | ||
5 | |||
6 | std::binary_function and std::unary_function are deprecated since c++11 | ||
7 | and removed in c++17, therefore remove it and use lambda functions to get same | ||
8 | functionality implemented. | ||
9 | |||
10 | Upstream-Status: Submitted [https://salsa.debian.org/apt-team/apt/-/merge_requests/253] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | ftparchive/apt-ftparchive.cc | 33 ++++++++++----------------------- | ||
14 | 1 file changed, 10 insertions(+), 23 deletions(-) | ||
15 | |||
16 | diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc | ||
17 | index 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 @@ | |||
1 | From 47c2b42af60ceefd8ed52b32a3a365facf0e05b8 Mon Sep 17 00:00:00 2001 | 1 | From a2dd661484536492b47d4c88998f2bf516749bc8 Mon Sep 17 00:00:00 2001 |
2 | From: Alexander Kanavin <alex.kanavin@gmail.com> | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
3 | Date: Thu, 21 May 2020 20:13:25 +0000 | 3 | Date: Thu, 21 May 2020 20:13:25 +0000 |
4 | Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our | 4 | Subject: [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 | ||
22 | diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc | 22 | diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc |
23 | index 93effa9..4375781 100644 | 23 | index 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 | ||
18 | SRC_URI:append:class-native = " \ | 19 | SRC_URI:append:class-native = " \ |