Skip to contentSkip to conversation

apt: update 1.8.2.2 -> 2.2.2

PATCH New Khem Raj 1 participant 3 messages Mar 20, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/3 apt: update 1.8.2.2 -> 2.2.2

From: Alexander Kanavin <[email protected]>

Drop 0001-test-libapt-do-not-use-gtest-from-the-host.patch (replaced by WITH_TESTS option).

Drop 0001-Do-not-configure-packages-on-installation.patch (no longer necessary).

Adjust build dependencies.

---
 ...e-documentation-directory-altogether.patch |  8 ++--
 ...t-configure-packages-on-installation.patch | 48 -------------------
 ...-init-tables-from-dpkg-configuration.patch |  4 +-
 ...n-dpkg-configure-a-at-the-end-of-our.patch | 10 ++--
 ...ibapt-do-not-use-gtest-from-the-host.patch | 40 ----------------
 .../apt/{apt_1.8.2.2.bb => apt_2.2.2.bb}      |  9 ++--
 6 files changed, 14 insertions(+), 105 deletions(-)
 delete mode 100644 meta/recipes-devtools/apt/apt/0001-Do-not-configure-packages-on-installation.patch
 delete mode 100644 meta/recipes-devtools/apt/apt/0001-test-libapt-do-not-use-gtest-from-the-host.patch
 rename meta/recipes-devtools/apt/{apt_1.8.2.2.bb => apt_2.2.2.bb} (89%)
meta/recipes-devtools/apt/apt/0001-Disable-documentation-directory-altogether.patch +4 -4
index cc422b74dc..8b28ede8a8 100644
@@ -1,4 +1,4 @@
-From cd164b353ba7958d51b2f33f4079fb9787c983e2 Mon Sep 17 00:00:00 2001
+From f629d1c3fcfb560ed24efc3e73d4e4999b1eab33 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Fri, 10 May 2019 14:16:47 +0200
 Subject: [PATCH] Disable documentation directory altogether
@@ -13,11 +13,11 @@ Signed-off-by: Alexander Kanavin <[email protected]>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 83334ba..2cd4f8e 100644
+index 9745c13..7cfc9ee 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -232,7 +232,7 @@ add_subdirectory(apt-private)
- add_subdirectory(apt-inst)
+@@ -239,7 +239,7 @@ add_subdirectory(apt-pkg)
+ add_subdirectory(apt-private)
  add_subdirectory(cmdline)
  add_subdirectory(completions)
 -add_subdirectory(doc)
meta/recipes-devtools/apt/apt/0001-Do-not-configure-packages-on-installation.patch deleted +0 -48

48 lines not on this page · raw message

meta/recipes-devtools/apt/apt/0001-Do-not-init-tables-from-dpkg-configuration.patch +2 -2
index 1417153e81..e0e7e0cd58 100644
@@ -1,4 +1,4 @@
-From bf45c314867e5fb12141803fba06f3e45679d628 Mon Sep 17 00:00:00 2001
+From 382f8381ef8baf754057e376a6d9bf840ca6d543 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Fri, 10 May 2019 16:47:38 +0200
 Subject: [PATCH] Do not init tables from dpkg configuration
@@ -13,7 +13,7 @@ Signed-off-by: Alexander Kanavin <[email protected]>
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
-index a619368..6e5a6cf 100644
+index b9d9b15..1725c59 100644
 --- a/apt-pkg/init.cc
 +++ b/apt-pkg/init.cc
 @@ -281,8 +281,8 @@ bool pkgInitSystem(Configuration &Cnf,pkgSystem *&Sys)
meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch +5 -5
index 37f969690c..c14dc2a414 100644
@@ -1,4 +1,4 @@
-From 34700bebc52659e7e3eecd252f65bd36e669eee8 Mon Sep 17 00:00:00 2001
+From a603b3281f3f60a87531c8cec4843f970170d409 Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <[email protected]>
 Date: Thu, 21 May 2020 20:13:25 +0000
 Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
@@ -20,10 +20,10 @@ Signed-off-by: Alexander Kanavin <[email protected]>
  1 file changed, 2 insertions(+), 7 deletions(-)
 
 diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
-index ffa880d..5875e86 100644
+index 46a6dee..8617a9e 100644
 --- a/apt-pkg/deb/dpkgpm.cc
 +++ b/apt-pkg/deb/dpkgpm.cc
-@@ -1215,12 +1215,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
+@@ -1211,12 +1211,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
  	 }
        }
     }
@@ -35,8 +35,8 @@ index ffa880d..5875e86 100644
 -   ++PackagesTotal;
  }
                                                                          /*}}}*/
- bool pkgDPkgPM::Go(int StatusFd)					/*{{{*/
-@@ -1716,7 +1710,8 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
+ void pkgDPkgPM::StartPtyMagic()						/*{{{*/
+@@ -1710,7 +1704,8 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
  
        // support subpressing of triggers processing for special
        // cases like d-i that runs the triggers handling manually
