From 76b5fa18e6d251d33ac474acce6cd3e48e215405 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Tue, 8 Mar 2022 10:32:13 +0100 Subject: apt: upgrade 2.2.4 -> 2.4.0 (From OE-Core rev: dabd96bd0b663300b7d6d2e820bafe5b5c70a314) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- ...o-not-init-tables-from-dpkg-configuration.patch | 2 +- ...ys-run-dpkg-configure-a-at-the-end-of-our.patch | 8 +- ...01-srvrec-Keep-support-for-older-resolver.patch | 44 ------- meta/recipes-devtools/apt/apt_2.2.4.bb | 137 --------------------- meta/recipes-devtools/apt/apt_2.4.0.bb | 136 ++++++++++++++++++++ 5 files changed, 141 insertions(+), 186 deletions(-) delete mode 100644 meta/recipes-devtools/apt/apt/0001-srvrec-Keep-support-for-older-resolver.patch delete mode 100644 meta/recipes-devtools/apt/apt_2.2.4.bb create mode 100644 meta/recipes-devtools/apt/apt_2.4.0.bb 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 72713c3b1a..59b9cd190f 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 @@ -From c7a79e753e50f1a5f248ba5812c61616f2f524f0 Mon Sep 17 00:00:00 2001 +From 11ba49594ae9d11f0070198c146b5e437fa83022 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Fri, 10 May 2019 16:47:38 +0200 Subject: [PATCH] Do not init tables from dpkg configuration 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 1517b47858..593ed7d096 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 @@ -From 393ac20efc66bfc000a2457e093e369b934c5a50 Mon Sep 17 00:00:00 2001 +From 47c2b42af60ceefd8ed52b32a3a365facf0e05b8 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin 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 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc -index 46a6dee..8617a9e 100644 +index 93effa9..4375781 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc -@@ -1211,12 +1211,6 @@ void pkgDPkgPM::BuildPackagesProgressMap() +@@ -1199,12 +1199,6 @@ void pkgDPkgPM::BuildPackagesProgressMap() } } } @@ -36,7 +36,7 @@ index 46a6dee..8617a9e 100644 } /*}}}*/ void pkgDPkgPM::StartPtyMagic() /*{{{*/ -@@ -1710,7 +1704,8 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) +@@ -1741,7 +1735,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 diff --git a/meta/recipes-devtools/apt/apt/0001-srvrec-Keep-support-for-older-resolver.patch b/meta/recipes-devtools/apt/apt/0001-srvrec-Keep-support-for-older-resolver.patch deleted file mode 100644 index 94d67a87ac..0000000000 --- a/meta/recipes-devtools/apt/apt/0001-srvrec-Keep-support-for-older-resolver.patch +++ /dev/null @@ -1,44 +0,0 @@ -From f98c12b9f04ef3a9daec822c210044095b41a0ac Mon Sep 17 00:00:00 2001 -From: Khem Raj -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 -Cc: Julian Andres Klode ---- - 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 &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 &Result) - std::shared_ptr 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 - diff --git a/meta/recipes-devtools/apt/apt_2.2.4.bb b/meta/recipes-devtools/apt/apt_2.2.4.bb deleted file mode 100644 index aef309840b..0000000000 --- a/meta/recipes-devtools/apt/apt_2.2.4.bb +++ /dev/null @@ -1,137 +0,0 @@ -SUMMARY = "Advanced front-end for dpkg" -DESCRIPTION = "APT is the Advanced Package Tool, an advanced interface to the Debian packaging system which provides the apt-get program." -HOMEPAGE = "https://packages.debian.org/jessie/apt" -LICENSE = "GPL-2.0-or-later" -SECTION = "base" - -# Triehash script taken from https://github.com/julian-klode/triehash -SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \ - file://triehash \ - 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 \ - file://0001-cmake-Do-not-build-po-files.patch \ - file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \ - file://0001-aptwebserver.cc-Include-array.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 \ - " - -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 \ - " - -SRC_URI[sha256sum] = "6eecd04a4979bd2040b22a14571c15d342c4e1802b2023acb5aa19649b1f64ea" -LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" - -# the package is taken from snapshots.debian.org; that source is static and goes stale -# so we check the latest upstream from a directory that does get updated -UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/" - -inherit cmake perlnative bash-completion upstream-version-is-even useradd - -# User is added to allow apt to drop privs, will runtime warn without -USERADD_PACKAGES = "${PN}" -USERADD_PARAM:${PN} = "--system --home /nonexistent --no-create-home _apt" - -BBCLASSEXTEND = "native nativesdk" - -DEPENDS += "db gnutls lz4 zlib bzip2 xz libgcrypt xxhash" - -EXTRA_OECMAKE:append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \ - -DDPKG_DATADIR=${datadir}/dpkg \ - -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash \ - -DCMAKE_DISABLE_FIND_PACKAGE_ZSTD=True \ - -DCMAKE_DISABLE_FIND_PACKAGE_SECCOMP=True \ - -DWITH_TESTS=False \ -" - -do_configure:prepend() { - echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake -} - -# Unfortunately apt hardcodes this all over the place -FILES:${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt" -RDEPENDS:${PN} += "bash perl dpkg" - -customize_apt_conf_sample() { - cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF -Dir "${STAGING_DIR_NATIVE}/" -{ - State "var/lib/apt/" - { - Lists "#APTCONF#/lists/"; - status "#ROOTFS#/var/lib/dpkg/status"; - }; - Cache "var/cache/apt/" - { - Archives "archives/"; - pkgcache ""; - srcpkgcache ""; - }; - Bin "${STAGING_BINDIR_NATIVE}/" - { - methods "${STAGING_LIBDIR}/apt/methods/"; - gzip "/bin/gzip"; - dpkg "dpkg"; - dpkg-source "dpkg-source"; - dpkg-buildpackage "dpkg-buildpackage"; - apt-get "apt-get"; - apt-cache "apt-cache"; - }; - Etc "#APTCONF#" - { - Preferences "preferences"; - }; - Log "var/log/apt"; -}; - -APT -{ - Install-Recommends "true"; - Immediate-Configure "false"; - Architecture "i586"; - Get - { - Assume-Yes "true"; - }; -}; - -Acquire -{ - AllowInsecureRepositories "true"; -}; - -DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"}; -DPkg::Path ""; -EOF -} - -do_install:append:class-native() { - customize_apt_conf_sample -} - -do_install:append:class-nativesdk() { - customize_apt_conf_sample -} - -do_install:append:class-target() { - # Write the correct apt-architecture to apt.conf - APT_CONF=${D}${sysconfdir}/apt/apt.conf - echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF} - - # Remove /var/log/apt. /var/log is normally a link to /var/volatile/log - # and /var/volatile is a tmpfs mount. So anything created in /var/log - # will not be available when the tmpfs is mounted. - rm -rf ${D}${localstatedir}/log -} - -do_install:append() { - # Avoid non-reproducible -src package - sed -i -e "s,${B},,g" ${B}/apt-pkg/tagfile-keys.cc -} diff --git a/meta/recipes-devtools/apt/apt_2.4.0.bb b/meta/recipes-devtools/apt/apt_2.4.0.bb new file mode 100644 index 0000000000..c95e36e3d0 --- /dev/null +++ b/meta/recipes-devtools/apt/apt_2.4.0.bb @@ -0,0 +1,136 @@ +SUMMARY = "Advanced front-end for dpkg" +DESCRIPTION = "APT is the Advanced Package Tool, an advanced interface to the Debian packaging system which provides the apt-get program." +HOMEPAGE = "https://packages.debian.org/jessie/apt" +LICENSE = "GPL-2.0-or-later" +SECTION = "base" + +# Triehash script taken from https://github.com/julian-klode/triehash +SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \ + file://triehash \ + 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-cmake-Do-not-build-po-files.patch \ + file://0001-Hide-fstatat64-and-prlimit64-defines-on-musl.patch \ + file://0001-aptwebserver.cc-Include-array.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 \ + " + +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 \ + " + +SRC_URI[sha256sum] = "728c69df369cbc4a55f91fc2817fe9832c1a2f39de4142e7ef222c5158f234af" +LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +# the package is taken from snapshots.debian.org; that source is static and goes stale +# so we check the latest upstream from a directory that does get updated +UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/" + +inherit cmake perlnative bash-completion upstream-version-is-even useradd + +# User is added to allow apt to drop privs, will runtime warn without +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "--system --home /nonexistent --no-create-home _apt" + +BBCLASSEXTEND = "native nativesdk" + +DEPENDS += "db gnutls lz4 zlib bzip2 xz libgcrypt xxhash" + +EXTRA_OECMAKE:append = " -DCURRENT_VENDOR=debian -DWITH_DOC=False \ + -DDPKG_DATADIR=${datadir}/dpkg \ + -DTRIEHASH_EXECUTABLE=${WORKDIR}/triehash \ + -DCMAKE_DISABLE_FIND_PACKAGE_ZSTD=True \ + -DCMAKE_DISABLE_FIND_PACKAGE_SECCOMP=True \ + -DWITH_TESTS=False \ +" + +do_configure:prepend() { + echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH )" >> ${WORKDIR}/toolchain.cmake +} + +# Unfortunately apt hardcodes this all over the place +FILES:${PN} += "${prefix}/lib/dpkg ${prefix}/lib/apt" +RDEPENDS:${PN} += "bash perl dpkg" + +customize_apt_conf_sample() { + cat > ${D}${sysconfdir}/apt/apt.conf.sample << EOF +Dir "${STAGING_DIR_NATIVE}/" +{ + State "var/lib/apt/" + { + Lists "#APTCONF#/lists/"; + status "#ROOTFS#/var/lib/dpkg/status"; + }; + Cache "var/cache/apt/" + { + Archives "archives/"; + pkgcache ""; + srcpkgcache ""; + }; + Bin "${STAGING_BINDIR_NATIVE}/" + { + methods "${STAGING_LIBDIR}/apt/methods/"; + gzip "/bin/gzip"; + dpkg "dpkg"; + dpkg-source "dpkg-source"; + dpkg-buildpackage "dpkg-buildpackage"; + apt-get "apt-get"; + apt-cache "apt-cache"; + }; + Etc "#APTCONF#" + { + Preferences "preferences"; + }; + Log "var/log/apt"; +}; + +APT +{ + Install-Recommends "true"; + Immediate-Configure "false"; + Architecture "i586"; + Get + { + Assume-Yes "true"; + }; +}; + +Acquire +{ + AllowInsecureRepositories "true"; +}; + +DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"}; +DPkg::Path ""; +EOF +} + +do_install:append:class-native() { + customize_apt_conf_sample +} + +do_install:append:class-nativesdk() { + customize_apt_conf_sample +} + +do_install:append:class-target() { + # Write the correct apt-architecture to apt.conf + APT_CONF=${D}${sysconfdir}/apt/apt.conf + echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF} + + # Remove /var/log/apt. /var/log is normally a link to /var/volatile/log + # and /var/volatile is a tmpfs mount. So anything created in /var/log + # will not be available when the tmpfs is mounted. + rm -rf ${D}${localstatedir}/log +} + +do_install:append() { + # Avoid non-reproducible -src package + sed -i -e "s,${B},,g" ${B}/apt-pkg/tagfile-keys.cc +} -- cgit v1.2.3-54-g00ecf