diff options
| -rw-r--r-- | .gitlab-ci.yml | 4 | ||||
| -rw-r--r-- | .travis.yml | 23 | ||||
| -rw-r--r-- | CMakeLists.txt | 2 | ||||
| -rw-r--r-- | apt-pkg/contrib/configuration.cc | 1 | ||||
| -rw-r--r-- | apt-pkg/contrib/fileutl.cc | 4 | ||||
| -rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 3 | ||||
| -rw-r--r-- | apt-pkg/packagemanager.cc | 25 | ||||
| -rw-r--r-- | debian/changelog | 15 | ||||
| -rw-r--r-- | debian/gbp.conf | 2 | ||||
| -rw-r--r-- | doc/apt-verbatim.ent | 2 | ||||
| -rw-r--r-- | doc/po/apt-doc.pot | 4 | ||||
| -rw-r--r-- | po/apt-all.pot | 4 | ||||
| -rw-r--r-- | po/ru.po | 18 | ||||
| -rwxr-xr-x | test/integration/test-essential-force-loopbreak | 91 |
14 files changed, 132 insertions, 66 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de517c11e..c8de2aba6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: debian:unstable +image: debian:bullseye variables: DEBIAN_FRONTEND: noninteractive CCACHE_DIR: $CI_PROJECT_DIR/.ccache @@ -23,7 +23,7 @@ test as root: - unbuffer ./test/integration/run-tests -q -j 4 test as user: - image: i386/debian:unstable + image: i386/debian:bullseye stage: test script: - adduser --home /home/travis travis --quiet --disabled-login --gecos "" --uid 1000 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c010e1353..000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: cpp -cache: ccache -sudo: required -services: - - docker -env: - global: - - DEBIAN_FRONTEND=noninteractive - matrix: - - USER=travis CMAKE_FLAGS= - - USER=root CMAKE_FLAGS=-DWITH_DOC=OFF -install: - - sed -i -e "s#1000#$(id -u)#g" Dockerfile - - docker build --tag=apt-ci . -before_script: - - docker run --rm -w $PWD -v $HOME/.ccache:$HOME/.ccache -v $PWD:$PWD --user=travis apt-ci sh -e -c "mkdir build && cd build && env PATH=/usr/lib/ccache:\$PATH cmake -DCMAKE_BUILD_TYPE=Coverage -G Ninja $CMAKE_FLAGS .." - - docker run --rm -w $PWD -v $HOME/.ccache:$HOME/.ccache -v $PWD:$PWD --user=travis apt-ci ninja -C build -script: - - docker run --rm -w $PWD -v $PWD:$PWD --user=travis apt-ci env CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test - - docker run --rm -w $PWD -v $PWD:$PWD --user=travis apt-ci env DESTDIR=$PWD/rootdir chronic ninja -C build install - - docker run --rm -w $PWD -v $PWD:$PWD --user=$USER --tmpfs /tmp:suid,exec apt-ci unbuffer ./test/integration/run-tests -qq -j 4 -after_script: - - docker run --rm -w $PWD/build -v $PWD:$PWD --user=$USER `bash <(curl -s https://codecov.io/env)` apt-ci bash -c 'bash <(curl -s https://codecov.io/bash)' diff --git a/CMakeLists.txt b/CMakeLists.txt index 47f5d5c09..6e7ff2a9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,7 +200,7 @@ endif() # Configure some variables like package, version and architecture. set(PACKAGE ${PROJECT_NAME}) set(PACKAGE_MAIL "APT Development Team <deity@lists.debian.org>") -set(PACKAGE_VERSION "2.2.0") +set(PACKAGE_VERSION "2.2.1") string(REGEX MATCH "^[0-9.]+" PROJECT_VERSION ${PACKAGE_VERSION}) if (NOT DEFINED DPKG_DATADIR) diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index a8fced724..03bdb12a8 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -31,6 +31,7 @@ #include <string.h> #include <algorithm> +#include <array> #include <fstream> #include <iterator> #include <numeric> diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 091def3d4..eb5dc859d 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -140,10 +140,6 @@ bool RunScripts(const char *Cnf) return _error->Errno("waitpid","Couldn't wait for subprocess"); } - // Restore sig int/quit - signal(SIGQUIT,SIG_DFL); - signal(SIGINT,SIG_DFL); - // Check for an error code. if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0) { diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c496538cc..a8f99a855 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1824,6 +1824,9 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) case Item::Install: ADDARGC("--unpack"); ADDARGC("--auto-deconfigure"); + // dpkg < 1.20.8 needs --force-remove-protected to deconfigure protected packages + if (dpkgProtectedField) + ADDARGC("--force-remove-protected"); break; } diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 0c6998def..1a2850a2a 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -652,9 +652,11 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const D // Essential packages get special treatment bool IsEssential = false; - if ((Pkg->Flags & pkgCache::Flag::Essential) != 0 || - (Pkg->Flags & pkgCache::Flag::Important) != 0) + if ((Pkg->Flags & pkgCache::Flag::Essential) != 0) IsEssential = true; + bool IsProtected = false; + if ((Pkg->Flags & pkgCache::Flag::Important) != 0) + IsProtected = true; /* Check for packages that are the dependents of essential packages and promote them too */ @@ -662,14 +664,17 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const D { for (pkgCache::DepIterator D = Pkg.RevDependsList(); D.end() == false && IsEssential == false; ++D) - if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) - if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0 || - (D.ParentPkg()->Flags & pkgCache::Flag::Important) != 0) + if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) { + if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0) IsEssential = true; + if ((D.ParentPkg()->Flags & pkgCache::Flag::Important) != 0) + IsProtected = true; + } } if (IsEssential == true) { + // FIXME: Unify messaging with Protected below. if (_config->FindB("APT::Force-LoopBreak",false) == false) return _error->Error(_("This installation run will require temporarily " "removing the essential package %s due to a " @@ -680,6 +685,16 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const D // dpkg will auto-deconfigure it, no need for the big remove hammer else if (Dep != NULL && (*Dep)->Type == pkgCache::Dep::DpkgBreaks) return true; + else if (IsProtected == true) + { + // FIXME: Message should talk about Protected, not Essential, and unified. + if (_config->FindB("APT::Force-LoopBreak",false) == false) + return _error->Error(_("This installation run will require temporarily " + "removing the essential package %s due to a " + "Conflicts/Pre-Depends loop. This is often bad, " + "but if you really want to do it, activate the " + "APT::Force-LoopBreak option."),Pkg.FullName().c_str()); + } bool Res = SmartRemove(Pkg); if (Cache[Pkg].Delete() == false) diff --git a/debian/changelog b/debian/changelog index 9d3113009..b5d79119d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +apt (2.2.1) unstable; urgency=medium + + [ Julian Andres Klode ] + * Do not require force-loopbreak on Protected packages (Closes: #983014) + * Branch of as 2.2.y for bullseye + * configuration: Add missing #include <array> + * Remove .travis.yml, we are using GitLab CI these days + * RunScripts: Do not reset SIGQUIT and SIGINT to SIG_DFL (LP: #1898026) + * regression fix: do require force-loopbreak for Conflicts + + [ Алексей Шилин ] + * Russian translation update (Closes: #983348) + + -- Julian Andres Klode <jak@debian.org> Mon, 01 Mar 2021 22:27:55 +0100 + apt (2.2.0) unstable; urgency=medium * The "Happy soft freeze" release diff --git a/debian/gbp.conf b/debian/gbp.conf index a5e885896..6c85f91b1 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -3,7 +3,7 @@ ;preexport = ./prepare-release pre-export prebuild = ./prepare-release pre-build postbuild = ./prepare-release post-build -debian-branch = master +debian-branch = 2.2.y debian-tag = %(version)s export-dir = ../build-area sign-tags = True diff --git a/doc/apt-verbatim.ent b/doc/apt-verbatim.ent index 733ed34b4..6b2107496 100644 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@ -274,7 +274,7 @@ "> <!-- this will be updated by 'prepare-release' --> -<!ENTITY apt-product-version "2.2.0"> +<!ENTITY apt-product-version "2.2.1"> <!-- (Code)names for various things used all over the place --> <!ENTITY debian-oldstable-codename "buster"> diff --git a/doc/po/apt-doc.pot b/doc/po/apt-doc.pot index b9d3ce4b0..bf1c92e39 100644 --- a/doc/po/apt-doc.pot +++ b/doc/po/apt-doc.pot @@ -5,9 +5,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: apt-doc 2.2.0\n" +"Project-Id-Version: apt-doc 2.2.1\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2021-02-18 20:35+0100\n" +"POT-Creation-Date: 2021-03-01 22:28+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" diff --git a/po/apt-all.pot b/po/apt-all.pot index 03d849b4e..38f5cda0e 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -5,9 +5,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: apt 2.2.0\n" +"Project-Id-Version: apt 2.2.1\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2021-02-18 20:35+0100\n" +"POT-Creation-Date: 2021-03-01 22:28+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -9,14 +9,14 @@ # Yuri Kozlov <kozlov.y@gmail.com>, 2004, 2005, 2006, 2007, 2008. # Yuri Kozlov <yuray@komyakino.ru>, 2009, 2010, 2012, 2015, 2016. # Lev Lamberov <dogsleg@debian.org>, 2018. -# Алексей Шилин <rootlexx@mail.ru>, 2017-2020. +# Алексей Шилин <rootlexx@mail.ru>, 2017-2021. # msgid "" msgstr "" -"Project-Id-Version: apt 2.0.0\n" +"Project-Id-Version: apt 2.2.0\n" "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n" -"POT-Creation-Date: 2021-02-09 10:45+0100\n" -"PO-Revision-Date: 2020-03-09 22:43+0300\n" +"POT-Creation-Date: 2021-02-24 17:18+0100\n" +"PO-Revision-Date: 2021-02-22 20:02+0300\n" "Last-Translator: Алексей Шилин <rootlexx@mail.ru>\n" "Language-Team: русский <debian-l10n-russian@lists.debian.org>\n" "Language: ru\n" @@ -698,10 +698,9 @@ msgid "Tar checksum failed, archive corrupted" msgstr "Неправильная контрольная сумма Tar — архив повреждён" #: apt-pkg/contrib/extracttar.cc -#, fuzzy, c-format -#| msgid "Unknown TAR header type %u, member %s" +#, c-format msgid "Unknown TAR header type %u" -msgstr "Неизвестный тип %u, элемент %s в заголовке TAR" +msgstr "Неизвестный тип %u в заголовке TAR" #: apt-pkg/contrib/fileutl.cc #, c-format @@ -2399,7 +2398,7 @@ msgstr " Таблица версий:" #: apt-private/private-show.cc msgid "phased" -msgstr "" +msgstr "поэтапно" #: apt-private/private-source.cc #, c-format @@ -3002,7 +3001,7 @@ msgstr "сбросить привилегии перед выполнением #: cmdline/apt-helper.cc msgid "analyse a pattern" -msgstr "" +msgstr "проанализировать шаблон поиска" #: cmdline/apt-internal-planner.cc msgid "" @@ -3968,7 +3967,6 @@ msgstr "Соединение закрыто преждевременно" msgid "Empty files can't be valid archives" msgstr "Пустые файлы не могут быть допустимыми архивами" -#, c-format #~ msgid "Line %u too long in source list %s." #~ msgstr "Строка %u в списке источников %s слишком длинная." diff --git a/test/integration/test-essential-force-loopbreak b/test/integration/test-essential-force-loopbreak index f585e9c42..d2f663201 100755 --- a/test/integration/test-essential-force-loopbreak +++ b/test/integration/test-essential-force-loopbreak @@ -18,37 +18,98 @@ Breaks: sysvinit-core' buildsimplenativepackage 'systemd-sysv' 'native' '2~break' 'sid-break' 'Breaks: sysvinit (<< 2), sysvinit-core' +# one more time, with Protected +insertinstalledpackage 'protected-sysvinit' 'native' '1' 'Protected: yes' + +buildsimplenativepackage 'protected-sysvinit' 'native' '2' 'sid' 'Pre-Depends: protected-sysvinit-core | protected-systemd-sysv +Protected: yes' +buildsimplenativepackage 'protected-sysvinit-core' 'native' '2' 'sid' + +buildsimplenativepackage 'protected-systemd-sysv' 'native' '2~conflict' 'sid-conflict' 'Conflicts: protected-sysvinit (<< 2) +Breaks: protected-sysvinit-core' + +buildsimplenativepackage 'protected-systemd-sysv' 'native' '2~break' 'sid-break' 'Breaks: protected-sysvinit (<< 2), protected-sysvinit-core' + + setupaptarchive cp -a rootdir/var/lib/dpkg/status dpkg.status.backup testforcebreak() { + package="sid-$1" + prefix="$2" cp -a dpkg.status.backup rootdir/var/lib/dpkg/status rm -f rootdir/var/lib/apt/extended_states testfailureequal "Reading package lists... Building dependency tree... The following additional packages will be installed: - sysvinit + ${prefix}sysvinit The following NEW packages will be installed: - systemd-sysv + ${prefix}systemd-sysv The following packages will be upgraded: - sysvinit -1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -E: This installation run will require temporarily removing the essential package sysvinit:$(getarchitecture 'native') due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option. -E: Internal Error, Could not early remove sysvinit:$(dpkg --print-architecture) (2)" aptget install systemd-sysv -t "$1" -s + ${prefix}sysvinit +1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +E: This installation run will require temporarily removing the essential package ${prefix}sysvinit:$(getarchitecture 'native') due to a Conflicts/Pre-Depends loop. This is often bad, but if you really want to do it, activate the APT::Force-LoopBreak option. +E: Internal Error, Could not early remove ${prefix}sysvinit:$(dpkg --print-architecture) (2)" aptget install ${prefix}systemd-sysv -t "$package" -s # ensure that really nothing happens - testfailure aptget install systemd-sysv -y -t "$1" - testdpkginstalled 'sysvinit' - testdpkgnotinstalled 'systemd-sysv' + testfailure aptget install ${prefix}systemd-sysv -y -t "$package" + testdpkginstalled "${prefix}sysvinit" + testdpkgnotinstalled "${prefix}systemd-sysv" # with enough force however … cp -a dpkg.status.backup rootdir/var/lib/dpkg/status - testsuccess aptget install systemd-sysv -y -t "$1" -o APT::Force-LoopBreak=1 -o Debug::pkgDpkgPm=1 + testsuccess aptget install ${prefix}systemd-sysv -y -t "$package" -o APT::Force-LoopBreak=1 -o Debug::pkgDpkgPm=1 cp rootdir/tmp/testsuccess.output apt.output - testsuccess grep -- '--force-remove-essential --remove sysvinit' apt.output - testsuccess aptget install systemd-sysv -y -t "$1" -o APT::Force-LoopBreak=1 - testdpkginstalled 'sysvinit' 'systemd-sysv' + if [ "$prefix" = "protected-" ]; then + testsuccess grep -- "--force-remove-protected --remove ${prefix}sysvinit" apt.output + else + testsuccess grep -- "--force-remove-essential --remove ${prefix}sysvinit" apt.output + fi + testsuccess aptget install ${prefix}systemd-sysv -y -t "$package" -o APT::Force-LoopBreak=1 + testdpkginstalled "${prefix}sysvinit" "${prefix}systemd-sysv" +} + +testforcebreak 'conflict' +testforcebreak 'break' + +testnoforcebreak() { + cp -a dpkg.status.backup rootdir/var/lib/dpkg/status + rm -f rootdir/var/lib/apt/extended_states + testequalor2 "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + protected-sysvinit +The following NEW packages will be installed: + protected-systemd-sysv +The following packages will be upgraded: + protected-sysvinit +1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +Inst protected-systemd-sysv (2~$1 sid-$1 [$(getarchitecture 'native')]) [protected-systemd-sysv:$(getarchitecture 'native') on protected-sysvinit:$(getarchitecture 'native')] [] +Conf protected-systemd-sysv:$(getarchitecture 'native') broken + Breaks:protected-sysvinit:$(getarchitecture 'native') + [] +Inst protected-sysvinit [1] (2 sid [$(getarchitecture 'native')]) +Conf protected-sysvinit (2 sid [$(getarchitecture 'native')]) +E: Conf Broken protected-systemd-sysv:$(getarchitecture 'native')" "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + protected-sysvinit +The following NEW packages will be installed: + protected-systemd-sysv +The following packages will be upgraded: + protected-sysvinit +1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +Remv protected-sysvinit [1] +Inst protected-systemd-sysv (2~conflict sid-conflict [$(getarchitecture 'native')]) +Conf protected-systemd-sysv (2~conflict sid-conflict [$(getarchitecture 'native')]) +Inst protected-sysvinit [1] (2 sid [$(getarchitecture 'native')]) +Conf protected-sysvinit (2 sid [$(getarchitecture 'native')])" aptget install protected-systemd-sysv -t "sid-$1" -s + + # we check with 'real' packages here as the simulation reports a 'Conf broken' + cp -a dpkg.status.backup rootdir/var/lib/dpkg/status + testsuccess aptget install protected-systemd-sysv -y -t "sid-$1" + testdpkginstalled 'protected-sysvinit' 'protected-systemd-sysv' } -testforcebreak 'sid-conflict' -testforcebreak 'sid-break' +testforcebreak 'conflict' 'protected-' +testnoforcebreak 'break' |