meta/recipes-devtools/apt/apt/0001-test-libapt-do-not-use-gtest-from-the-host.patch deleted +0 -40
deleted file mode 100644
index 503b5a5c0b..0000000000
@@ -1,40 +0,0 @@
-From 28e389a0d1275e7693df84a7d4a58b28364be1a9 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Thu, 22 Oct 2020 17:33:38 +0200
-Subject: [PATCH] test/libapt: do not use gtest from the host
-
-This really does not work when cross-compiling.
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <[email protected]>
----
- test/libapt/CMakeLists.txt | 16 ----------------
- 1 file changed, 16 deletions(-)
-
-diff --git a/test/libapt/CMakeLists.txt b/test/libapt/CMakeLists.txt
-index 035ff07..280b83c 100644
---- a/test/libapt/CMakeLists.txt
-+++ b/test/libapt/CMakeLists.txt
-@@ -6,22 +6,6 @@ find_path(GTEST_ROOT src/gtest.cc
- find_package(GTest)
- set(GTEST_DEPENDENCIES)
- 
--if(NOT GTEST_FOUND AND EXISTS ${GTEST_ROOT})
--   include(ExternalProject)
--   ExternalProject_Add(gtest PREFIX ./gtest
--                             SOURCE_DIR ${GTEST_ROOT}
--                             INSTALL_COMMAND true)
--
--   link_directories(${CMAKE_CURRENT_BINARY_DIR}/gtest/src/gtest-build)
--
--   set(GTEST_LIBRARIES "-lgtest")
--   set(GTEST_DEPENDENCIES "gtest")
--   set(GTEST_FOUND TRUE)
--   find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_ROOT}/include)
--
--   message(STATUS "Found GTest at ${GTEST_ROOT}, headers at ${GTEST_INCLUDE_DIRS}")
--endif()
--
- if(GTEST_FOUND)
-    # gtest produces some warnings with the set of warnings we activate,
-    # so disable the offending warnings while compiling tests for now
meta/recipes-devtools/apt/apt_2.2.2.bb renamed from meta/recipes-devtools/apt/apt_1.8.2.2.bb +3 -6
similarity index 89%
rename from meta/recipes-devtools/apt/apt_1.8.2.2.bb
rename to meta/recipes-devtools/apt/apt_2.2.2.bb
index 6cda61a7d8..b838495da8 100644
@@ -10,22 +10,19 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \
            file://0001-Disable-documentation-directory-altogether.patch \
            file://0001-Fix-musl-build.patch \
            file://0001-CMakeLists.txt-avoid-changing-install-paths-based-on.patch \
-           file://0001-test-libapt-do-not-use-gtest-from-the-host.patch \
            "
      
 SRC_URI_append_class-native = " \
            file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
            file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
-           file://0001-Do-not-configure-packages-on-installation.patch \
            "
 
 SRC_URI_append_class-nativesdk = " \
            file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
            file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
-           file://0001-Do-not-configure-packages-on-installation.patch \
            "
 
-SRC_URI[sha256sum] = "f5030de22a5cc80db6fe0d42373b5df25d7dc56e94d9155f2eaa80dbd65e82fa"
+SRC_URI[sha256sum] = "c5449a4c2126a12497a9949cd10209926005d329f6ce7942a3781fa2fcf50487"
 LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
 # the package is taken from snapshots.debian.org; that source is static and goes stale
@@ -40,12 +37,12 @@ USERADD_PARAM_${PN} = "--system --home /nonexistent --no-create-home _apt"
 
 BBCLASSEXTEND = "native nativesdk"
 
-DEPENDS += "virtual/libiconv virtual/libintl db gnutls lz4 zlib bzip2 xz"
+DEPENDS += "db gnutls lz4 zlib bzip2 xz libgcrypt xxhash"
 
 EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \
     -DUSE_NLS=False -DDPKG_DATADIR=${datadir}/dpkg \
     -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash \
