Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock
Hello, I know that we're very late in the preparation of the release, but still I submit this for your consideration. I am quite happy with aptitude as it is now in stretch, but still I think that it'll be a bit better with these changes than without them. Due to $LIFE and $CIRCUMSTANCES I could not work too much on aptitude lately, but in the last few days I fixed some things that are important for some people (e.g. FAI), fixed some bugs that appeared in some cases after the last Debian release due to other changes within aptitude, in other cases due to changes in the apt "ecosystem", and in yet another case it was a bug present for a very long time, maybe more than a decade; and lastly doc translation update. >From my (biased) POV, these changes are not very risky/intrusive, all changes can be reverted without much trouble if need be, and I expect to be available in the next weeks for quick fixes if necessary. I send attached the debdiff (filtering out po files of code and documentation), but perhaps it's better/easier to review the individual changes in the VCS. unblock aptitude/0.8.7-1 Cheers.
diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/debian/changelog aptitude-0.8.7/debian/changelog --- aptitude-0.8.6/debian/changelog 2017-03-05 23:19:57.000000000 +0100 +++ aptitude-0.8.7/debian/changelog 2017-04-19 00:22:12.000000000 +0200 @@ -1,3 +1,26 @@ +aptitude (0.8.7-1) unstable; urgency=medium + + [ Manuel A. Fernandez Montecelo ] + * New upstream release. Please see /usr/share/aptitude/NEWS for a change + log with more details. + + - User visible changes: + * Warn about invalid locales (Closes: #859907) + + - Bug fixes: + * Preserve auto-installed flag with hold/unhold/keep operations + (Closes: #843536) + * [cmdline] Fix extreme slowness of keep-all (Closes: #842707) + * Avoid problems or improve response in problems related to reinstalling + (Closes: #851901) + * [cmdline] Failing to apply actions are not fatal with -f / + Aptitude::CmdLine::Fix-Broken (Closes: #835372) + + - Translation updates: + * Italian documentation translation by Beatrice Torracca (Closes: #858784) + + -- Manuel A. Fernandez Montecelo <m...@debian.org> Wed, 19 Apr 2017 00:22:12 +0200 + aptitude (0.8.6-1) unstable; urgency=medium [ Manuel A. Fernandez Montecelo ] diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/doc/en/aptitude.xml aptitude-0.8.7/doc/en/aptitude.xml --- aptitude-0.8.6/doc/en/aptitude.xml 2017-03-05 22:26:40.000000000 +0100 +++ aptitude-0.8.7/doc/en/aptitude.xml 2017-04-04 00:28:08.000000000 +0200 @@ -7,7 +7,7 @@ <!ENTITY dselect '<command>dselect</command>'> <!ENTITY apt-get '<command>apt-get</command>'> <!ENTITY root '<systemitem class="username">root</systemitem>'> - <!ENTITY VERSION '0.8.6'> + <!ENTITY VERSION '0.8.7'> <!-- Shortcuts for menu commands: --> diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/NEWS aptitude-0.8.7/NEWS --- aptitude-0.8.6/NEWS 2017-03-05 22:26:40.000000000 +0100 +++ aptitude-0.8.7/NEWS 2017-04-18 23:58:57.000000000 +0200 @@ -1,3 +1,48 @@ +[2017-04-18] +Version 0.8.7 + +- User visible changes: + + * Warn about invalid locales (Closes: #859907) + +- Bug fixes: + + * Preserve auto-installed flag with hold/unhold/keep operations + (Closes: #843536) + + * [cmdline] Fix extreme slowness of keep-all (Closes: #842707) + + Every change of marking the package to "keep" was triggering a reevaluation + in aptitudeDepCache::end_action_group() of what had changed ("mark and sweep", + duplicate of cache, triggers of packages state changes... etc), for every + package. + + * Avoid problems or improve response in problems related to reinstalling + (Closes: #851901) + + Improvements to deal with several problems that sometimes appear when + reinstalling or acting on scheduled reinstall actions, due to the versions + disappearing from the repositories. + + * [cmdline] Failing to apply actions are not fatal with -f / + Aptitude::CmdLine::Fix-Broken (Closes: #835372) + + The behaviour of refusing to continue when there are errors happens since + the change "[cmdline] Abort with Failure when actions cannot be taken + (Closes: #121313, #430392, #445034, #498239, #576212, #639789, #798320)", + but it's not an optimal solution for automatic installers like FAI, so this + is a way to revert to the old behaviour. + +- Internal changes: + + * new method is_version_available(), to check if the given version of a + package is available (to check availability e.g. for reinstalls) + +- Translation updates: + + * Italian documentation translation by Beatrice Torracca (Closes: #858784) + + [2017-03-05] Version 0.8.6 diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/cmdline/cmdline_action.cc aptitude-0.8.7/src/cmdline/cmdline_action.cc --- aptitude-0.8.6/src/cmdline/cmdline_action.cc 2017-03-05 22:26:40.000000000 +0100 +++ aptitude-0.8.7/src/cmdline/cmdline_action.cc 2017-04-14 01:49:58.000000000 +0200 @@ -438,7 +438,8 @@ if (verbose > 0) printf(_("Setting package %s on hold\n"), pkg.FullName(true).c_str()); - (*apt_cache_file)->mark_keep(pkg, false, true, NULL); + fprintf(stderr, "This code path should not be reached (now implemented in cmdline_mark)\n"); + (*apt_cache_file)->mark_keep(pkg, is_auto_installed(pkg), true, NULL); } break; case cmdline_keep: @@ -446,7 +447,8 @@ if (verbose > 0) printf(_("Marking package %s as keep\n"), pkg.FullName(true).c_str()); - (*apt_cache_file)->mark_keep(pkg, false, false, NULL); + fprintf(stderr, "This code path should not be reached (now implemented in cmdline_mark)\n"); + (*apt_cache_file)->mark_keep(pkg, is_auto_installed(pkg), false, NULL); } break; case cmdline_unhold: @@ -455,7 +457,8 @@ if (verbose > 0) printf(_("Setting package %s as not on hold\n"), pkg.FullName(true).c_str()); - (*apt_cache_file)->mark_keep(pkg, false, false, NULL); + fprintf(stderr, "This code path should not be reached (now implemented in cmdline_mark)\n"); + (*apt_cache_file)->mark_keep(pkg, is_auto_installed(pkg), false, NULL); } else { @@ -467,6 +470,7 @@ if (verbose > 0) printf(_("Marking package %s as automatically installed\n"), pkg.FullName(true).c_str()); + fprintf(stderr, "This code path should not be reached (now implemented in cmdline_mark)\n"); (*apt_cache_file)->mark_auto_installed(pkg, true, NULL); } break; @@ -475,6 +479,7 @@ if (verbose > 0) printf(_("Unmarking package %s as automatically installed\n"), pkg.FullName(true).c_str()); + fprintf(stderr, "This code path should not be reached (now implemented in cmdline_mark)\n"); (*apt_cache_file)->mark_auto_installed(pkg, false, NULL); } break; diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/cmdline/cmdline_do_action.cc aptitude-0.8.7/src/cmdline/cmdline_do_action.cc --- aptitude-0.8.6/src/cmdline/cmdline_do_action.cc 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/cmdline/cmdline_do_action.cc 2017-04-18 21:27:45.000000000 +0200 @@ -1,7 +1,7 @@ // cmdline_do_action.cc // // Copyright (C) 2004, 2010 Daniel Burrows -// Copyright (C) 2014-2016 Manuel A. Fernandez Montecelo +// Copyright (C) 2014-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -260,7 +260,7 @@ for(pkgCache::PkgIterator i=(*apt_cache_file)->PkgBegin(); !i.end(); ++i) - (*apt_cache_file)->mark_keep(i, false, false, NULL); + (*apt_cache_file)->mark_keep(i, is_auto_installed(i), false, NULL); } else { @@ -358,7 +358,11 @@ } } - if (!apply_ok) + if (!apply_ok && fix_broken) + { + fprintf(stderr, _("Unable to apply some actions but Aptitude::CmdLine::Fix-Broken (-f) is enabled, continuing...\n")); + } + else if (!apply_ok) { fprintf(stderr, _("Unable to apply some actions, aborting\n")); return -1; diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/cmdline/cmdline_do_action.h aptitude-0.8.7/src/cmdline/cmdline_do_action.h --- aptitude-0.8.6/src/cmdline/cmdline_do_action.h 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/cmdline/cmdline_do_action.h 2017-04-18 21:27:55.000000000 +0200 @@ -1,7 +1,7 @@ // cmdline_do_action.h -*-c++-*- // // Copyright 2004 Daniel Burrows -// Copyright (C) 2014-2016 Manuel A. Fernandez Montecelo +// Copyright (C) 2014-2017 Manuel A. Fernandez Montecelo #ifndef CMDLINE_DO_ACTION_H #define CMDLINE_DO_ACTION_H diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/cmdline/cmdline_mark.cc aptitude-0.8.7/src/cmdline/cmdline_mark.cc --- aptitude-0.8.6/src/cmdline/cmdline_mark.cc 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/cmdline/cmdline_mark.cc 2017-04-14 16:38:32.000000000 +0200 @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Manuel A. Fernandez Montecelo +// Copyright (C) 2016-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -70,6 +70,14 @@ bool all_ok = true; + // Instantiate action group, so all changes get collected and actions happen + // only once. Otherwise, every change triggers a reevaluation in + // aptitudeDepCache::end_action_group() of what has changed ("mark and sweep", + // duplicate of cache, triggers of packages state changes... etc), for every + // package marked as "keep" (all of them), and thus causing problems such as + // #842707 -- "keep-all hangs forever" + aptitudeDepCache::action_group group(*apt_cache_file, NULL); + if (std::string(argv[0]) == "keep-all") { if (argc != 1) @@ -88,7 +96,9 @@ else { for (pkgCache::PkgIterator it = (*apt_cache_file)->PkgBegin(); !it.end(); ++it) - (*apt_cache_file)->mark_keep(it, false, false, NULL); + { + (*apt_cache_file)->mark_keep(it, is_auto_installed(it), false, NULL); + } } } else if (std::string(argv[0]) == "forbid-version") @@ -271,7 +281,7 @@ } else { - (*apt_cache_file)->mark_keep(pkg, false, true, NULL); + (*apt_cache_file)->mark_keep(pkg, is_auto_installed(pkg), true, NULL); } } break; @@ -284,7 +294,7 @@ } else { - (*apt_cache_file)->mark_keep(pkg, false, false, NULL); + (*apt_cache_file)->mark_keep(pkg, is_auto_installed(pkg), false, NULL); } } break; diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/cmdline/cmdline_mark.h aptitude-0.8.7/src/cmdline/cmdline_mark.h --- aptitude-0.8.6/src/cmdline/cmdline_mark.h 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/cmdline/cmdline_mark.h 2017-04-14 01:45:40.000000000 +0200 @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Manuel A. Fernandez Montecelo +// Copyright (C) 2016-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/cmdline/cmdline_prompt.cc aptitude-0.8.7/src/cmdline/cmdline_prompt.cc --- aptitude-0.8.6/src/cmdline/cmdline_prompt.cc 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/cmdline/cmdline_prompt.cc 2017-04-18 20:42:07.000000000 +0200 @@ -1,7 +1,7 @@ // cmdline_prompt.cc // // Copyright (C) 2010-2011 Daniel Burrows -// Copyright (C) 2014-2016 Manuel A. Fernandez Montecelo +// Copyright (C) 2014-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -978,6 +978,9 @@ bool simulate_only, const std::shared_ptr<terminal_metrics> &term_metrics) { + // do print errors on the screen if there have been any + _error->DumpErrors(); + bool exit=false; bool rval=true; bool first=true; diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/cmdline/cmdline_prompt.h aptitude-0.8.7/src/cmdline/cmdline_prompt.h --- aptitude-0.8.6/src/cmdline/cmdline_prompt.h 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/cmdline/cmdline_prompt.h 2017-04-18 20:32:06.000000000 +0200 @@ -1,7 +1,7 @@ // cmdline_prompt.h -*-c++-*- // // Copyright (C) 2004, 2010 Daniel Burrows -// Copyright (C) 2014-2016 Manuel A. Fernandez Montecelo +// Copyright (C) 2014-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/generic/apt/aptcache.cc aptitude-0.8.7/src/generic/apt/aptcache.cc --- aptitude-0.8.6/src/generic/apt/aptcache.cc 2017-03-05 22:26:40.000000000 +0100 +++ aptitude-0.8.7/src/generic/apt/aptcache.cc 2017-04-18 20:04:58.000000000 +0200 @@ -364,7 +364,20 @@ tmp=0; section.FindFlag("Reinstall", tmp, 1); - pkg_state.reinstall = (tmp==1); + if (tmp == 1) + { + if (!pkg.CurrentVer().end() && is_version_available(pkg, pkg.CurrentVer().VerStr())) + { + pkg_state.reinstall = true; + } + else + { + // warning, not an error, it's not that severe and also + // otherwise the algorithm to read from saved state stops + _error->Warning(_("Package %s had been marked to reinstall, but the file for the current installed version %s is not available"), + pkg.FullName(true).c_str(), pkg.CurrentVer().VerStr()); + } + } // if the last installation was successful reset_reinstall==true, // to unmark .reinstall property of the package, otherwise there diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/generic/apt/apt.cc aptitude-0.8.7/src/generic/apt/apt.cc --- aptitude-0.8.6/src/generic/apt/apt.cc 2017-03-05 22:26:40.000000000 +0100 +++ aptitude-0.8.7/src/generic/apt/apt.cc 2017-04-18 20:03:06.000000000 +0200 @@ -1,7 +1,7 @@ // apt.cc // // Copyright 1999-2010 Daniel Burrows -// Copyright 2015-2016 Manuel A. Fernandez Montecelo +// Copyright 2015-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -1087,6 +1087,31 @@ return !rdeps_prevent_removal; } +bool is_version_available(const pkgCache::PkgIterator& pkg, const std::string& version) +{ + if (!pkg.end()) + { + for (pkgCache::VerIterator vi = pkg.VersionList(); !vi.end(); ++vi) + { + if (version == vi.VerStr()) + { + // we have a match, but is it downloadable? We could check if + // it's already downloaded and ready, but apt (1.4) refuses to + // install it if the file is available but the version is not in + // the current Packages lists + // + // the extra check would be something like: + // (!vi.FileList().end() && !vi.FileList().File().end() && vi.FileList().File().IsOk()) + if (vi.Downloadable()) + { + return true; + } + } + } + } + + return false; +} /** \return \b true if d1 subsumes d2; that is, if one of the * following holds: diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/generic/apt/apt.h aptitude-0.8.7/src/generic/apt/apt.h --- aptitude-0.8.6/src/generic/apt/apt.h 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/generic/apt/apt.h 2017-04-18 20:02:57.000000000 +0200 @@ -1,7 +1,7 @@ // apt.h -*-c++-*- // // Copyright 1999-2002, 2004-2005, 2007-2010 Daniel Burrows -// Copyright 2015-2016 Manuel A. Fernandez Montecelo +// Copyright 2015-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -368,6 +368,15 @@ return (apt_cache_file && is_auto_installed((*apt_cache_file)[pkg])); } +/** Check if package version is available to download, reinstall, etc. + * + * @param pkg Package to check + * @param version Version to check + * + * @return Whether the package version is available + */ +bool is_version_available(const pkgCache::PkgIterator& pkg, const std::string& version); + /** A pair (veriterator,verfile) -- used for building a list of * versions sorted by file location. */ diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/generic/apt/download_install_manager.cc aptitude-0.8.7/src/generic/apt/download_install_manager.cc --- aptitude-0.8.6/src/generic/apt/download_install_manager.cc 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/generic/apt/download_install_manager.cc 2017-04-18 20:03:41.000000000 +0200 @@ -1,7 +1,7 @@ // download_install_manager.cc // // Copyright (C) 2005-2011 Daniel Burrows -// Copyright (C) 2015-2016 Manuel A. Fernandez Montecelo +// Copyright (C) 2015-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -99,7 +99,7 @@ _error->Error(_("Internal error: couldn't generate list of packages to download")); // has to be an Error (not e.g. Notice), otherwise "DumpError" (which // later phases rely on) doesn't include the following message - _error->Error(_("Perhaps the package lists are out of date, please try 'aptitude update' (or equivalent) first")); + _error->Error(_("Perhaps the package lists are out of date, please try 'aptitude update' (or equivalent); otherwise some packages or versions are not available from the current repository sources")); delete fetcher; fetcher = NULL; diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/generic/apt/download_install_manager.h aptitude-0.8.7/src/generic/apt/download_install_manager.h --- aptitude-0.8.6/src/generic/apt/download_install_manager.h 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/generic/apt/download_install_manager.h 2017-04-18 20:03:47.000000000 +0200 @@ -1,7 +1,7 @@ // download_install_manager.h -*-c++-*- // // Copyright (C) 2005, 2008, 2010 Daniel Burrows -// Copyright (C) 2015-2016 Manuel A. Fernandez Montecelo +// Copyright (C) 2015-2017 Manuel A. Fernandez Montecelo // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/generic/util/util.cc aptitude-0.8.7/src/generic/util/util.cc --- aptitude-0.8.6/src/generic/util/util.cc 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/generic/util/util.cc 2017-04-14 01:01:29.000000000 +0200 @@ -508,7 +508,14 @@ { namespace fs = boost::filesystem; - fs::path dest_dir = fs::temp_directory_path() / fs::unique_path("aptitude-download-%%%%-%%%%-%%%%-%%%%"); + fs::path dest_dir; + try { + dest_dir = fs::temp_directory_path() / fs::unique_path("aptitude-download-%%%%-%%%%-%%%%-%%%%"); + } catch (const std::exception& e) { + fprintf(stderr, _("Problem creating temporary dir: %s\n"), e.what()); + return {}; + } + try { // create and set permissions diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/main.cc aptitude-0.8.7/src/main.cc --- aptitude-0.8.6/src/main.cc 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/main.cc 2017-04-14 14:36:33.000000000 +0200 @@ -669,7 +669,10 @@ // valid try { std::locale::global(std::locale("")); - } catch (...) { + } catch (const std::exception& e) { + fprintf(stderr, + _("Warning: Invalid locale (please review locale settings, this might lead to problems later):\n %s\n"), + e.what()); setlocale(LC_ALL, ""); } bindtextdomain(PACKAGE, LOCALEDIR); diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/pkg_item.cc aptitude-0.8.7/src/pkg_item.cc --- aptitude-0.8.6/src/pkg_item.cc 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/pkg_item.cc 2017-04-14 01:23:21.000000000 +0200 @@ -172,7 +172,7 @@ void pkg_item::do_hold(undo_group *undo) // Sets an explicit hold state. { - (*apt_cache_file)->mark_keep(package, false, true, undo); + (*apt_cache_file)->mark_keep(package, is_auto_installed(package), true, undo); } void pkg_item::hold(undo_group *undo) @@ -185,7 +185,7 @@ else // Toggle the held state. (*apt_cache_file)->mark_keep(package, - false, + is_auto_installed(package), (*apt_cache_file)->get_ext_state(package).selection_state!=pkgCache::State::Hold, undo); } diff -Nru --exclude '*.po' --exclude '*.pot' --exclude 'configure*' --exclude '*.gmo' aptitude-0.8.6/src/pkg_ver_item.cc aptitude-0.8.7/src/pkg_ver_item.cc --- aptitude-0.8.6/src/pkg_ver_item.cc 2017-03-05 21:53:09.000000000 +0100 +++ aptitude-0.8.7/src/pkg_ver_item.cc 2017-04-14 01:32:05.000000000 +0200 @@ -598,9 +598,11 @@ void pkg_ver_item::hold(undo_group *undo) { + auto package = version.ParentPkg(); + if(version==version.ParentPkg().CurrentVer()) (*apt_cache_file)->mark_keep(version.ParentPkg(), - false, + is_auto_installed(package), (*apt_cache_file)->get_ext_state(version.ParentPkg()).selection_state!=pkgCache::State::Hold, undo); }