David Kalnischkies [Sun, 3 Jul 2016 12:39:16 +0000 (14:39 +0200)]
save and restore selection states before/after calling dpkg
dpkg decides certain things on its own based on selections and
especially if we want to call --pending on purge/remove actions, we need
to ensure a clean slate or otherwise we surprise the user by removing
packages we weren't allowed to remove by the user in this run (the
selection might be an overarching plan for the not-yet "future").
Ideally dpkg would have some kind of temporal selection interface for
this case, but it hasn't, so we make it temporal with the risk of
loosing state if we don't manage to restore them.
David Kalnischkies [Thu, 9 Jun 2016 09:48:16 +0000 (11:48 +0200)]
use dpkg --unpack --recursive to avoid long cmdlines
Having long commandlines split into two is a huge problem if it happens
and additionally if we want to introduce planners which perform less
micromanagment its a good idea to leave the details for dpkg to decide.
In practice this doesn't work yet unconditionally as a bug is hiding in
the ordering code of dpkg, but it works if apt imposes its ordering so
this commit allows for now at least to solve the first problem.
David Kalnischkies [Sun, 3 Jul 2016 11:57:25 +0000 (13:57 +0200)]
pass --force-remove-essential to dpkg only if needed
APT (usually) knows which package is essential or not, so we can avoid
passing this force flag to dpkg unconditionally if the user hasn't
chosen a non-default essential handling obscuring the information.
Julian Andres Klode [Wed, 10 Aug 2016 14:42:23 +0000 (16:42 +0200)]
Do not set the binary dir in run-tests, it breaks stuff
This breaks -j and does all sort of other weird stuff I did not
notice in the previous (non-parallel) runs.
Gbp-Dch: ignore
Julian Andres Klode [Wed, 10 Aug 2016 14:26:23 +0000 (16:26 +0200)]
Fix some indentation issues in README.md
Julian Andres Klode [Wed, 10 Aug 2016 14:19:00 +0000 (16:19 +0200)]
Merge branch 'cmake'
Julian Andres Klode [Wed, 10 Aug 2016 12:16:52 +0000 (14:16 +0200)]
test: Automatically discover CMake build directory
Look at the project root, and all directories directly below it and
pick the directory with the newest CMakeCache.txt file.
Gbp-Dch: ignore
Julian Andres Klode [Tue, 9 Aug 2016 18:17:21 +0000 (20:17 +0200)]
Update gitignore for cmake
We cannot be sure if you are not running the build tree, so this
is a bit ugly.
Gbp-Dch: ignore
Julian Andres Klode [Tue, 9 Aug 2016 15:40:01 +0000 (17:40 +0200)]
Get rid of the old buildsystem
Bye, bye, old friend.
Julian Andres Klode [Tue, 9 Aug 2016 15:39:25 +0000 (17:39 +0200)]
Add statvfs.h.in to CMake directory
Gbp-Dch: ignore
Julian Andres Klode [Tue, 9 Aug 2016 15:49:46 +0000 (17:49 +0200)]
Merge README.cmake into README.md
Gbp-Dch: ignore
Julian Andres Klode [Mon, 8 Aug 2016 21:52:14 +0000 (23:52 +0200)]
apt-private: Do not include apti18n.h in headers
This causes build failures when turning translations off.
Julian Andres Klode [Mon, 8 Aug 2016 20:12:16 +0000 (22:12 +0200)]
prepare-release: Switch over to CMake, set version in CMakeLists.txt
Teach the prepare-release script about the version new locations
and also set the version in CMakeLists, as that is better than
reading it from the changelog: CMake would not rerun automatically
otherwise if the version changed.
Gbp-Dch: ignore
Julian Andres Klode [Mon, 8 Aug 2016 19:53:46 +0000 (21:53 +0200)]
CMake: Rewrite existing Documentation support and add doxygen
This can now build all documentation. It should also be fairly
reusable for other projects, as long as they follow the same
naming scheme for the po4a output files and set the PACKAGE_*
variables used here.
We could have done all translations in a single call to po4a
like the makefile based buildsystem does. While that would
have made the output slightly nicer, this solution offers a
huge performance gain because it can translate the documents
in parallel, which also means that the xsltproc stage does not
have to wait for all translations to be done first.
You might think that the add_custom_command() should list the
actual output files as BYPRODUCTS. This is not true however:
Because the files are not always generated, Ninja will think
missing byproducts mean that the target is out of date - which
is not what we want.
Finally, also add the missing doxygen support. Note that the
packaging script cleans up some md5 and map files created by
doxygen, otherwise it is fairly boring.
Julian Andres Klode [Mon, 8 Aug 2016 19:53:05 +0000 (21:53 +0200)]
CMake: Misc: Extract command path_join() from Translations
This abstracts the joining of paths a bit better than having
basically the same code twice in the Translations module.
Gbp-Dch: ignore
Julian Andres Klode [Mon, 8 Aug 2016 12:56:53 +0000 (14:56 +0200)]
CMake: Check for ptsname_r() again
This was dropped in autotools as I found no use of the HAVE_PTSNAME_R
macro. Turns out it was typoed as HAVE_PTS_NAME_R. Fix the #ifdef and
add checks to CMake for it.
Closes: #833674
Julian Andres Klode [Mon, 8 Aug 2016 12:35:09 +0000 (14:35 +0200)]
CMake: Allow building without dpkg
It's not entirely clear if that is useful, but it cannot hurt. We
need to check what is missing to build on foreign systems without
dpkg.
Gbp-Dch: ignore
Julian Andres Klode [Mon, 8 Aug 2016 12:16:36 +0000 (14:16 +0200)]
CMake: Bump minimum required version to 3.4.0
The SOURCE_DIR property is used for the translation building and
was introduced in cmake 3.4
Julian Andres Klode [Mon, 8 Aug 2016 09:31:06 +0000 (11:31 +0200)]
debian: make autopkgtest run with CMake build dir
Julian Andres Klode [Sun, 7 Aug 2016 16:22:14 +0000 (18:22 +0200)]
CMake: Add unit tests
Add support for our GTest based unit tests. By default, CMake will
look in /usr/src/gtest for the external GTest project, but this can
be overriden by defining GTEST_ROOT when invoking cmake.
Gbp-Dch: ignore
Julian Andres Klode [Tue, 9 Aug 2016 19:52:08 +0000 (21:52 +0200)]
CMake: Translations: Build .pot in po binary dir, not project one
This was cluttering up things all over the place.
Gbp-Dch: ignore
Julian Andres Klode [Tue, 9 Aug 2016 16:14:41 +0000 (18:14 +0200)]
CMake: Translations: Allow excluding languages from translation
This seems to be needed for the hebrew translations.
Gbp-Dch: ignore
Julian Andres Klode [Tue, 9 Aug 2016 11:10:28 +0000 (13:10 +0200)]
CMake: Translations: Avoid rebuilding .mo if .pot did not change
Use the witness/byproducts approach to build the translations. A
byproduct of a command is like an output, but may be older than the
input.
Here, we generate a normal template with headers in the normal way
as a witness (and for Launchpad translations), but we also generate
a .pot-tmp0 template file without a header that gets copied to a
.pot-tmp byproduct only if it changed. This way, the .pot-tmp is
only updated if an actual string translation changed. We also
create a custom target for the .pot file that we'll depend on
later in the overall target creating the mo files to ensure that
the template is build before we try to build mo files.
Then we make the msgmerge depend on the .pot-tmp instead of the .pot
file, which means that msgmerge and msgfmt only get re-run if a string
change occured.
Gbp-Dch: ignore
Julian Andres Klode [Tue, 9 Aug 2016 09:58:28 +0000 (11:58 +0200)]
CMake: Translations: Add a statistics target
This is really useful stuff to have.
Gbp-Dch: ignore
Julian Andres Klode [Sun, 7 Aug 2016 14:01:18 +0000 (16:01 +0200)]
CMake: Translations: Build apt-all.pot and update .po files
Merge all the per-domain templates into one template file using
msgcomm, stripping any line numbers in the input files, and sorting
the output per file.
This should create reasonably stable .pot and .po files that do not
change just because files move around. It should also be resilient
against some line changes, as long as one translated line is not
moved before/after another translated line.
Gbp-Dch: ignore
Julian Andres Klode [Sun, 7 Aug 2016 13:52:59 +0000 (15:52 +0200)]
CMake: Translations: Add support for shell scripts
Rework the arguments to apt_add_translation_domain so a user
can specify TARGETS and SCRIPTS, the latter being Shell scripts.
For each language (TARGETS being C++, SCRIPTS being Shell), a separate
template is generated via xgettext. Those templates are then merged
together by using msgcomm. In case there are no Shell scripts in
the translation domain, msgcomm will receive /dev/null instead of
a shell translation template.
This also reintroduces line numbers, as msgcomm would otherwise
re-order the merged files not only by filename, but also by message
string. It's unclear why it does that, it could just leave strings
within a file alone.
In contrast to the old build system, we use xgettext for shell scripts
instead of bash --dump-strings, as it's just easier to use the same
tool for everything. We also create valid headers.
Julian Andres Klode [Sun, 7 Aug 2016 13:50:04 +0000 (15:50 +0200)]
CMake: Translations: Write a .po file before writing a .mo file
This makes debugging things easier.
Gbp-Dch: ignore
Julian Andres Klode [Sun, 7 Aug 2016 11:37:15 +0000 (13:37 +0200)]
CMake: Translations: Pass some additional arguments to commands
This gets rid of the line numbers, adds the plural keyword,
and makes msgfmt print statistics, so we know how well translated
we are.
Gbp-Dch: ignore
Julian Andres Klode [Sun, 7 Aug 2016 11:36:11 +0000 (13:36 +0200)]
CMake: Translations: Make po templates depend on input files
I wondered why the template was not rebuilt after I changed a file,
now I have the answer.
Gbp-Dch: ignore
Julian Andres Klode [Sun, 7 Aug 2016 13:45:36 +0000 (15:45 +0200)]
CMake: Set PACKAGE_MAIL variable
This is needed in a lot of places. Also adjust config.h.in to use
it instead of the bare email address.
Gbp-Dch: ignore
Julian Andres Klode [Sun, 7 Aug 2016 12:24:14 +0000 (14:24 +0200)]
CMake: po: Add mirror method
I forgot this one, sorry
Julian Andres Klode [Sun, 7 Aug 2016 01:34:18 +0000 (03:34 +0200)]
CMake: Improve handling of vendor files
First of all, instead of creating the files at configure time,
generate the files using normal target. This has the huge advantage
that they are rebuilt if their input changes. While we are at it,
also add dependencies on the vendor entity files.
This also fixes the path to the vendor script, which was given
relatively before, which obviously won't work when running from
inside a deeper subdirectory.
To speed things up, pass the --vendor option to getinfo, so we
do not have to find out the current vendor in getinfo all over
again.
Gbp-Dch: ignore
Julian Andres Klode [Sun, 7 Aug 2016 01:33:11 +0000 (03:33 +0200)]
CMake: Cache CURRENT_VENDOR and make it configurable
Cache the current vendor, so we do not have to rerun getinfo when
reconfiguring stuff. This also has the nice effect of making the
vendor configurable, so you can manually specify it on a platform
that might not have dpkg (not that building without dpkg works
yet).
Gbp-Dch: ignore
Julian Andres Klode [Sun, 7 Aug 2016 01:32:12 +0000 (03:32 +0200)]
vendor/getinfo: Accept --vendor VENDOR option
This can be used to query a field for a specific vendor. It
also speeds up things a lot if we can cache the current vendor
in cmake and pass it to further getinfo invocations.
Gbp-Dch: ignore
Julian Andres Klode [Sat, 6 Aug 2016 22:22:44 +0000 (00:22 +0200)]
CMake: Use find_package() for curl instead of pkg_check_modules()
No need to involve pkg-config when CMake has builtin support
Gbp-Dch: ignore
Julian Andres Klode [Sat, 6 Aug 2016 22:45:25 +0000 (00:45 +0200)]
Handle interrupt when running Pre-Install hooks
If we receive an interrupt, set a flag and do not abort
immediately without waiting for the child. Once the child
exited, exit with an error if the interrupted flag is set.
Closes: #832593
Julian Andres Klode [Sat, 6 Aug 2016 21:18:46 +0000 (23:18 +0200)]
releasing package apt version 1.3~pre3+cmake2
Julian Andres Klode [Sat, 6 Aug 2016 21:18:17 +0000 (23:18 +0200)]
Build-depend on pkg-config
Julian Andres Klode [Sat, 6 Aug 2016 20:49:28 +0000 (22:49 +0200)]
releasing package apt version 1.3~pre3+cmake1
Julian Andres Klode [Sat, 6 Aug 2016 20:48:08 +0000 (22:48 +0200)]
CMake: Adjust abicheck locations
Look in build/apt-pkg and build/apt-inst instead of build/bin.
Gbp-Dch: ignore
Julian Andres Klode [Sat, 6 Aug 2016 19:40:01 +0000 (21:40 +0200)]
CMake: debian: Switch packaging over to CMake and dh 9
This new packaging is much easier to read, although the duplication
in the install files is a bit annoying. We should probably also get
rid of the movefiles for solvers, planners, and https method; but
then we have to keep track of which methods exist in the apt package.
Another disadvantage is that building only the documentation packages
also requires building the code, as there's no way to turn off code
building in the project.
Julian Andres Klode [Sat, 6 Aug 2016 19:32:36 +0000 (21:32 +0200)]
CMake: Switch integration tests and travis over
This early support seems a bit hacky, but it's a hard switch: The
integration tests do not understand the old build system anymore
afterwards. I don't really like that.
Julian Andres Klode [Sat, 6 Aug 2016 19:18:39 +0000 (21:18 +0200)]
CMake: Add initial support for documentation building
Build HTML docbook guides (untranslated) and manual pages
(including translations). Also install the examples in the
example subdirectory.
Translation of docbook guides has not been implemented yet,
but should be easy to do. The code also needs some cleanup
to automatically detect the available translations.
Julian Andres Klode [Sat, 6 Aug 2016 19:11:06 +0000 (21:11 +0200)]
CMake: Add support for building and installing .mo files
Introduce support for building translation domain-specific
templates, merging them with the translations, and building
a language-specific .mo file.
The invocation of xgettext is done in the project source
directory, not in the current source directory, and all paths
are made relative to the project root, in order to have clean
templates.
This only supports the C++ source code for now, it unfortunately
does not handle the shell scripts of deselect yet.
Julian Andres Klode [Sat, 6 Aug 2016 19:03:43 +0000 (21:03 +0200)]
CMake: Add basic CMake build system
Introduce an initial CMake buildsystem. This build system can build
a fully working apt system without translation or documentation.
The FindBerkelyDB module is from kdelibs, with some small adjustements
to also look in db5 directories.
Initial work on this CMake build system started in 2009, and was
resumed in August 2016.
Julian Andres Klode [Sat, 6 Aug 2016 17:07:22 +0000 (19:07 +0200)]
prepare-release: Also search for libraries in CMake locations
With this change, the 'library' command looks for a library libX
in the directories: build/bin, */X, X.
This allows it to find the library when building with the
upcoming CMake backend, which places the libraries in a sub
directory of the build tree with the same name as the source
tree.
For example, if building in 'build/', the apt-pkg library
will be available at 'build/apt-pkg/libapt-pkg.so.5.0'.
In case there are multiple instances of a library,
the newest one will be used.
Gbp-Dch: ignore
Julian Andres Klode [Sat, 6 Aug 2016 03:10:36 +0000 (05:10 +0200)]
debian/control: Use versioned provides for same-ver library deps
This simplifies the design a bit, as we do not need to read the
major ABI version number from some file / command.
Gbp-Dch: ignore
Julian Andres Klode [Sat, 6 Aug 2016 18:16:38 +0000 (20:16 +0200)]
vendor/getinfo: Teach it about sourceslist-list-format
This makes it easier to write a generic subsitution tool for
handling substitutions in apt-key.in and sources.list.in
Gbp-Dch: ignore
Julian Andres Klode [Sat, 6 Aug 2016 01:50:54 +0000 (03:50 +0200)]
vendor/getinfo: Provide command to determine vendor to use
Introduce the 'current' command to eventually replace the current
symbolic link. The current command does roughly the same as the
makefile, the code has just been cleaned up a bit to work better
as a shell function.
Gbp-Dch: ignore
Julian Andres Klode [Sat, 6 Aug 2016 20:20:56 +0000 (22:20 +0200)]
doc: Fix fuzzy string regression
Commit
b559d4846018c3adac362c6f1d0d697956586208 updated the
documentation to refer to apt.systemd.daily instead of the
apt cron job, introducing fuzzy strings in all the translations.
Gbp-Dch: ignore
Julian Andres Klode [Fri, 5 Aug 2016 12:32:56 +0000 (14:32 +0200)]
test: Pass -maxdepth 1 when running find in methods dir
This fixes a test failures in the cmake branch which contains
sub directories in the methods output dir.
Julian Andres Klode [Sat, 6 Aug 2016 00:03:09 +0000 (02:03 +0200)]
configure.ac: Drop broken unused check for ptsname_r()
AC_CHECK_FUNCS() defines HAVE_* variables, but AC_CHECK_FUNC()
does not.
Anyway: We do not have any code using HAVE_PTSNAME_R, so
just remove it.
Julian Andres Klode [Fri, 5 Aug 2016 23:51:41 +0000 (01:51 +0200)]
configure.ac: Re-enable pthread support for thread-local _error
This was disabled in 1999 by jgg due to "glibc bugs". Let's hope
those are fixed now, 17 years later.
Julian Andres Klode [Fri, 5 Aug 2016 16:08:05 +0000 (18:08 +0200)]
Merge pull request Debian/apt#18 from corburn/doc
doc: update path to periodic options script
Jason Travis [Fri, 5 Aug 2016 14:59:42 +0000 (07:59 -0700)]
doc: update path to periodic options script
Julian Andres Klode [Thu, 4 Aug 2016 18:49:10 +0000 (20:49 +0200)]
apt-private: #ifdef HAVE_STRUCT_STATFS_F_TYPE, not #if
While autotools defines all macros to 1 explicitly, CMake only
defines them without a value. In such a case, #if fails with an
error and #ifdef works.
In preparation for a possible switch to CMake and to clean up
the code (rest uses #ifdef), use #ifdef here
Julian Andres Klode [Thu, 4 Aug 2016 08:25:36 +0000 (10:25 +0200)]
Release 1.3~pre3
Julian Andres Klode [Wed, 3 Aug 2016 16:50:37 +0000 (18:50 +0200)]
ExecGPGV: Pass current config state to apt-key via temp file
Create a temporary configuration file with a dump of our
configuration and pass that to apt-key.
LP: #
1607283
Julian Andres Klode [Wed, 3 Aug 2016 16:45:51 +0000 (18:45 +0200)]
ExecGPGV: Fork in all cases
Julian Andres Klode [Wed, 3 Aug 2016 16:44:27 +0000 (18:44 +0200)]
ExecGPGV: Rework file removal on exit()
Create a local exiter object which cleans up files on exit.
Julian Andres Klode [Thu, 28 Jul 2016 10:41:27 +0000 (12:41 +0200)]
gpgv: Unlink the correct temp file in error case
Previously, when data could be created and sig not, we would unlink
sig, not data (and vice versa).
David Kalnischkies [Sun, 31 Jul 2016 08:29:25 +0000 (10:29 +0200)]
apt-key: ignore any error produced by gpgconf --kill
gpgconf wasn't always equipped with a --kill option as highlighted by
our testcases failing on Travis and co as these use a much older version
of gpg2. As this is just for cleaning up slightly faster we ignore any
error a call might produce and carry on. Use a recent enough gpg2
version if you need the immediate killing…
Gbp-Dch: Ignore
Reported-By: Travis CI
David Kalnischkies [Sun, 31 Jul 2016 07:27:19 +0000 (09:27 +0200)]
apt-key: kill gpg-agent explicitly in cleanup
apt-key has (usually) no secret key material so it doesn't really need
the agent at all, but newer gpgs insist on starting it anyhow. The
agents die off rather quickly after the underlying home-directory is
cleaned up, but that is still not fast enough for tools like sbuild
which want to unmount but can't as the agent is still hanging onto a
non-existent homedir.
Reported-By: Johannes 'josch' Schauer on IRC
David Kalnischkies [Sat, 30 Jul 2016 07:57:50 +0000 (09:57 +0200)]
prevent C++ locale number formatting in text APIs (try 2)
Followup of
b58e2c7c56b1416a343e81f9f80cb1f02c128e25.
Still a regression of sorts of
8b79c94af7f7cf2e5e5342294bc6e5a908cacabf.
Closes: 832044
David Kalnischkies [Fri, 29 Jul 2016 19:51:43 +0000 (21:51 +0200)]
edsp: try to read responses even if writing failed
If a solver/planner exits before apt is done writing we will generate
write errors. Solvers like 'dump' can be pretty quick in failing but
produce a valid EDSP error report apt should read, parse and display
instead of just discarding even through we had write errors.
David Kalnischkies [Fri, 29 Jul 2016 19:39:20 +0000 (21:39 +0200)]
if the FileFd failed already following calls should fail, too
There is no point in trying to perform Write/Read on a FileFd which
already failed as they aren't going to work as expected, so we should
make sure that they fail early on and hard.
David Kalnischkies [Wed, 27 Jul 2016 20:21:58 +0000 (22:21 +0200)]
(error) va_list 'args' was opened but not closed by va_end()
Reported-By: cppcheck
Gbp-Dch: Ignore
David Kalnischkies [Wed, 27 Jul 2016 15:58:51 +0000 (17:58 +0200)]
eipp: avoid producing file warnings in simulation
Simulations are frequently run by unprivileged users which naturally
don't have the permissions to write to the default location for the eipp
file. Either way is bad as running in simulation mode doesn't mean we
don't want to run the logging (as EIPP runs the same regardless of
simulation or 'real' run), but showing the warnings is relatively
pointless in the default setup, so, in case we would produce errors and
perform a simulation we will discard the warnings and carry on.
Running apt with an external planner wouldn't have generated these
messages btw.
Closes: 832614
David Kalnischkies [Wed, 27 Jul 2016 13:52:22 +0000 (15:52 +0200)]
rred: truncate result file before writing to it
If another file in the transaction fails and hence dooms the transaction
we can end in a situation in which a -patched file (= rred writes the
result of the patching to it) remains in the partial/ directory.
The next apt call will perform the rred patching again and write its
result again to the -patched file, but instead of starting with an empty
file as intended it will override the content previously in the file
which has the same result if the new content happens to be longer than
the old content, but if it isn't parts of the old content remain in the
file which will pass verification as the new content written to it
matches the hashes and if the entire transaction passes the file will be
moved the lists/ directory where it might or might not trigger errors
depending on if the old content which remained forms a valid file
together with the new content.
This has no real security implications as no untrusted data is involved:
The old content consists of a base file which passed verification and a
bunch of patches which all passed multiple verifications as well, so the
old content isn't controllable by an attacker and the new one isn't
either (as the new content alone passes verification). So the best an
attacker can do is letting the user run into the same issue as in the
report.
Closes: #831762
David Kalnischkies [Wed, 27 Jul 2016 11:25:18 +0000 (13:25 +0200)]
http: skip requesting if pipeline is full
The rewrite in
742f67eaede80d2f9b3631d8697ebd63b8f95427 is based on the
assumption that the pipeline will always be at least one item short each
time it is called, but the logs in #832113 suggest that this isn't
always the case. I fail to see how at the moment, but the old
implementation had this behavior, so restoring it can't really hurt, can
it?
David Kalnischkies [Wed, 27 Jul 2016 06:08:50 +0000 (08:08 +0200)]
use proper warning for automatic pipeline disable
Also fixes message itself to mention the correct option name as noticed
in #832113.
David Kalnischkies [Mon, 25 Jul 2016 22:01:50 +0000 (00:01 +0200)]
verify hash of input file in rred
We read the entire input file we want to patch anyhow, so we can also
calculate the hash for that file and compare it with what he had
expected it to be.
Note that this isn't really a security improvement as a) the file we
patch is trusted & b) if the input is incorrect, the result will hardly be
matching, so this is just for failing slightly earlier with a more
relevant error message (althrough, in terms of rred its ignored and
complete download attempt instead).
David Kalnischkies [Sat, 23 Jul 2016 13:24:46 +0000 (15:24 +0200)]
call flush on the wrapped writebuffered FileFd
The flush call is a no-op in most FileFd implementations so this isn't
as critical as it might sound as the only non-trivial implementation is
in the buffered writer, which tends not be used to buffer another
buffer…
David Kalnischkies [Sun, 10 Jul 2016 12:14:43 +0000 (14:14 +0200)]
report progress for triggered actions
APT doesn't know which packages will be triggered in the course of
actions, so it can't plan to see them for progress beforehand, but if it
sees that dpkg says that a package was triggered we can add additional
states. This is pretty much magic – after all it sets back the progress
– and there are cornercases in which this will result in incorrect
totals (package in partial states may or may not loose trigger states),
but the worst which can happen is that the progress is slightly
incorrect and doesn't reach 100%, but so be it. Better than being stuck
at 100% for a while as apt isn't realizing that a bunch of triggers
still need to be processed.
David Kalnischkies [Thu, 21 Jul 2016 13:54:22 +0000 (15:54 +0200)]
use a configurable location for apport report storage
Hardcoding /var/crash means we can't test it properly and it isn't
really our style.
David Kalnischkies [Thu, 21 Jul 2016 09:34:08 +0000 (11:34 +0200)]
report progress for removing while purging pkgs
The progress reporting for a package sheduled for purging only included
the states dpkg passes through while actually purging the package – if
the package was fully installed before dpkg will pass first through all
remove states before purging it, so in the interest of consistent
reporting our progress reporting should do that, too.
David Kalnischkies [Sun, 3 Jul 2016 21:09:04 +0000 (23:09 +0200)]
support dpkg debug mode in APT::StateChanges
Gbp-Dch: Ignore
David Kalnischkies [Fri, 22 Jul 2016 11:04:47 +0000 (13:04 +0200)]
create non-existent files in edit-sources with 644 instead of 640
If the sources file we want to edit doesn't exist yet GetLock will
create it with 640, which for a generic lockfile might be okay, but as
this is a sources file more relaxed permissions are in order – and
actually required as it wont be readable for unprivileged users causing
warnings/errors in apt calls.
Reported-By: J. Theede (musca) on IRC
David Kalnischkies [Fri, 22 Jul 2016 10:33:45 +0000 (12:33 +0200)]
report warnings&errors consistently in edit-sources
After editing the sources it is a good idea to (re)built the caches as
they will be out-of-date and doing so helps in reporting higherlevel
errors like duplicates sources.list entries, too, instead of just
general parsing errors as before.
Mert Dirik [Fri, 22 Jul 2016 08:54:49 +0000 (10:54 +0200)]
Turkish program translation update
Closes: 832039
David Kalnischkies [Wed, 20 Jul 2016 16:38:38 +0000 (18:38 +0200)]
tests: avoid time-dependent rebuild of caches
The tests changes the sources.list and the modification time of this
file is considered while figuring out if the cache can be good. Usually
this isn't an issue, but in that case we have the cache generation
produce warnings which appear twice in this case.
Gbp-Dch: Ignore
David Kalnischkies [Wed, 20 Jul 2016 16:09:46 +0000 (18:09 +0200)]
clean up default-stanzas from extended_states on write
The existing cleanup was happening only for packages which had a status
change (install -> uninstalled) which is the most frequent but no the
only case – you can e.g. set autobits explicitly with apt-mark.
This would leave stanzas in the states file declaring a package to be
manually installed – which is the default value for a package not listed
at all, so we can just as well drop it from the file.
David Kalnischkies [Wed, 20 Jul 2016 12:56:06 +0000 (14:56 +0200)]
tests: skip over -flags for first option in autotests
Otherwise calls like "apt -q install" end up calling "aptautotest_apt_q"
instead of "aptautotest_apt_install"
Gbp-Dch: Ignore
David Kalnischkies [Fri, 8 Jul 2016 13:59:23 +0000 (15:59 +0200)]
support "install ./foo.changes"
We support installing ./foo.deb (and ./foo.dsc for source) for a while
now, but it can be a bit clunky to work with those directly if you e.g.
build packages locally in a 'central' build-area.
The changes files also include hashsums and can be signed, so this can
also be considered an enhancement in terms of security as a user "just"
has to verify the signature on the changes file then rather than
checking all deb files individually in these manual installation
procedures.
David Kalnischkies [Wed, 20 Jul 2016 07:03:09 +0000 (09:03 +0200)]
allow arch=all to override No-Support-for-Architecture-all
If a user explicitly requests the download of arch:all apt shouldn't get
in the way and perform its detection dance if arch:all packages are
(also) in arch:any files or not.
This e.g. allows setting arch=all on a source with such a field (or one
which doesn't support all at all, but has the arch:all files like Debian
itself ATM) to get only the arch:all packages from there instead of
behaving like a no-op.
Reported-By: Helmut Grohne on IRC
David Kalnischkies [Tue, 19 Jul 2016 21:06:20 +0000 (23:06 +0200)]
refactor plus/minus sources.list option handling
Moving code around into some more dedicated methods, no effective code
change itself.
Gbp-Dch: Ignore
David Kalnischkies [Tue, 19 Jul 2016 16:20:38 +0000 (18:20 +0200)]
don't hardcode /var/lib/dpkg/status as dir::state::status
Theoretically it should be enough to change the Dir setting and have apt
pick the dpkg/status file from that. Also, it should be consistently
effected by RootDir. Both wasn't really the case through, so a user had
to explicitly set it too (or ignore it and have or not have expected
sideeffects caused by it).
This commit tries to guess better the location of the dpkg/status file
by setting dir::state::status to a naive "../dpkg/status", just that
this setting would be interpreted as relative to the CWD and not
relative to the dir::state directory. Also, the status file isn't really
relative to the state files apt has in /var/lib/apt/ as evident if we
consider that apt/ could be a symlink to someplace else and "../dpkg"
not effected by it, so what we do here is an explicit replace on apt/
– similar to how we create directories if it ends in apt/ – with dpkg/.
As this is a change it has the potential to cause regressions in so far
as the dpkg/status file of the "host" system is no longer used if you
set a "chroot" system via the Dir setting – but that tends to be
intended and causes people to painfully figure out that they had to set
this explicitly before, so that it now works more in terms of how the
other Dir settings work (aka "as expected"). If using the host status
file is really intended it is in fact easier to set this explicitely
compared to setting the new "magic" location explicitely.
David Kalnischkies [Tue, 19 Jul 2016 16:05:13 +0000 (18:05 +0200)]
ensure Cnf::FindFile doesn't return files below /dev/null
Very unlikely, but if the parent is /dev/null, the child empty and the
grandchild a value we returned /dev/null/value which doesn't exist, so
hardly a problem, but for best operability we should be consistent in
our work and return /dev/null always.
David Kalnischkies [Fri, 15 Jul 2016 19:17:11 +0000 (21:17 +0200)]
tests: activate dpkg multi-arch even if test is single arch
Most tests are either multiarch, do not care for the specific
architecture or do not interact with dpkg, so really effect by this is
only test-external-installation-planner-protocol, but its a general
issue that while APT can be told to treat any architecture as native
dpkg has the native architecture hardcoded so if we run tests we must
make sure that dpkg knows about the architecture we will treat as
"native" in apt as otherwise dpkg will refuse to install packages from
such an architecture.
This reverts
f883d2c3675eae2700e4cd1532c1a236cae69a4e as it complicates
the test slightly for no practical gain after the generic fix.
Julian Andres Klode [Fri, 15 Jul 2016 12:15:59 +0000 (14:15 +0200)]
Use native arch in test-external-installation-planner-protocol
Hardcoding amd64 broke the tests.
Julian Andres Klode [Fri, 8 Jul 2016 12:33:44 +0000 (14:33 +0200)]
Release 1.3~pre2
Yes, we might still add new features to 1.3 or break some more
stuff. Stay tuned!
David Kalnischkies [Fri, 8 Jul 2016 09:57:56 +0000 (11:57 +0200)]
tests: fix external solver/planner directory setup
The setup didn't prepare the directories as expected by newer version of
tthe external tests in an autopkgtests environment.
David Kalnischkies [Fri, 8 Jul 2016 09:49:36 +0000 (11:49 +0200)]
add Testsuite-Triggers to tagfile-order
Added in dpkg in commit
90324cfa942ba23d5d44b28b1087fbd510340502.
Andrew Patterson [Wed, 6 Jul 2016 19:40:16 +0000 (13:40 -0600)]
Add kernels with "+" in the package name to APT::NeverAutoRemove
Escape "+" in kernel package names when generating APT::NeverAutoRemove
list so it is not treated as a regular expression meta-character.
[Changed by David Kalnischkies: let test actually test the change]
Closes: #830159
Julian Andres Klode [Thu, 7 Jul 2016 18:38:00 +0000 (20:38 +0200)]
Release 1.3~pre1
Julian Andres Klode [Thu, 7 Jul 2016 18:20:44 +0000 (20:20 +0200)]
apt-key.8: Put (deprecated) into the term tag
Now post-build script should no longer complain...
Gbp-Dch: ignore
David Kalnischkies [Wed, 6 Jul 2016 12:49:39 +0000 (14:49 +0200)]
keep trying with next if connection to a SRV host failed
Instead of only trying the first host we get via SRV, we try them all as
we are supposed to and if that isn't working we try to connect to the
host itself as if we hadn't seen any SRV records. This was already the
intend of the old code, but it failed to hide earlier problems for the
next call, which would unconditionally fail then resulting in an all
around failure to connect. With proper stacking we can also keep the
error messages of each call around (and in the order tried) so if the
entire connection fails we can report all the things we have tried while
we discard the entire stack if something works out in the end.
David Kalnischkies [Wed, 6 Jul 2016 13:10:52 +0000 (15:10 +0200)]
report all instead of first error up the acquire chain
If we don't give a specific error to report up it is likely that all
error currently in the error stack are equally important, so reporting
just one could turn out to be confusing e.g. if name resolution failed
in a SRV record list.
David Kalnischkies [Tue, 5 Jul 2016 18:04:27 +0000 (20:04 +0200)]
don't change owner/perms/times through file:// symlinks
If we have files in partial/ from a previous invocation or similar such
those could be symlinks created by file:// sources. The code is
expecting only real files through and happily changes owner,
modification times and permission on the file the symlink points to
which tend to be files we have no business in touching in this way.
Permissions of symlinks shouldn't be changed, changing owner is usually
pointless to, but just to be sure we pick the easy way out and use
lchown, check for symlinks before chmod/utimes.
Reported-By: Mattia Rizzolo on IRC
David Kalnischkies [Tue, 5 Jul 2016 18:36:15 +0000 (20:36 +0200)]
tests: disable EIPP logging in test-compressed-indexes
The test makes heavy use of disabling compression types which are
usually available some way or another like xz which is how the EIPP
logs are compressed by default. Instead of changing this test to change
the filename according to the compression we want to test we just
disable EIPP logging for this test as that is easier and has the same
practical effect.
Gbp-Dch: Ignore