Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Do not flush the output on each entry output, instead wait until we have
finished to flush it all out. This should speed up the output.
|
|
Fixes: commit 44b0bf1a576e3b0cfcb4c87f18d4195c3ffccb8f
|
|
The current code, checks whether we are running on a terminal, and then
truncates the output fields so that it can fit within. This causes data
loss and can confuse the user depending where the cut point has happened.
Instead we remove that logic, and always redirect the outout through a
pager in case we are running on a terminal, which gives full information
and does not necessarily emit ugly output.
Closes: #898603
|
|
Use it instead of open-coding it, or piping it via a shell invocation,
which required metacharacter escaping.
|
|
We also namespace the pager function with the module name.
|
|
|
|
We separate the function in one that takes one callback, and another
that takes two. This simplifies most of the call sites which only need
one callback.
|
|
We only need the device and inode numbers for a given file to be able to
compare them for identity. Avoid storing the entire struct stat which is
rather fat.
|
|
This will prepare the ground for external programs to start using
libdpkg to access the dpkg fsys database via a proper API, instead
of messing with the on-disk layout in so many improper ways.
|
|
This is not really part of the fsys db handling, and we are not
making use of it anymore in it, so let's move it somewhere else
more appropriate.
|
|
This will make it possible to move the fsys database parsing and dumping
code out from dpkg into libdpkg.
This is general package information, even if some clients might not be
interested in its contents, such as frontends that just manage metadata
and drive dpkg itself.
|
|
For functions that are supposed to just check the state of a package in
a read-only way, make sure the clientdata is allocated, instead of just
calling ensure_package_clientdata().
|
|
We want to stop calling this function from the fsys loading code, so we
should make very sure it is being called before we access the clientdata
members, otherwise we'll just segfault.
|
|
Rename matching types and macros, so that the purpose of the symbols
is clear, and to open the way for moving the fsys files list from the
dpkg clientdata.
|
|
The condition is checking for the same multiple times.
Warned-by: cppcheck
|
|
This unifies the term with the rest of the codebase, and makes it more
descriptive.
|
|
We should implement a whitelist here, instead of a blacklist. Not all
ELF based libc do have a ldconfig command.
|
|
Several code paths assumed that the fsys nodes were only present when
they contained diversions, and no other nodes would be present, thus
did not make sure to check whether the divert struct members were valid.
With the switch to a single fsys underlying implementation now triggers
can vivify namenodes in the hash, so we need to check whether the members
are valid all the time.
Fixes: commit 2d7566140335d5338e5a98278d4df762936f67f4
Reported-by: Sven Joachim <svenjoac@gmx.de>
Bisected-by: Sven Joachim <svenjoac@gmx.de>
|
|
Make these variables more discoverable by printing them as a list
before spawning the conffile shell.
|
|
Warned-by: coverity
|
|
This continues the work to generalize and make these interfaces
available to other users beside dpkg itself.
|
|
The struct filenamenode hash implementation is lightweight, and once
split from the bulk of the on-disk database handling there's no point
in reimplementing it, and then redefining the same struct in multiple
places, which is rather confusing for the reader, and even for static
analyzers.
Closes: #746766
|
|
|
|
Renaming a file from dpkg-divert for an Essential package is very
dangerous, because that file will not be available until dpkg has
unpacked the diverting package, which might render the system
non-functional.
|
|
Using --no-rename as the default optimizes for the wrong case, as that's
the exception, and while the safest option, it is needed only by packages
that are part of the pseudo-Essential set. It's also cumbersome for the
--local case.
We will emit a warning asking those to be explicit, so that we can switch
the default to --rename during the 1.20.x cycle.
Prompted-by: Paul Wise <pabs@debian.org>
|
|
Document its intended usage and how it differs from --rename.
This will make it possible to do a behavior switch during the 1.20.x
release cycle.
|
|
This will be needed when moving the fsys hash implementation into
libdpkg.
|
|
|
|
The problem with assert() is that it does not print the contents of
the variables. It also can be disabled on NDEBUG. But we always want
these consistency checks no matter what, and they are not performance
sensitive anyway.
Enable -Wno-nonnull-compare so that we can keep doing run-time non-NULL
checks in functions, instead of just compile-time checks.
|
|
This is a run-time error, not a programming error.
|
|
When the package is not known, we do an early skip to the next loop
iteration, but forgot to increment the line number, which means that
these will be off.
Closes: #888983
Reported-by: Heinz Repp <heinz.repp@arcor.de>
|
|
When processing an archive or a package, we can call maintainer script
for other packages. Not printing the package name for the script that
failed means we can get very confusing output.
Closes: #877521
|
|
The code in charge of inferring the digest for a conffile was
checking the owning package status twice, and ignoring conffiles
with a status lower than "unpacked" even if they had been configured
previously and their md5sums were valid.
This was causing bogus takeover unpack errors.
Fixes: commit 05a8ddb482419d110571679a29bcd25e3c2b036d
Closes: #861217
Stable-Candidate: 1.17.x
|
|
The current code was trying to stat(2) a conffile without taking into
account a specified root directory, nor any possible diversions.
But the check based on the device and inode was pretty much unnecessary
because a simple string comparison is enough here, which as a bogus
solves both problems by reducing the code size.
Closes: #837051, #858004
Stable-Candidate: 1.17.x
|
|
Spotted-by: Josh Soref <jsoref@gmail.com>
|
|
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Warned-by: gcc-7
|
|
Warned-by: codespell, spellintian
|
|
Some bogus filesystems do not return the actual symlink size in st_size,
which contradicts POSIX. But allowing the case where the returned size
is smaller than the one used to allocate memory is harmless, although
suspect. Let it through, but still print a warning so that users can
install stuff but are reminded they need to get a fixed filesystem in
place.
This has affected at least ecryptfs in the past and now file-based
encryption support in ext4 on Android N.
Reported-by: Jay Freeman <saurik@saurik.com>
|
|
These commands make it possible to test if several of those <thing>s
have a valid syntax. The current list of supported things is «pkgname»,
«trigname», «archname» and «version».
|
|
|
|
We are releasing the dpkg database now after running the commands, which
means that the postponed error reporting summary was trying to print
messages that had already been freed from the database memory pool.
Duplicate the passed strings so that we are impervious to the database
life-cycle.
Regression introduced in commit 3404fd24ef8020b4d6dc17adb82d7e6c035d90dc.
Closes: #843874
|
|
Mention that the package cannot be found on the status nor available
database, and that to the FAQ.
Closes: #842230
|
|
We print “Removing <package> (<version>)” lines and log remove action
twice when purging a package from frontends, because they usually first
call --remove and then --purge sequentially. When purging a package
which is already in config-files (i.e. it has been removed before),
do not print nor log the remove action.
|
|
Warned-by: clang
|
|
|
|
|
|
The dpkg_options_parse() call modifies the argv argument which means
that if we try to free it later on or realloc it we will crash.
|
|
Otherwise we'll crash in commandfd.
|