diff options
author | Julian Andres Klode <jak@debian.org> | 2024-04-26 11:01:17 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2024-04-26 11:01:17 +0000 |
commit | 05a1ee0cf4d5948ec2a084629bb9712af7d9c475 (patch) | |
tree | 91bab74096260d12d8f4a2300bcd84f3bdb17b99 | |
parent | edfbc3869361f709d70794a794199ac2076ea9f1 (diff) | |
parent | 7a1063e81b855ac7ff9ee54f115843c3af6dd1bf (diff) |
Merge branch 'fix/mixed' into 'main'
Split out of mostly independent fixes: cmake execute errors, removed rev-deps, protected garbage & co
See merge request apt-team/apt!345
-rw-r--r-- | CMake/vendor_substitute.cmake | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | apt-pkg/CMakeLists.txt | 12 | ||||
-rw-r--r-- | apt-pkg/depcache.cc | 7 | ||||
-rw-r--r-- | apt-private/private-install.cc | 40 | ||||
-rw-r--r-- | test/integration/framework | 1 | ||||
-rwxr-xr-x | test/integration/test-apt-get-autoremove | 26 | ||||
-rwxr-xr-x | test/integration/test-bug-604222-new-and-autoremove | 34 | ||||
-rwxr-xr-x | test/integration/test-bug-611729-mark-as-manual | 8 | ||||
-rwxr-xr-x | test/integration/test-bug-613420-new-garbage-dependency | 8 | ||||
-rwxr-xr-x | test/integration/test-disappearing-packages | 13 | ||||
-rwxr-xr-x | test/integration/test-external-dependency-solver-protocol | 6 | ||||
-rwxr-xr-x | test/integration/test-kernel-helper-autoremove | 10 | ||||
-rwxr-xr-x | test/integration/test-not-upgrading-removed-depends | 50 | ||||
-rwxr-xr-x | test/integration/test-suggests-promoted-to-recommends | 65 | ||||
-rw-r--r-- | vendor/CMakeLists.txt | 3 |
16 files changed, 208 insertions, 87 deletions
diff --git a/CMake/vendor_substitute.cmake b/CMake/vendor_substitute.cmake index 71449c9e8..277cb3ac9 100644 --- a/CMake/vendor_substitute.cmake +++ b/CMake/vendor_substitute.cmake @@ -2,7 +2,8 @@ file(READ ${IN} input) foreach(variable ${VARS}) execute_process(COMMAND ${PROJECT_SOURCE_DIR}/vendor/getinfo --vendor ${CURRENT_VENDOR} ${variable} - OUTPUT_VARIABLE value OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE value OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) string(REPLACE "&${variable};" "${value}" input "${input}") endforeach() file(WRITE ${OUT} "${input}") diff --git a/CMakeLists.txt b/CMakeLists.txt index 00ba2e499..11b614af5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,17 +211,20 @@ string(REGEX MATCH "^[0-9.]+" PROJECT_VERSION ${PACKAGE_VERSION}) if (NOT DEFINED DPKG_DATADIR) execute_process(COMMAND ${PERL_EXECUTABLE} -MDpkg -e "print $Dpkg::DATADIR;" - OUTPUT_VARIABLE DPKG_DATADIR_CMD OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE DPKG_DATADIR_CMD OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) message(STATUS "Found dpkg data dir: ${DPKG_DATADIR_CMD}") set(DPKG_DATADIR "${DPKG_DATADIR_CMD}" CACHE PATH "dpkg data directory") endif() if (NOT DEFINED COMMON_ARCH) execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH - OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) endif() if (NOT DEFINED ROOT_GROUP) execute_process(COMMAND id -gn root - OUTPUT_VARIABLE ROOT_GROUP OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE ROOT_GROUP OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) message(STATUS "Found root group: ${ROOT_GROUP}") endif() set(ROOT_GROUP "${ROOT_GROUP}" CACHE STRING "Group of root (e.g.: wheel or root)") diff --git a/apt-pkg/CMakeLists.txt b/apt-pkg/CMakeLists.txt index d13aed96c..63052faad 100644 --- a/apt-pkg/CMakeLists.txt +++ b/apt-pkg/CMakeLists.txt @@ -3,7 +3,8 @@ include_directories(${PROJECT_BINARY_DIR}/include/apt-pkg) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/apt-pkg/) execute_process(COMMAND grep -v "^#" "${CMAKE_CURRENT_SOURCE_DIR}/tagfile-keys.list" - OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/tagfile-keys.clean.list") + OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/tagfile-keys.clean.list" + COMMAND_ERROR_IS_FATAL ANY) execute_process(COMMAND ${TRIEHASH_EXECUTABLE} --ignore-case --header ${PROJECT_BINARY_DIR}/include/apt-pkg/tagfile-keys.h @@ -13,7 +14,8 @@ execute_process(COMMAND ${TRIEHASH_EXECUTABLE} --function-name pkgTagHash --include "<apt-pkg/tagfile.h>" --include "<apt-pkg/header-is-private.h>" - "${CMAKE_CURRENT_BINARY_DIR}/tagfile-keys.clean.list") + "${CMAKE_CURRENT_BINARY_DIR}/tagfile-keys.clean.list" + COMMAND_ERROR_IS_FATAL ANY) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "tagfile-keys.list") set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/tagfile-keys.cc" PROPERTIES COMPILE_DEFINITIONS APT_COMPILING_APT) @@ -22,11 +24,13 @@ set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/tagfile-keys.cc" PROPER execute_process(COMMAND awk -v ORS=. "/^\#define APT_PKG_M/ {print \$3}" COMMAND sed "s/\\.\$//" INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/contrib/macros.h - OUTPUT_VARIABLE MAJOR OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE MAJOR OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) execute_process(COMMAND grep "^#define APT_PKG_RELEASE" COMMAND cut -d " " -f 3 INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/contrib/macros.h - OUTPUT_VARIABLE MINOR OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE MINOR OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) message(STATUS "Building libapt-pkg ${MAJOR} (release ${MINOR})") set(APT_PKG_MAJOR ${MAJOR} PARENT_SCOPE) # exporting for methods/CMakeLists.txt diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 76a5c09ba..72cbf8dcc 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1463,7 +1463,7 @@ static bool MarkInstall_RemoveConflictsIfNotUpgradeable(pkgDepCache &Cache, bool return not failedToRemoveSomething; } /*}}}*/ -static bool MarkInstall_CollectReverseDepends(pkgDepCache &Cache, bool const DebugAutoInstall, pkgCache::VerIterator const &PV, unsigned long Depth, APT::PackageVector &toUpgrade) /*{{{*/ +static bool MarkInstall_CollectReverseDepends(pkgDepCache &Cache, bool const DebugAutoInstall, pkgCache::VerIterator const &PV, unsigned long Depth, APT::PackageVector &toUpgrade, APT::PackageVector const &delayedRemove) /*{{{*/ { auto CurrentVer = PV.ParentPkg().CurrentVer(); if (CurrentVer.end()) @@ -1474,6 +1474,9 @@ static bool MarkInstall_CollectReverseDepends(pkgDepCache &Cache, bool const Deb // Skip non-installed versions and packages already marked for upgrade if (ParentPkg.CurrentVer() != D.ParentVer() || Cache[ParentPkg].Install()) continue; + // Skip rev-depends we already tagged for removal + if (Cache[ParentPkg].Delete() || std::find(delayedRemove.begin(), delayedRemove.end(), ParentPkg) != delayedRemove.end()) + continue; // We only handle important positive dependencies, RemoveConflictsIfNotUpgradeable handles negative if (not Cache.IsImportantDep(D) || D.IsNegative()) continue; @@ -1722,7 +1725,7 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg, bool AutoInst, return false; hasFailed = true; } - if (not MarkInstall_CollectReverseDepends(*this, DebugAutoInstall, PV, Depth, toUpgrade)) + if (not MarkInstall_CollectReverseDepends(*this, DebugAutoInstall, PV, Depth, toUpgrade, delayedRemove)) { if (failEarly) return false; diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 9a2ed0b2a..4f71f18c4 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -20,6 +20,7 @@ #include <apt-pkg/prettyprinters.h> #include <apt-pkg/strutl.h> #include <apt-pkg/upgrade.h> +#include <apt-pkg/version.h> #include <algorithm> #include <cstdlib> @@ -214,16 +215,6 @@ bool InstallPackages(CacheFile &Cache, APT::PackageVector &HeldBackPackages, boo return false; } - APT::PackageVector PhasingPackages; - APT::PackageVector NotPhasingHeldBackPackages; - for (auto const &Pkg : HeldBackPackages) - { - if (Cache->PhasingApplied(Pkg)) - PhasingPackages.push_back(Pkg); - else - NotPhasingHeldBackPackages.push_back(Pkg); - } - // Show all the various warning indicators if (_config->FindI("APT::Output-Version") < 30) ShowDel(c1out,Cache); @@ -234,6 +225,16 @@ bool InstallPackages(CacheFile &Cache, APT::PackageVector &HeldBackPackages, boo ShowWeakDependencies(Cache); if (ShwKept == true) { + APT::PackageVector PhasingPackages; + APT::PackageVector NotPhasingHeldBackPackages; + for (auto const &Pkg : HeldBackPackages) + { + if (Cache->PhasingApplied(Pkg)) + PhasingPackages.push_back(Pkg); + else + NotPhasingHeldBackPackages.push_back(Pkg); + } + ShowPhasing(c1out, Cache, PhasingPackages); ShowKept(c1out, Cache, NotPhasingHeldBackPackages); if (not PhasingPackages.empty() && not NotPhasingHeldBackPackages.empty()) @@ -620,12 +621,14 @@ bool DoAutomaticRemove(CacheFile &Cache) for (APT::PackageSet::iterator Pkg = tooMuch.begin(); Pkg != tooMuch.end(); ++Pkg) { - APT::PackageSet too; - too.insert(*Pkg); - for (pkgCache::PrvIterator Prv = Cache[Pkg].CandidateVerIter(Cache).ProvidesList(); - Prv.end() == false; ++Prv) - too.insert(Prv.ParentPkg()); - for (APT::PackageSet::const_iterator P = too.begin(); P != too.end(); ++P) + auto const PkgCand = Cache[Pkg].CandidateVerIter(Cache); + if (unlikely(PkgCand.end())) + continue; + std::vector<std::pair<pkgCache::PkgIterator, char const *>> too; + too.emplace_back(*Pkg, PkgCand.VerStr()); + for (pkgCache::PrvIterator Prv = PkgCand.ProvidesList(); not Prv.end(); ++Prv) + too.emplace_back(Prv.ParentPkg(), Prv.ProvideVersion()); + for (auto const &[P, PVerStr] : too) { for (pkgCache::DepIterator R = P.RevDependsList(); R.end() == false; ++R) @@ -650,6 +653,11 @@ bool DoAutomaticRemove(CacheFile &Cache) } else // ignore dependency from a non-candidate version continue; + if (R->Version != 0) + { + if (not Cache->VS().CheckDep(PVerStr, R->CompareOp, R.TargetVer())) + continue; + } if (Debug == true) std::clog << "Save " << APT::PrettyPkg(Cache, Pkg) << " as another installed package depends on it: " << APT::PrettyPkg(Cache, RP) << std::endl; Cache->MarkInstall(Pkg, false, 0, false); diff --git a/test/integration/framework b/test/integration/framework index 147de9808..de280cb8d 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -324,6 +324,7 @@ setupenvironment() { unset DEB_CHECK_COMMAND DEB_SIGN_KEYID DEB_BUILD_OPTIONS DEB_BUILD_PROFILES unset DH_VERBOSE DH_QUIET DH_COMPAT DH_NO_ACT DH_OPTIONS DH_EXTRA_ADDONS unset GREP_OPTIONS POSIXLY_CORRECT + unset SUDO_USER SUDO_UID SUDO_GID SUDO_COMMAND unset http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy export GCOV_ERROR_FILE=/dev/null diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index 66257f442..9454df5c8 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -27,10 +27,6 @@ testdpkginstalled 'po-debconf' 'unrelated' echo 'unrelated purge' | dpkg --set-selections testdpkgstatus 'pi' '1' 'unrelated' -AUTOREMOVE='apt autoremove' -if [ -n "$SUDO_USER" ]; then - AUTOREMOVE="sudo $AUTOREMOVE" -fi echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove testsuccessequal 'Reading package lists... Building dependency tree... @@ -39,20 +35,28 @@ The following packages will be REMOVED: po-debconf 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Remv po-debconf [1.0.16]' aptget autoremove -s -testequal "Reading package lists... +for sudouser in '_apt' ''; do + if [ -n "$sudouser" ]; then + export SUDO_USER="$sudouser" + AUTOREMOVE='sudo apt autoremove' + else + unset SUDO_USER + AUTOREMOVE='apt autoremove' + fi + testequal "Reading package lists... Building dependency tree... Reading state information... The following package was automatically installed and is no longer required: po-debconf Use '$AUTOREMOVE' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -testequal "Reading package lists... + testequal "Reading package lists... Building dependency tree... Reading state information... 1 package was automatically installed and is no longer required. Use '$AUTOREMOVE' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small -testequal "Reading package lists... + testequal "Reading package lists... Building dependency tree... Reading state information... Calculating upgrade... @@ -60,6 +64,8 @@ The following package was automatically installed and is no longer required: po-debconf Use '$AUTOREMOVE' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget upgrade -s +done + testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... @@ -111,7 +117,7 @@ Reading state information... Calculating upgrade... The following package was automatically installed and is no longer required: po-debconf -Use '$AUTOREMOVE' to remove it. +Use 'apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget upgrade -s rm -f rootdir/etc/apt/apt.conf.d/autoremoval @@ -163,13 +169,13 @@ Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: debhelper po-debconf -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s testequal "Reading package lists... Building dependency tree... Reading state information... 2 packages were automatically installed and are no longer required. -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small testsuccess aptmark hold debhelper diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 47da810c6..78a288214 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -17,26 +17,34 @@ insertpackage 'stable' 'libkf5kipi-bin' 'i386' '4:16.08.0-1' insertpackage 'stable' 'libkf5kipi-data' 'i386' '4:16.08.0-1' 'Breaks: libkipi-data' insertpackage 'stable' 'libkipi-data' 'i386' '4:15.08.0-1' '' 'important' +insertpackage 'stable' 'libgphoto2-l10n' 'all' '2' +insertpackage 'installed,stable' 'photoapp1' 'all' '1' 'Recommends: libgphoto2-l10n (= 1)' +insertinstalledpackage 'photoapp2' 'all' '1' +insertpackage 'stable' 'photoapp2' 'all' '2' 'Conflicts: photoapp1 +Recommends: libgphoto2-l10n (= 2)' + setupaptarchive +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + photoapp2 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.' apt upgrade -s + insertinstalledpackage 'libvtk5.4' 'i386' '5.4.2-7' testsuccess aptmark markauto 'libvtk5.4' testmarkedauto 'libvtk5.4' -AUTOREMOVE='apt autoremove' -if [ -n "$SUDO_USER" ]; then - AUTOREMOVE="sudo $AUTOREMOVE" -fi - testsuccessequal "Reading package lists... Building dependency tree... Reading state information... The following package was automatically installed and is no longer required: libvtk5.4 -Use '$AUTOREMOVE' to remove it. +Use 'apt autoremove' to remove it. The following NEW packages will be installed: libavcodec52 -0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. Inst libavcodec52 (4:0.5.2-6 stable [i386]) Conf libavcodec52 (4:0.5.2-6 stable [i386])" aptget install libavcodec52 -s @@ -44,10 +52,10 @@ testsuccessequal "Reading package lists... Building dependency tree... Reading state information... 1 package was automatically installed and is no longer required. -Use '$AUTOREMOVE' to remove it. +Use 'apt autoremove' to remove it. The following NEW packages will be installed: libavcodec52 -0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. Inst libavcodec52 (4:0.5.2-6 stable [i386]) Conf libavcodec52 (4:0.5.2-6 stable [i386])" aptget install libavcodec52 -s -o APT::Get::HideAutoRemove=small @@ -56,12 +64,12 @@ Building dependency tree... Reading state information... The following package was automatically installed and is no longer required: libvtk5.4 -Use '$AUTOREMOVE' to remove it. +Use 'apt autoremove' to remove it. The following additional packages will be installed: libavcodec52 libopenal-dev The following NEW packages will be installed: dummy-archive libavcodec52 libopenal-dev -0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded. +0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded. Need to get 0 B/126 B of archives. After this operation, 129 kB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only @@ -69,12 +77,12 @@ testequal "Reading package lists... Building dependency tree... Reading state information... 1 package was automatically installed and is no longer required. -Use '$AUTOREMOVE' to remove it. +Use 'apt autoremove' to remove it. The following additional packages will be installed: libavcodec52 libopenal-dev The following NEW packages will be installed: dummy-archive libavcodec52 libopenal-dev -0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded. +0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded. Need to get 0 B/126 B of archives. After this operation, 129 kB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only -o APT::Get::HideAutoRemove=small diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual index 63f8245a7..bd9af32b6 100755 --- a/test/integration/test-bug-611729-mark-as-manual +++ b/test/integration/test-bug-611729-mark-as-manual @@ -56,14 +56,8 @@ testdpkginstalled b c testmarkedauto 'b' sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -if [ -n "$SUDO_USER" ] && [ "$(id -u "$SUDO_USER")" -gt 0 ]; then - testfileequal 'rootdir/var/log/apt/history.log' " -Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) -Reinstall: b:i386 (1.0)" -else - testfileequal 'rootdir/var/log/apt/history.log' ' +testfileequal 'rootdir/var/log/apt/history.log' ' Reinstall: b:i386 (1.0)' -fi testsuccessequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 46c3d94c9..75a653c7e 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -16,17 +16,13 @@ setupaptarchive touch rootdir/var/lib/apt/extended_states testsuccess aptmark markauto openoffice.org-officebean testmarkedauto openoffice.org-officebean -AUTOREMOVE='apt autoremove' -if [ -n "$SUDO_USER" ]; then - AUTOREMOVE="sudo $AUTOREMOVE" -fi testfailureequal "Reading package lists... Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: libreoffice-officebean openoffice.org-officebean -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. The following additional packages will be installed: libreoffice-core libreoffice-officebean openoffice.org-officebean The following packages will be REMOVED: @@ -43,7 +39,7 @@ testequal "Reading package lists... Building dependency tree... Reading state information... 2 packages were automatically installed and are no longer required. -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. The following additional packages will be installed: libreoffice-core libreoffice-officebean openoffice.org-officebean The following packages will be REMOVED: diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index f3fed04f3..f93e10e74 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -60,23 +60,12 @@ all files have been overwritten by other packages: Note: This is done automatically and on purpose by dpkg.' tail -n 4 disappear.output sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -e "s#:$(getarchitecture 'native') #:native #" -if [ -n "$SUDO_USER" ] && [ "$(id -u "$SUDO_USER")" -gt 0 ]; then - testfileequal 'rootdir/var/log/apt/history.log' " -Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) -Install: old-pkg:native (1) - -Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) -Install: new-pkg:native (2, automatic) -Upgrade: old-pkg:native (1, 2) -Disappeared: old-pkg (1)" -else - testfileequal 'rootdir/var/log/apt/history.log' ' +testfileequal 'rootdir/var/log/apt/history.log' ' Install: old-pkg:native (1) Install: new-pkg:native (2, automatic) Upgrade: old-pkg:native (1, 2) Disappeared: old-pkg (1)' -fi testmarkedauto # new-pkg should have get the manual flag from old-pkg diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol index 485a77068..ca6a5ae8b 100755 --- a/test/integration/test-external-dependency-solver-protocol +++ b/test/integration/test-external-dependency-solver-protocol @@ -113,17 +113,13 @@ Remv somestuff [1] Remv cool [1] Remv stuff [1]' aptget autoremove --solver apt somestuff -s -AUTOREMOVE='apt autoremove' -if [ -n "$SUDO_USER" ]; then - AUTOREMOVE="sudo $AUTOREMOVE" -fi testsuccessequal "Reading package lists... Building dependency tree... Reading state information... Execute external solver... The following package was automatically installed and is no longer required: stuff -Use '$AUTOREMOVE' to remove it. +Use 'apt autoremove' to remove it. The following packages will be REMOVED: cool* somestuff* 0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded. diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove index 208bd1425..20a09685a 100755 --- a/test/integration/test-kernel-helper-autoremove +++ b/test/integration/test-kernel-helper-autoremove @@ -45,10 +45,6 @@ testprotected() { testfailure --nomsg grep -e '^\^linux-image-amd64\$$' -e '^\^linux-image-686-pae\$$' -e ':i386' protected.list } -AUTOREMOVE='apt autoremove' -if [ -n "$SUDO_USER" ]; then - AUTOREMOVE="sudo $AUTOREMOVE" -fi testsuccessequal "Reading package lists... Building dependency tree... Reading state information... @@ -60,7 +56,7 @@ The following packages were automatically installed and are no longer required: ${CURRENTKERNEL}+variant (5-1) ${CURRENTKERNEL}-686-pae:i386 (5-1) ${CURRENTKERNEL}-dbg (5-1) -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV -o APT::Protect-Kernels=0 testsuccessequal "Reading package lists... Building dependency tree... @@ -74,13 +70,13 @@ The following packages were automatically installed and are no longer required: ${CURRENTKERNEL}-686-pae:i386 (5-1) ${CURRENTKERNEL}-dbg (5-1) ${CURRENTKERNEL}-rt (5-1) -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV --ignore-hold -o APT::Protect-Kernels=0 testequal "Reading package lists... Building dependency tree... Reading state information... 7 packages were automatically installed and are no longer required. -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small -o APT::Protect-Kernels=0 testequal "Reading package lists... Building dependency tree... diff --git a/test/integration/test-not-upgrading-removed-depends b/test/integration/test-not-upgrading-removed-depends new file mode 100755 index 000000000..54b20422c --- /dev/null +++ b/test/integration/test-not-upgrading-removed-depends @@ -0,0 +1,50 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertpackage 'unstable' 'untouchable-for-solving' 'all' '1' 'Conflicts: main' +insertpackage 'installed' 'bad' 'all' '1' 'Depends: main (= 1)' +insertpackage 'unstable' 'bad' 'all' '2' 'Depends: main (= 2), untouchable-for-solving' + +insertpackage 'installed' 'main' 'all' '1' +insertpackage 'unstable' 'main' 'all' '2' 'Breaks: bad' + +insertpackage 'unstable' 'else' 'all' '1' +insertpackage 'unstable' 'meta' 'all' '1' 'Depends: main (= 2) | else' + +setupaptarchive + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + bad +The following packages will be upgraded: + main +1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Remv bad [1] +Inst main [1] (2 unstable [all]) +Conf main (2 unstable [all])' apt install -s main +testsuccess apt install -s main -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +testfailure grep 'untouchable-for-solving' rootdir/tmp/testsuccess.output +testsuccessequal 'Reading package lists... +Building dependency tree... +The following additional packages will be installed: + main +The following packages will be REMOVED: + bad +The following NEW packages will be installed: + meta +The following packages will be upgraded: + main +1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv bad [1] +Inst main [1] (2 unstable [all]) +Inst meta (1 unstable [all]) +Conf main (2 unstable [all]) +Conf meta (1 unstable [all])' apt install -s meta +testsuccess apt install -s meta -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +testfailure grep 'untouchable-for-solving' rootdir/tmp/testsuccess.output diff --git a/test/integration/test-suggests-promoted-to-recommends b/test/integration/test-suggests-promoted-to-recommends new file mode 100755 index 000000000..57497f7d9 --- /dev/null +++ b/test/integration/test-suggests-promoted-to-recommends @@ -0,0 +1,65 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'oldrec' 'all' '1' +insertinstalledpackage 'oldsug' 'all' '1' +insertinstalledpackage 'instreg' 'all' '1' +insertinstalledpackage 'instsug' 'all' '1' + +insertpackage 'unstable' 'unsatrec' 'all' '2' +insertpackage 'unstable' 'unsatsug' 'all' '2' +insertpackage 'unstable' 'newrec' 'all' '2' +insertpackage 'unstable' 'newsug' 'all' '2' +insertpackage 'unstable' 'promote' 'all' '2' + +insertinstalledpackage 'foo' 'all' '1' 'Recommends: oldrec, instrec, unsatrec +Suggests: oldsug, instsug, unsatsug, promote' +insertpackage 'unstable' 'foo' 'all' '2' 'Recommends: instrec, unsatrec, promote, newrec +Suggests: instsug, unsatsug, newsug' + +setupaptarchive + +testsuccess aptmark auto oldrec instrec oldsug instsug + +testsuccessequal "Reading package lists... +Building dependency tree... +Reading state information... +Calculating upgrade... +The following packages were automatically installed and are no longer required: + oldrec oldsug +Use 'apt autoremove' to remove them. +The following NEW packages will be installed: + newrec promote +The following packages will be upgraded: + foo +1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo [1] (2 unstable [all]) +Inst newrec (2 unstable [all]) +Inst promote (2 unstable [all]) +Conf foo (2 unstable [all]) +Conf newrec (2 unstable [all]) +Conf promote (2 unstable [all])" apt full-upgrade -s + +testsuccessequal "Reading package lists... +Building dependency tree... +Reading state information... +Calculating upgrade... +The following packages were automatically installed and are no longer required: + oldrec oldsug +Use 'apt autoremove' to remove them. +The following NEW packages will be installed: + newrec newsug +The following packages will be upgraded: + foo +1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo [1] (2 unstable [all]) +Inst newrec (2 unstable [all]) +Inst newsug (2 unstable [all]) +Conf foo (2 unstable [all]) +Conf newrec (2 unstable [all]) +Conf newsug (2 unstable [all])" apt full-upgrade -s --install-suggests diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt index f6d88690a..615d282da 100644 --- a/vendor/CMakeLists.txt +++ b/vendor/CMakeLists.txt @@ -1,7 +1,8 @@ # Determine the current vendor, export to CURRENT_VENDOR if (NOT DEFINED CURRENT_VENDOR) execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/getinfo current - OUTPUT_VARIABLE CURRENT_VENDOR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE CURRENT_VENDOR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY) set(CURRENT_VENDOR "${CURRENT_VENDOR_OUT}" CACHE STRING "Select the system vendor") message(STATUS "Detected vendor: ${CURRENT_VENDOR_OUT}") |