summaryrefslogtreecommitdiff
path: root/src/cmdline
AgeCommit message (Collapse)AuthorFilesLines
2012-06-29Remove newline from error messageDaniel Hartwig1-1/+1
2012-06-28Guess changelog URI for third-party sitesDaniel Hartwig1-17/+1
Contruct a changelog file path for third party sites that do not use packages.debian.org/changelogs This simply uses the ArchiveURI() of the source pkg and looks for a .changelog file there. LP: #563155
2012-06-28Merge changelog URI construction from apt-getDaniel Hartwig1-59/+1
* src/generic/apt/pkg_changelog.cc: - use up-to-date changelog uri construction from apt-get using APT::Changelogs::Server * src/apt_options.cc: - drop disused Aptitude::Changelog-URL-Template * src/cmdline/cmdline_changelog.cc: - remove extraneous guess-work with source packages, which happened to also download the wrong changelog sometimes (Closes: #631464) - changelog download works with no deb-src lines, so we don't need to instruct the user to add any (Closes: #587775, #537393)
2012-06-28Improve arch-qualified pkg names with versions commandDaniel Hartwig1-1/+15
2012-06-28Improve multi-arch handling of package argumentsDaniel Hartwig2-5/+57
* [cmdline]: Package arguments without an arch-qualifier will also consider foreign-arch packages, in order of preference. (LP: #892074) * [cmdline]: Package arguments can use '*' wildcard in their arch-qualifier to select all matching packages, where 'any' would select only the first such package. LP: #892074
2012-06-20Use real candidate version, not default-releaseDaniel Hartwig3-23/+1
2012-06-20Do not do FixMissing automatically for command-line actionsDaniel Hartwig1-0/+1
When a package is not available or fails to download incorrectly aptitude would try to continue without it. This made it hard to detect errors automatically using the exit status. This behaviour is no longer the default, instead if there are missing packages an error will be displayed and the program exit with failure (100). If the user wishes to continue anyway, they can use --fix-missing or configure Aptitude::CmdLine::Fix-Missing in apt.conf. * [cmdline]: An install run will no longer proceed if any package was unavailable or failed to download correctly, instead an error will be shown and exit with non-zero status (100). (Closes: #121313, #302784) The old behaviour can be obtained with the new --fix-missing option or setting Aptitude::CmdLine::Fix-Missing. Closes: #121313 Closes: #302784
2012-06-20Tidy error handling in main, cmdline actionsDaniel Hartwig22-454/+454
Error conditions are much stricter, detecting errors is more reliable, and the exit status of all command-line actions is well-defined. All commands will return one of these values as their exit status: 0 – success 1 – user aborted (install, remove, …); or no matches (search, why, why-not); 100 – failure For commands whose arguments are lists of packages or search patterns the following general conditions hold: It is a failure if any package argument does not exactly name a package. It is a failure if any versioned argument requests a version which is not available for every package identified by that argument. Versioned arguments are those which end with a version or archive (release) specifier, respectively “=<version>” and “/<archive>”. If a command includes a request to install, remove, or purge any package that command will not proceed if any of the above failures occur. Other commands may still proceed in case of such failures but will exit with non-zero status to indicate they were not completely effective. Some commands have exceptions and/or extensions to the general conditions: install, upgrade, remove, …: Where a request specifies a virtual package it is a failure if it has either no provider or multiple providers. If there is only one provider that package will be selected instead of the virtual package. search: All arguments are considered patterns. Arguments without an explicit search term will be wrapped in an implicit ‘?name’ term. This is a major change from previous versions where the program would have proceeded and possibly exited with a status indicating success (0) despite some requested actions being either invalid or ineffective. The new, stricter behaviour is desirable for two reasons: - to prevent the situation where a request to replace one set of packages with another set proceeds when (some of) the replacements are not found or unavailable could cause the undesired removal of arbitrary other packages; - to make the program more atomic and reliable when used for automated tasks – by considering the entire request as being essential to success another program can rely on an exit status of 0 to mean that the request was completely carried out. Summary of changes: * Most errors are now displayed at the end of a command's output which makes them easier to spot when there is lots of output. (Closes: #430392) * [cmdline]: Virtual packages which have an already installed provider are only skipped when the requested action is to install them. * [cmdline]: install and similar actions have much stronger error checking and will exit more reliably with non-zero status on failures Failures which result in no action and a non-zero exit status (100): - a package argument does not exactly name an available package; - a versioned argument requests a version which is not available for every package it applies to (Closes: #590686); * [cmdline]: changelog exits with non-zero status on any error (Closes: #675833) * [cmdline]: search exit with status 1 if it found no matches (Closes: #497299) * [cmdline]: why exits with status 1 if it found no reasons given the particular arguments * [cmdline]: show will exit with status 100 if it found no packages or a named package was not found * unknown arguments do not show the usage screen * more errors are reported using GlobalError * clean up some strings used as error messages * download_install_manager.cc: - repeat if package manager result is DoAgain; - report all download errors not just the first; * cmdline_util.cc: - pkgset_from_string by default is no longer an error if a pattern matches no packages * [doc]: add section on exit status to the man page Closes: #430392 Closes: #497299 Closes: #590686 Closes: #675833
2012-06-16Use apt's CommandLine parserDaniel Hartwig2-0/+54
Previously aptitude was using it's own command line parser implemented on top of getopt. Replacing this with the standard apt class means there are no longer subtle quirks with our parser (such as "-qq" not being valid, when it is fine for other apt programs). The parser is closely tied to the Configuration, and reads options directly in to the global apt config. Some options were tracked independently of the global config; this change is the first part rectifying that situation. The goal is to keep all program options, configuration state, etc. in the global config rather than passing state variables between functions. Many options which previously did not have an associated configuration item now do; some remain undocumented for now as they are transitional. * handle "-qq" like other apt-utils * properly process all -o command line options (Closes: #587671) * unknown command line options trigger an error (Closes: #434502) * --add-user-tag-to, --remove-user-tag-from are working; no bug reports suggests that noone has noticed they were broken New aliases for some command-line options: --yes, for --assume-yes (apt-get) --default-release, for --target-release (apt-utils) --install-on-startup, for -i --update-on-startup, for -u New configuration item: Aptitude::CmdLine::Sorting, equivalent to --sort Other new configuration items are for internal use only at this point. Closes: #587671 Closes: #434502
2012-06-15Typo in cmdline_showDaniel Hartwig1-1/+1
2012-06-14Use arch-qualified names for virtual packages in more placesDaniel Hartwig1-9/+16
2012-06-08Touch copyright notice in cmdline_utilDaniel Hartwig2-0/+2
2012-06-08Add pkgset helpersDaniel Hartwig8-312/+219
Ported some code from apt cacheset.cc to populate a pkgset. The function pkgset_from_string will fill a given pkgset with either the exactly named package, or the packages matched by a string predicated by is_pattern. In the future, we should look to directly use the apt cacheset infrastructure. This is currently blocked by our custom implementation of pkgCacheFile (see aptcache.h). Errors that occur in looking up the package (such as no package with that name, or an invalid search pattern) are pushed to the global error list with a customizable error_type (default: ERROR).
2012-06-08Add typedefs for vectors of package, version search resultsDaniel Hartwig6-20/+22
typedef vector<pair<PkgIterator,ref_ptr<structural_match> > > pkg_results_list; typedef vector<pair<VerIterator,ref_ptr<structural_match> > > ver_results_list;
2012-05-26Update to tasks support: task packages, multi-arch, syntaxDaniel Hartwig2-2/+2
Task packages (introduced with tasksel 3.0) are meta-packages which define the dependencies of tasks. The packages themselves have always worked but the 'tasks' grouping policy and '?task' search term did not support them. This update corrects for this. As a result of this change to tasksel all Debian tasks now function exactly like meta-packages. (Closes: #382631) The syntax for installing tasks from the command line has been updated. It now supports specifying an arch and requires the same syntax as apt-utils ('^' must be the last part of the name). Examples: # aptitude install gnome-desktop^ # aptitude install ssh-server^:armel This avoids ambiguity that may arise when a task and package have the same name. Closes: #382631
2012-05-26Update to tasks support: task packages, multi-arch, syntaxDaniel Hartwig3-32/+57
Task packages (introduced with tasksel 3.0) are meta-packages which define the dependencies of tasks. The packages themselves have always worked but the 'tasks' grouping policy and '?task' search term did not support them. This update corrects for this. As a result of this change to tasksel all Debian tasks now function exactly like meta-packages. (Closes: #382631) The syntax for installing tasks from the command line has been updated. It now supports specifying an arch and requires the same syntax as apt-utils ('^' must be the last part of the name). Examples: # aptitude install gnome-desktop^ # aptitude install ssh-server^:armel This avoids ambiguity that may arise when a task and package have the same name. Closes: #382631
2012-05-24Fold some near-duplicate stringsDaniel Hartwig5-6/+9
2012-05-11Support really big files in the download systemDaniel Hartwig3-21/+21
This follows recent changes in apt which added support for files greater than several gigabytes in size -- using the 'unsigned long long' type to store the file size. Changelog download is restored as a result of this. Closes: #669569 LP: #824708
2012-04-27Use arch-qualified names in 'Provided by' for virtual packagesDaniel Hartwig1-1/+1
LP: #972847
2012-04-25Check for apt_init errors in cmdline_download.ccDaniel Hartwig1-0/+6
Closes: #670379
2012-03-23More nice size on cmdline_download_progressDaniel Hartwig1-1/+2
2012-03-21Extend the default search pattern to support 'name:arch'Daniel Hartwig1-14/+7
A search pattern with no explicit term, "s", is equivalent to "?name(s)". This changes modifies these semantics when the pattern is arch-qualified, "name:arch" which is now equivalent to "?exact-name(name) ?architecture(arch)". These are the semantics used by apt-get and others which are internally derived from pkgCache::FindPkg("name:arch"). On the command-line, it is possible to specify both an architecture and an archive/version, as well as an override specifier: # aptitude install an:armel/sid tf:armel- * src/generic/apt/matching/parse.cc: - extended semantics as per above. * src/cmdline/cmdline_versions.cc: - modify argument processing to use the extended semantics.
2012-03-16Apply patch from Ubuntu to build -D_FORTIFY_SOURCE=2 errorsDaniel Hartwig1-1/+2
Thanks: Colin Watson Thanks: Michael Vogt Closes: #497539
2012-03-15Group results by package:arch in cmdline versionsDaniel Hartwig1-1/+9
2012-03-15Cleanup use of identifiers 'dep_type' and 'deptype'Daniel Hartwig1-7/+7
'deptype' is now used consistently to indicate direct use of pkgCache::Dep::DepType as opposed to pkgCache::Dep. * src/generic/apt/apt.h (deptype_lt): also condense a trivial switch statement.
2012-03-07Use arch-qualified names in info screens, dialogs, warningsDaniel Hartwig1-1/+1
Dependencies on Arch: all packages are still handling incorrectly. This patch thoroughly exposes this issue in the curses interface. Where previously aptitude would show (aboot-cross:amd64 info): --\ Depends (2) --- aboot-base (UNAVAILABLE) which is incorrect (as aboot-base *is* available), we now see: --\ Depends (2) --- aboot-base:amd64 (UNAVAILABLE) which makes it clear why the package is *considered* unavailable. APT tools (at least, 0.8.15 series) exhibit this same problem when displaying dependencies. Exposing this issue enables improvements to the dependency parser/handling to be made. Non-multi-arch systems are unaffected.
2012-03-07Use SizeToStr for all of cmdline progress displayDaniel Hartwig1-2/+2
2012-03-06Always use arch-qualified names in logs and debug infoDaniel Hartwig1-6/+6
2012-03-03Correctly identify "Architecture: all" packagesDaniel Hartwig1-1/+2
2012-03-02Show Multi-Arch field on pkg_info_screen, cmdline showDaniel Hartwig1-0/+4
* src/generic/apt/apt.{cc,h}: - New function multiarch_type returns a string describing a multi-arch type. * src/cmdline/cmdline_show.cc, src/pkg_info_screen.cc: - Show Multi-Arch field on packages where this is set.
2012-03-02Use arch-qualified names for rdependsDaniel Hartwig2-9/+9
2012-03-02Use arch-qualified names when explaining package states, actionsDaniel Hartwig1-14/+14
2012-03-02Use arch-qualified names when resolving dependenciesDaniel Hartwig1-11/+11
2012-02-24Refactor various apt-related comparison functors to apt.hDaniel Hartwig2-62/+8
The resulting functors: - pkg_name_lt - pkg_ptr_lt - ver_name_lt - ver_ptr_lt - dep_type_lt
2012-02-24Show package architectureDaniel Hartwig1-2/+1
2012-02-24Use arch-qualified names in cmdline_prompt, cmdline_actionDaniel Hartwig3-19/+26
2012-02-23Use arch-qualified names in cmdline_show_brokenDaniel Hartwig1-5/+14
2012-02-12Update (auto)clean to use "archives" lockDaniel Hartwig1-41/+32
* src/ui.cc(really_do_clean, really_do_autoclean): Use "archives" lock. * src/cmdline/cmdline_clean.cc(cmdline_clean): Remove call to apt_init. Use "archives" lock instead of system lock. * (cmdline_autoclean): Use "archives" lock instead of system lock.
2012-02-12Silence text progress when -q2Daniel Hartwig1-1/+5
2012-01-31Handle enhances/obsoletes in more places.Daniel Hartwig1-0/+2
2012-01-18Fix prompt strings.Daniel Hartwig2-2/+2
Closes: #652419
2012-01-16Fix resolver help for next/previous.Daniel Hartwig1-1/+1
Hacked for now, this function could use some restructuring to prevent this kind of thing happening. Closes: #495046
2011-05-14Remove old cruft from Makefile.am files.Daniel Burrows1-4/+0
Also fixes a type: EXTRA_DEST -> EXTRA_DIST.
2011-04-02Apply patch from Tim Retout to support the preferences.d directory.Daniel Burrows1-0/+1
2011-04-02Nuke the scons build scripts.Daniel Burrows2-96/+0
These never worked out as well as I intended, and all indications were that they would be a maintenance burden...or just bitrot. Fully parallel builds are nice, but my builds are pretty quick on my 8-core box even with the artificial chokepoints that automake induces.
2011-03-30Fix compile errors caused by changes in the libapt API.Daniel Burrows3-8/+10
Whoever's in charge of libapt these days apparently doesn't believe in backwards compatibility. Or in documenting how their APIs are to be used, or why names are deprecated </gripe>
2010-07-10Make display_and_advance work even when the output isn't a terminal.Daniel Burrows2-9/+15
Also documented this new behavior and wrote a unit test for it.
2010-07-10Make download_status_display part of the command-line code.Daniel Burrows7-52/+146
It's really just a hack to break the command-line implementation up in a way that's more amenable to unit-testing; it doesn't belong in the generic view interface.
2010-07-10Use the new acquire_download_progress object to display command-line ↵Daniel Burrows7-56/+87
downloads and delete acqprogress.
2010-07-10Add a routine on download_progress that's invoked when a file is skipped ↵Daniel Burrows1-0/+30
because it's already downloaded.