summaryrefslogtreecommitdiff
path: root/cmdline
AgeCommit message (Collapse)Author
2020-03-12apt-helper: Add analyze-pattern helperJulian Andres Klode
The analyze-pattern helper parses a pattern and then renders the parsed pattern, allowing you to analyze how the parser interpreted the string. This can be useful to analyse (yes, analyse-pattern also works) why a pattern is different from aptitude or why it does not work as expected. It can also be used to check if apt has pattern support, although that will miss out on the version shipped in eoan, but who really cares about that longer term anyway?
2020-02-26cdrom: Remove old udev dlopen stuffJulian Andres Klode
2020-02-24Make map_pointer<T> typesafeJulian Andres Klode
Instead of just using uint32_t, which would allow you to assign e.g. a map_pointer<Version> to a map_pointer<Package>, use our own smarter struct that has strict type checking. We allow creating a map_pointer from a nullptr, and we allow comparing map_pointer to nullptr, which also deals with comparisons against 0 which are often used, as 0 will be implictly converted to nullptr.
2020-02-24Replace map_pointer_t with map_pointer<T>Julian Andres Klode
This is a first step to a type safe cache, adding typing information everywhere. Next, we'll replace map_pointer<T> implementation with a type safe one.
2020-02-18Merge branch 'master' into 'master'Julian Andres Klode
apt-mark: don't lie about successful marks See merge request apt-team/apt!94
2020-01-14Remove includes of (md5|sha1|sha2).h headersJulian Andres Klode
Remove it everywhere, except where it is still needed.
2020-01-09apt-mark: don't lie about successful marksTris Emmy Wilson
This commit fixes an issue where apt-mark would say it had made a change before actually making the change. For example, when running as a user without permission to write to extended_states, the package is not marked but apt-mark claims it is: ~ % apt-mark manual rxvt-unicode rxvt-unicode set to manually installed. E: Could not create [...snip...] (13: Permission denied) E: Failed to write temporary StateFile /var/lib/apt/extended_states This commit moves reporting of "[package] set to [manually | automatically] installed" after saving extended_states and confirming it was successful.
2019-07-10Fix typos reported by codespell in code commentsDavid Kalnischkies
Also in old changelogs, but nothing really user visible like error messages or alike so barely noteworthy. Reported-By: codespell Gbp-Dch: Ignore
2019-07-08Apply various suggestions by cppcheckDavid Kalnischkies
Reported-By: cppcheck
2019-06-11Introduce apt satisfy and apt-get satisfyJulian Andres Klode
Allow to satisfy dependency strings supplied on the command line, optionally prefixed with "Conflicts:" to satisfy them like Conflicts. Build profiles and architecture restriction lists, as used in build dependencies, are supported as well. Compared to build-dep, build-essential is not installed automatically, and installing of recommended packages follows the global default, which defaults to yes. Closes: #275379 See merge request apt-team/apt!63
2019-05-10apt-mark: Add hidden showheld alias for showholdJulian Andres Klode
For Unit193 and those who value grammar, I suppose.
2019-05-06cacheset: Remove simple cases of deprecated codeJulian Andres Klode
This is missing the ones that are still actively used in cacheset.cc, we need to clean those up too, but they are obviously more tricky.
2019-05-06Merge libapt-inst into libapt-pkgJulian Andres Klode
2019-04-30apt-helper: Support multiple hashes for a fileJulian Andres Klode
This just peels supported hashes of the command-line until we reach a non-hash. For legacy compatability support, the first hash may be an empty string.
2019-02-26sptr: Remove deprecated smart pointer classesJulian Andres Klode
Please use the standard C++ variants instead.
2019-02-01Merge branch 'pu/refuseunsignedlines' into 'master'Julian Andres Klode
Fail if InRelease or Release.gpg contain unsigned lines See merge request apt-team/apt!45
2019-01-27Add a "reinstall" command as an alias for "install --reinstall".Josh Triplett
aptitude has a similar "reinstall" command for precedent.
2019-01-24Merge and reuse tmp file handling across the boardDavid Kalnischkies
Having many rather similar implementations especially if one is exported while others aren't (and the rest of it not factored out at all) seems suboptimal.
2019-01-22Merge branch 'patch-2' of github.com:techtonik/aptJulian Andres Klode
2019-01-10apt-mark: Introduce minimize-manualJulian Andres Klode
This visits dependencies of all manually installed metapackages, as determined by APT::Never-MarkAuto-Sections, and marks them as automatically installed. It can be used to clean up autoflags after a d-i install, for example.
2019-01-10Generalize %s does not take any argumentsJulian Andres Klode
This used to be "apt-cache stats does not take any arguments", but replace "apt-cache stats" with "%s" so we can reuse it for other commands. Gbp-Dch: ignore
2018-12-04Merge branch 'bugfix/spaceinconfig' into 'master'Julian Andres Klode
Use quoted tagnames in config dumps See merge request apt-team/apt!32
2018-12-03Provide a "autopurge" shortcutJulian Andres Klode
This adds a new "autopurge" command that will is a shortcut for "autoremove --purge" Thanks: Michael Vogt for the initial work
2018-11-29Use quoted tagnames in config dumpsDavid Kalnischkies
Tagnames in configuration can include spaces (and other nasties) e.g. in repository-specific configuration options due to Origin/Label potentially containing a space. The configuration file format supports parsing quoted as well as encoded spaces, but the output generated by apt-config and other places which might be feedback into apt via parsing (e.g. before calling apt-key in our gpgv method) do not quote and hence produce invalid configuration files. Changing the default to be an encoded tagname ensures that the output of dump can be used as a config file, but other users might not expect this so that is technically a backward-breaking change.
2018-11-21apt.cc: Add "apt info" alias for muscle memoryanatoly techtonik
Muscle memory is acquired from querying package info with tools like snap, dnf etc.
2018-10-14Merge branch 'feature/subkeys' into 'master'Julian Andres Klode
Support subkeys and multiple keyrings in Signed-By options See merge request apt-team/apt!27
2018-10-02apt-mark: showhold: typo-fix (package -> packages)Muhamed Huseinbašić
See merge request apt-team/apt!29 [jak@d.o: Also adjust translations, provide better subject]
2018-09-11Support multiple keyrings in sources.list Signed-ByDavid Kalnischkies
A user can specify multiple fingerprints for a while now, so its seems counter-intuitive to support only one keyring, especially if this isn't really checked or enforced and while unlikely mixtures of both should work properly, too, instead of a kinda random behaviour.
2018-08-29Fix typos reported by codespell & spellintianDavid Kalnischkies
No user-visible change as it effects mostly code comments and not a single error message, manpage or similar. Reported-By: codespell & spellintian Gbp-Dch: Ignore
2018-05-29apt-key: Pass all instead of gpg-agent to gpgconf --killJulian Andres Klode
We want to kill everything using our temporary directory. LP: #1773992
2018-05-11Support --with-source in show & search commandsDavid Kalnischkies
2018-05-07Remove obsolete RCS keywordsGuillem Jover
Prompted-by: Jakub Wilk <jwilk@debian.org>
2018-05-05Fix various typos reported by spellcheckersDavid Kalnischkies
Reported-By: codespell & spellintian Gbp-Dch: Ignore
2018-02-19add apt-helper drop-privs command…David Kalnischkies
2017-12-13avoid some useless casts reported by -Wuseless-castDavid Kalnischkies
The casts are useless, but the reports show some where we can actually improve the code by replacing them with better alternatives like converting whatever int type into a string instead of casting to a specific one which might in the future be too small. Reported-By: gcc -Wuseless-cast
2017-12-13don't name unused parameter in apt-helper waitonlineDavid Kalnischkies
Reported-By: gcc -Wunused-parameter Gbp-Dch: Ignore
2017-10-05ignore unsupported key formats in apt-keyDavid Kalnischkies
gpg2 generates keyboxes by default and users end up putting either those or armored files into the trusted.gpg.d directory which apt tools neither expect nor can really work with without fortifying backward compatibility (at least under the ".gpg" extension). A (short) discussion about how to deal with keyboxes happened in https://lists.debian.org/deity/2017/07/msg00083.html As the last message in that thread is this changeset lets go ahead with it and see how it turns out. The idea is here simply that we check the first octal of a gpg file to have one of three accepted values. Testing on my machines has always produced just one of these, but running into those values on invalid files is reasonabily unlikely to not worry too much. Closes: #876508
2017-09-11apt-daily: Do not Wants=network-online, and add some more After=Julian Andres Klode
We now wait for being online ourselves, so all we need to wait on is for services we are using to be online first. This avoids severe boot slowdowns by other services having specified an After=network-online.target without a Wants=. Gbp-Dch: Full
2017-09-10apt-helper: Add connman support to wait-onlineJulian Andres Klode
2017-09-09apt-daily: Wait for network before daily updatesJulian Andres Klode
Introduce a new helper, apt-helper wait-online that uses NetworkManager and/or systemd-networkd to wait for them reporting online, with a time out of 30 seconds; and run that helper before running the daily update script. LP: #1699850 Gbp-Dch: Full
2017-08-24Replace APT_CONST with APT_PURE everywhereJulian Andres Klode
As a follow up to the last commit, let's replace APT_CONST with APT_PURE everywhere to clean stuff up.
2017-07-26ignore SIGPIPE in dump solver if forwardingDavid Kalnischkies
Our test-external-dependency-solver-protocol test sometimes fails on the immediately 'crashing' solver exit1withoutmsg with the message that it got SIGPIPE from the solver. That isn't really possible as the solver produces no output, but on inspection its not this solver getting the signal but the wrapping provided by the dump-solver as the wrapped solver instantly exits. Simply ignoring the signal helps in perhaps extracting the last words of another solver (as this one has none), but at the very least we get the exit code of the wrapped solver we interested in as output.
2017-07-12Reformat and sort all includes with clang-formatJulian Andres Klode
This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
2017-07-12Drop cacheiterators.h includeJulian Andres Klode
Including cacheiterators.h before pkgcache.h fails because pkgcache.h depends on cacheiterators.h.
2017-06-26avoid explicit types for pkg counts by autoDavid Kalnischkies
Changes nothing on the program front and as the datatypes are sufficently comparable fixes no bug either, but problems later on if we ever change the types of those and prevent us using types which are too large for the values we want to store waste (a tiny bit of) resources. Gbp-Dch: Ignore
2016-12-31apt-key: ignore gpg1 already imported secret key import failureDavid Kalnischkies
On Travis and co the default gpg implementation is gpg1 which for some reason fails if a secret key which was already imported is imported again. We would prefer it to be a NOP like gpg2 handles it so we crudely check the error message. apt-key usually doesn't deal with secret keys – it only learned to do it for manual testing and the integration framework usage, so no public interface is effected. Triggered-By: 4ce2f35248123ff2366c8c365ad6a94945578d66 Gbp-Dch: Ignore
2016-12-21tests: cache the apt-key homedir used for Release signingDavid Kalnischkies
Importing a new secret key into gpg(2) can be increadibly slow which prolongs the test runs significantly – by caching the homedir we gain a significant speedbonus as reimporting already present keys seems like a far less costly operation. Git-Dch: Ignore
2016-11-25add apt-key support for armored GPG key files (*.asc)David Kalnischkies
Having binary files in /etc is kinda annoying – not that the armored files are much better – but it is hard to keep tabs on which format the file has ("simple" or "keybox") and different gnupg versions have different default binary formats which can be confusing for users to work with (beside that it is binary). Adding support for this now will enable us in some distant future to move to armored later on, much like we added trusted.gpg.d years before the world picked it up.
2016-11-24report apt-key errors via status-fd messagesDavid Kalnischkies
We report warnings from apt-key this way already since 29c590951f812d9e9c4f17706e34f2c3315fb1f6, so reporting errors seems like a good addition. Most of those errors aren't really from apt-key through, but from the code setting up and actually calling it which used to just print to stderr which might or might not intermix them with (other) progress lines in update calls. Having them as proper error messages in the system means that the errors are actually collected later on for the list instead of ending up with our relatively generic but in those cases bogus hint regarding "is gpgv installed?". The effective difference is minimal as the errors apply mostly to systems which have far worse problems than a not as nice looking error message, which makes this pretty hard to test – but at least now the hint that your system is broken can be read in proper order (= there aren't many valid cases in which the permissions of /tmp are messed up…). LP: #1522988
2016-08-27Merge branch 'portability/freebsd'Julian Andres Klode