-    -DCMAKE_DISABLE_FIND_PACKAGE_Zstd=True \
+    -DWITH_TESTS=False \
 "
 
 do_configure_prepend () {
Signature · 1 line
2.31.0
author
#1 lore raw

PATCH v2 2/3 apt: Support old resolver as fallback

Not all C libraries implement the new resolver APIs e.g. musl, therefore keep the old interfaces around and choose using __RES version macro which is meant for this kind of work.

Cc Alexander Kanavin <[email protected]>
---
 ...vrec-Keep-support-for-older-resolver.patch | 44 +++++++++++++++++++
 meta/recipes-devtools/apt/apt_2.2.2.bb        |  3 +-
 2 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/apt/apt/0001-srvrec-Keep-support-for-older-resolver.patch
meta/recipes-devtools/apt/apt/0001-srvrec-Keep-support-for-older-resolver.patch new file +44 -0
new file mode 100644
index 0000000000..94d67a87ac
@@ -0,0 +1,44 @@
+From f98c12b9f04ef3a9daec822c210044095b41a0ac Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 20 Mar 2021 12:33:34 -0700
+Subject: [PATCH] srvrec: Keep support for older resolver
+
+Some C libraries e.g. musl do not implement the new res_n* APIs
+therefore keep the old implementation as fallback and check __RES
+version macro to determine the API level
+
+Upstream-Status: Submitted [https://github.com/Debian/apt/pull/129]
+Signed-off-by: Khem Raj <[email protected]>
+Cc: Julian Andres Klode <[email protected]>
+---
+ apt-pkg/contrib/srvrec.cc | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/apt-pkg/contrib/srvrec.cc b/apt-pkg/contrib/srvrec.cc
+index 4ca208273..3eb5f1d4c 100644
+--- a/apt-pkg/contrib/srvrec.cc
++++ b/apt-pkg/contrib/srvrec.cc
+@@ -62,6 +62,7 @@ bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result)
+    unsigned char answer[PACKETSZ];
+    int answer_len, compressed_name_len;
+    int answer_count;
++#if __RES >= 19991006
+    struct __res_state res;
+ 
+    if (res_ninit(&res) != 0)
+@@ -71,6 +72,12 @@ bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result)
+    std::shared_ptr<void> guard(&res, res_nclose);
+ 
+    answer_len = res_nquery(&res, name.c_str(), C_IN, T_SRV, answer, sizeof(answer));
++#else
++   if (res_init() != 0)
++      return _error->Errno("res_init", "Failed to init resolver");
++
++   answer_len = res_query(name.c_str(), C_IN, T_SRV, answer, sizeof(answer));
++#endif //__RES >= 19991006
+    if (answer_len == -1)
+       return false;
+    if (answer_len < (int)sizeof(HEADER))
+-- 
+2.31.0
+
meta/recipes-devtools/apt/apt_2.2.2.bb +2 -1
index b838495da8..7ee661d4c8 100644
@@ -10,8 +10,9 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \
            file://0001-Disable-documentation-directory-altogether.patch \
            file://0001-Fix-musl-build.patch \
            file://0001-CMakeLists.txt-avoid-changing-install-paths-based-on.patch \
+           file://0001-srvrec-Keep-support-for-older-resolver.patch \
            "
-     
+
 SRC_URI_append_class-native = " \
            file://0001-Do-not-init-tables-from-dpkg-configuration.patch \
            file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
Signature · 1 line
2.31.0
author
#2 lore raw

PATCH v2 3/3 apt: Do not disable NLS

In reply to Khem Raj

Add a patch to disable cmake po targets

Cc Alexander Kanavin <[email protected]>
---
 .../0001-cmake-Do-not-build-po-files.patch    | 37 +++++++++++++++++++
 meta/recipes-devtools/apt/apt_2.2.2.bb        |  3 +-
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/apt/apt/0001-cmake-Do-not-build-po-files.patch
meta/recipes-devtools/apt/apt/0001-cmake-Do-not-build-po-files.patch new file +37 -0
new file mode 100644
index 0000000000..2837b7f1b3
@@ -0,0 +1,37 @@
+From 33347f9f8301633b01af4e208b7be5fdfcb0df0c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 20 Mar 2021 14:45:18 -0700
+Subject: [PATCH] cmake: Do not build po files
+
+Fixes
+| CMake Error at CMakeLists.txt:252 (add_dependencies):
+|   The dependency target "update-po4a" of target "update-po" does not exist.
+|
+
+Upstream-Status: Inappropriate [Cross-compile specific]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ CMakeLists.txt | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c8ec3f..821a24f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -245,13 +245,6 @@ add_subdirectory(ftparchive)
+ add_subdirectory(methods)
+ add_subdirectory(test)
+ 
+-if (USE_NLS)
+-add_subdirectory(po)
+-
+-# Link update-po4a into the update-po target
+-add_dependencies(update-po update-po4a)
+-endif()
+-
+ # Create our directories.
+ install_empty_directories(
+   ${CONF_DIR}/apt.conf.d
+-- 
+2.31.0
+
meta/recipes-devtools/apt/apt_2.2.2.bb +2 -1
index 7ee661d4c8..d1aa5de8df 100644
@@ -11,6 +11,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \
            file://0001-Fix-musl-build.patch \
            file://0001-CMakeLists.txt-avoid-changing-install-paths-based-on.patch \
            file://0001-srvrec-Keep-support-for-older-resolver.patch \
+           file://0001-cmake-Do-not-build-po-files.patch \
            "
 
 SRC_URI_append_class-native = " \
@@ -41,7 +42,7 @@ BBCLASSEXTEND = "native nativesdk"
 DEPENDS += "db gnutls lz4 zlib bzip2 xz libgcrypt xxhash"
 
 EXTRA_OECMAKE_append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \
-    -DUSE_NLS=False -DDPKG_DATADIR=${datadir}/dpkg \
+    -DDPKG_DATADIR=${datadir}/dpkg \
     -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash \
     -DWITH_TESTS=False \
 "
Signature · 1 line
2.31.0