summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
AgeCommit message (Collapse)Author
2014-11-08guard ABI changes for SourcePkg/Ver in pkgCacheDavid Kalnischkies
Git-Dch: Ignore
2014-11-08better non-virtual metaIndex.LocalFileName() implementationDavid Kalnischkies
We can't add a new virtual method without breaking the ABI, but we can freely add new methods, so for older ABIs we just implement this method with a dynamic_cast, so that clients can be more ignorant about the API here and especially don't need to pull a very dirty trick by assuming internal knowledge (like apt-get did here).
2014-10-23chown finished partial files earlierDavid Kalnischkies
partial files are chowned by the Item baseclass to let the methods work with them. Now, this baseclass is also responsible for chowning the files back to root instead of having various deeper levels do this. The consequence is that all overloaded Failed() methods now call the Item::Failed base as their first step. The same is done for Done(). The effect is that even in partial files usually don't belong to _apt anymore, helping sneakernets and reducing possibilities of a bad method modifying files not belonging to them. The change is supported by the framework not only supporting being run as root, but with proper permission management, too, so that privilege dropping can be tested with them.
2014-10-15check for available space, excluding root reserved blocksDavid Kalnischkies
We are checking the space requirements for ages, but the check uses the free blocks count, which includes the blocks reserved for usage by root. Now that we use an unprivileged user it has no access to these blocks anymore – and more importantly these blocks are a reserve, they shouldn't be used by apt without special encouragement by the user as it would be bad to have dpkg run out of diskspace and maintainerscripts like man-db skip certain actions if not enough space is available freely.
2014-10-15don't drop privileges if _apt has not enough rightsDavid Kalnischkies
Privilege dropping breaks download/source/changelog commands as they require the _apt user to have write permissions in the current directory, which is e.g. the case in /tmp, but not in /root, so we disable the privilege dropping if we deal with such a directory based on idea and code by Michael Vogt. The alternative would be to download always to a temp directory and move it then done, but this breaks partial file support. To resolve this, we could move to one of our partial/ directories, but this would require a lock which would block root from using two of these commands in parallel. As both seems unacceptable we instead let the user choose what to do: Either a directory is setupped for _apt, downloading as root is accepted or – which is potentially even better – an unprivileged user is used for the commands.
2014-10-07Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt
feature/acq-trans Conflicts: apt-pkg/acquire-item.cc
2014-10-07ensure partial dirs are 0700 and owned by _apt:rootDavid Kalnischkies
Reworks the API involved in creating and setting up the fetcher to be a bit more pleasent to look at and work with as e.g. an empty string for no lock isn't very nice. With the lock we can also stop creating all our partial directories "just in case". This way we can also be a bit more aggressive with the partial directory itself as with a lock, we know we will gone need it.
2014-10-03apt-get: Create the temporary downloaded changelog inside tmpdirGuillem Jover
The code is creating a secure temporary directory, but then creates the changelog alongside the tmpdir in the same base directory. This defeats the secure tmpdir creation, making the filename predictable. Inject a '/' between the tmpdir and the changelog filename.
2014-10-02apt-get: Create the temporary downloaded changelog inside tmpdirGuillem Jover
The code is creating a secure temporary directory, but then creates the changelog alongside the tmpdir in the same base directory. This defeats the secure tmpdir creation, making the filename predictable. Inject a '/' between the tmpdir and the changelog filename.
2014-09-29Merge branch 'debian/sid' into debian/experimentalMichael Vogt
Conflicts: apt-pkg/acquire-item.cc
2014-09-27cleanup partial directory of lists in apt-get cleanDavid Kalnischkies
Not really the intended usecase for apt-get clean, but users expect it to help them in recovery and it can't really hurt as this directory should be empty if everything was fine and proper anyway. Closes: #762889
2014-09-27allow fetcher setup without directory creationDavid Kalnischkies
apt-get download and changelog as well as apt-helper reuse the acquire system for their own proposes without requiring the directories the fetcher wants to create, which is a problem if you run them as non-root and the directories do not exist as it greets you with: E: Archives directory /var/cache/apt/archives/partial is missing. - Acquire (13: Permission denied) Closes: 762898
2014-09-27store source name and version in binary cacheDavid Kalnischkies
Accessing the package records to acquire this information is pretty costly, so that information wasn't used so far in many places. The most noticeable user by far is EDSP at the moment, but there are ideas to change that which this commit tries to enable.
2014-09-27mark pkg(All|Dist)Upgrade as deprecatedDavid Kalnischkies
The comment above their definition marks them already as such, so this is only a formalisation of the deprecation and fixes the occurances we have in our own code together with removing a magic number. Git-Dch: Ignore
2014-09-21generalize Acquire::GzipIndexMichael Vogt
2014-09-05Merge branch 'debian/sid' into debian/experimentalMichael Vogt
Conflicts: apt-pkg/acquire-item.cc configure.ac debian/changelog doc/apt-verbatim.ent doc/po/apt-doc.pot doc/po/de.po doc/po/es.po doc/po/fr.po doc/po/it.po doc/po/ja.po doc/po/pt.po po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/tr.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/test-ubuntu-bug-346386-apt-get-update-paywall
2014-08-26add dpkg::source-options for dpkg-source invocationDavid Kalnischkies
dpkg-source can be told to enforce signature checks with --require-valid-signature, but while this isn't feasible as default for Debian itself at the moment, a local admin should be able to use it. This commit also fixes the size limit on the construction of the command being called for dpkg-source and dpkg-buildpackage. Closes: 757534
2014-07-08Only allow "apt-get build-dep path" when path starts with ./ or /Michael Vogt
This avoid the subtle problem that someone might have a directory with the same package name as the build-depends he/she is trying to fetch. Also print a note that the specific file/dir is used.
2014-06-18Merge branch 'debian/sid' into debian/experimentalMichael Vogt
Conflicts: debian/changelog
2014-06-02Show unauthenticated warning for source packages as wellMichael Vogt
This will show the same unauthenticated warning for source packages as for binary packages and will not download a source package if it is unauthenticated. This can be overridden with --allow-unauthenticated Closes: #749795
2014-05-29Merge remote-tracking branch 'upstream/debian/sid' into debian/experimentalMichael Vogt
Conflicts: test/integration/test-bug-747261-arch-specific-conflicts
2014-05-22fix screen width detection for apt/apt-get listsSebastian Schmidt
3163087b moved SigWinch(int) from apt-get.cc to private-output.cc without moving #include <sys/ioctl.h>, making SigWinch a nop. Closes: 748430, 747942
2014-05-09use HashStringList in the acquire systemDavid Kalnischkies
It is not very extensible to have the supported Hashes hardcoded everywhere and especially if it is part of virtual method names. It is also possible that a method does not support the 'best' hash (yet), so we might end up not being able to verify a file even though we have a common subset of supported hashes. And those are just two of the cases in which it is handy to have a more dynamic selection. The downside is that this is a MAJOR API break, but the HashStringList has a string constructor for compatibility, so with a bit of luck the few frontends playing with the acquire system directly are okay.
2014-05-09use 'best' hash for source authenticationDavid Kalnischkies
Collect all hashes we can get from the source record and put them into a HashStringList so that 'apt-get source' can use it instead of using always the MD5sum. We therefore also deprecate the MD5 struct member in favor of the list. While at it, the parsing of the Files is enhanced so that records which miss "Files" (aka MD5 checksums) are still searched for other checksums as they include just as much data, just not with a nice and catchy name. LP: 1098738
2014-05-08Merge remote-tracking branch 'mvo/feature/build-dep-dsc2' into ↵Michael Vogt
debian/experimental Conflicts: apt-pkg/deb/debindexfile.cc apt-pkg/deb/debindexfile.h apt-pkg/deb/debsrcrecords.cc
2014-05-07Merge branch 'debian/sid' into debian/experimentalMichael Vogt
Conflicts: apt-pkg/cachefilter.h apt-pkg/contrib/fileutl.cc apt-pkg/contrib/netrc.h apt-pkg/deb/debsrcrecords.cc apt-pkg/init.h apt-pkg/pkgcache.cc debian/apt.install.in debian/changelog
2014-04-28Fix missing ScreenWidth check in apt.ccMichael Vogt
2014-04-25add support for apt-get build-dep unpacked-source-dirMichael Vogt
2014-04-24create debIFTypeDscFile typeMichael Vogt
2014-04-22add support for apt-get build-dep foo.dscMichael Vogt
2014-03-13use SPtrArray handling instead of explicit delete[]David Kalnischkies
The warning message from gcc doesn't make that much sense in my reading as there is no loop which could overflow here, but it is better to use our SPtrArray wrapping anyway which fixes the warning as well. warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] delete[] Dsc; Git-Dch: Ignore Reported-By: gcc -Wunsafe-loop-optimizations
2014-03-13cleanup headers and especially #includes everywhereDavid Kalnischkies
Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
2014-03-13warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies
Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
2014-03-13warning: no previous declaration for foobar() [-Wmissing-declarations]David Kalnischkies
Git-Dch: Ignore Reported-By: gcc -Wmissing-declarations
2014-03-13support DEB_BUILD_PROFILES and -P for build profilesDavid Kalnischkies
Inspired by the rest of the patch in 661537, but abstract the parsing of various ways of setting the build profiles more so it can potentially be reused and all apt parts have the same behaviour. Especially config options, cmdline options and environment will not be combined as proposed as this isn't APTs usual behaviour and dpkg doesn't do it either, so one overrides the other as it normally does.
2014-02-27Merge branch 'debian/sid' into debian/experimentalMichael Vogt
Conflicts: apt-private/private-list.cc configure.ac debian/apt.install.in debian/changelog
2014-02-22Fix typos in documentation (codespell)Michael Vogt
2014-02-12Use a APT::VersionSet instead of a VersionListMichael Vogt
Use a APT::VersionSet instead of a APT::VersionList in DoDownload() to ensure that there is only one version in the set even if the user passes multiple identical name/versions on the commandline (Bug#738103)
2014-02-05move isatty() check into InitOutput()Michael Vogt
2014-01-29fix apt-get download truncation (closes: #736962)Michael Vogt
2014-01-24add "apt full-upgrade" and tweak "apt upgrade"Michael Vogt
There is a new "apt full-upgrade" that performs a apt-get dist-upgrade. "apt dist-upgrade" is still supported as a alias. The "apt upgrade" code is changed so that it mirrors the behavior of "apt-get upgrade --with-new-pkgs" and also honors "apt uprade --no-new-pkgs".
2013-12-22factor GetTempDir outMichael Vogt
2013-12-12Merge remote-tracking branch 'mvo/bugfix/conffile' into debian/sidMichael Vogt
2013-12-12clarify error message when apt-get source=ver fails, print a real error ↵Michael Vogt
message instead of "ignoring"
2013-12-11improve error messageMichael Vogt
2013-12-11improve error message for apt-get source pkg:arch{=ver,/release}Michael Vogt
2013-12-11add support for "apt-get source pkg:arch"Michael Vogt
2013-12-10user-requested version tag gets precedence in apt-get source -t dist ↵Michael Vogt
pkg=version requests
2013-12-10fix typoMichael Vogt
2013-12-10if there is only deb-src pick higest version in deb-src release matchingMichael Vogt