Age | Commit message (Collapse) | Author | Files | Lines |
|
This was done in the name of security, but it does not make much sense
as root should make sure to be running in a clean environment. This is
problematic as it makes the interface hard to understand, and produces
unexpected behavior as dpkg can be called from within itself, or as a
wrapper for dpkg-query, which will then not inherit the admindir value.
Closes: #900071
|
|
A package marked to be on hold, denotes that the package should be kept
in its current version and should not be automatically installed, upgraded
or removed. The same applies to frontends. This behavior does not apply
when the user explicitly requested one of these actions, or the
--force-hold option is used.
It should never prevent dpkg from processing these for configuration (if
they were already in unpacked state) or from trigger processing, otherwise
we might get into trigger loops. Some of the code was already doing this,
but this was not consistently done. We update also the help output and
documentation to clarify the fixed behavior.
Closes: #926472
|
|
When we have been requested to load the available file, and that
contains a description for a package that is not installed, we should
use that instead of printing the confusing string stating that the
description is not available.
Closes: #43573
|
|
Warned-by: sparse
|
|
The preceding “if” already checks exclusively whether this variable
is NULL, so in this branch it will always be non-NULL.
Warned-by: cppcheck
Fixes: knownConditionTrueFalse
|
|
The output on log files must not be localized.
Reported-by: Julien Cristau <jcristau@debian.org>
|
|
This will make it possible to select either the current locale or a
specified one, currently only C is selectable.
We use this because the uselocale(3) POSIX API is recent, and the system
might not have it available, so we might need to fallback to use
setlocale(3) instead, which even though is not thread-safe, it's better
than nothing.
|
|
We only use this variable as a sentinel pointer so that we can make
sure the pdep pointer is not NULL in subsequent checks. But cppcheck
gets confused, so let's initialize it to make the code more
future-proof.
Warned-by: cppcheck
|
|
We should not clear the selections for packages that are not already
installed in the system, as they will end up disappearing on the next
operation anyway.
Closes: #927752
|
|
This new dependtry level will also check trigger cycles on trigger
process deferral due to unsatisfiable dependencies.
Closes: #928429
|
|
Otherwise we incorrectly override them.
Fixes: commit 52427d9075b4b062fa0db16a70d2c2bda6407857
Closes: #928671
|
|
The code checking whether the amount of errors had been reached, was
incrementing the counter after the check, which meant it was allowing
one more error than expected.
[guillem@debian.org: Move return to the next line. ]
Closes: #924886
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
There were several error messages involving the dpkg database, that were
ambiguous by referring to it as "dpkg status area", instead of printing
the affected pathname. The historical reason for not being more explicit
has been to keep the user a bit under the dark, because this has been an
internal database storage, and only those in the known would go there to
edit it by hand and similar.
This is a bit pointless though, because the Internet is full of
references to those directories, and other error messages just print
them anyway.
In addition, for users that want to diagnose what is the problem this is
not helpful, and the directory might have been changed at build or run
time with one of the options.
Closes: #883700
|
|
This new option works in both dpkg and dpkg-statoverride. And dpkg will
pass it to its children, which means dpkg-statoverride called from a
maintainer script will automatically pick it up.
Ref: #811037
|
|
Deprecate --force option which will be considered an alias for
--force-all for now.
|
|
|
|
This will make it possible for third-party tools, and also for other
dpkg tools to have access to the force options specified for dpkg.
Closes: #666147
|
|
|
|
|
|
This makes it easier to generalize to be used by other modules with
different force options, and to operate on the force options.
|
|
This will make it possible to reason more easily about what is
getting enabled.
|
|
We will be using the same logic for other commands.
|
|
This unifies all force related code in a single file, and will make it
possible to use it in other programs.
|
|
We do not really need to normalize the return code, which was confusing
the cppcheck for which we required a supression.
|
|
The wrapper function should be generic, so leaking this SELinux specific
detail there is just wrong.
|
|
This makes the tar extractor track and report back parse errors, so that
we can give more descriptive messages.
|
|
These are handling a package hash, and db seems to imply some kind of
on-disk storage. Rename the pkgiterator too to pkg_hash_iter to make it
consistent.
|
|
|
|
|
|
This makes it easier to guarantee we use the correct size for the
involved variable.
|
|
Warned-by: cppcheck
|
|
|
|
|
|
The introduction of dependency satisfiability for trigger processing,
which was in the original spec but not the implementation, there has
been countless problems with bogus detection of trigger cycles.
The problem is that whenever we try to process triggers for a package,
we might not be able to due to dependency unsatisfiaiblity, which means
we have to put the package back into the queue. If we add the state into
the cycle detection tracker, then multiple visits to these packages will
hit the cycle detection for artificially generated cycles. But we cannot
avoid performing the checks because that will miss dynamic cycles coming
from maintainer scripts, for example.
To avoid most of these problems (while possibly not fixing all potential
ones), we should delay trigger processsing entirely until we have
emptied the processing queue as much as possible. We do that by
introducing a new dependency try level, after the dependency cycle
breaking one.
We will also make the trigger cycle detection unconditional of the
dependency try, because for the trigproc try-queued it will not matter
anymore as we will only ented on higher dependency tries, and for the
other trigproc types we should not care about any queue-specific
dependency try level.
Closes: #810724, #854478, #911620
|
|
We should only reset the cycle detection in case we are not bailing out
from the processing with an error, otherwise we could come back to this
package and detect an artificial trigger cycle.
|
|
This makes the code stop skipping unsatisfiable dependency checks.
|
|
Each of these reasons for processing triggers have different requirements
and attributes:
- The required one, must perform all checks as it is done as part of a
simple loop to guarantee Pre-Depends satisfiability.
- The try-deferred one, must not fail on unsatisfiable dependencies, as
we are doing opportunistic trigger processing, after a normal
processing queue run.
- The try-queued one, must perform all checks and fail hard if any
unsatisfiable scenario occurs.
|
|
We should not leave the package that could be used to make progress by
way of trigger processing in this variable, because it might not have
its dependencies satisfied, which means we'll be trying to process it on
every next loop, and get into artificialy detected trigger cycles.
|
|
This moves the description closer to the type defining its values, which
makes more sense than in the configure function.
|
|
Thiw makes the code way easier to understand as there no magic numbers
anymore. It will also make it trivial to add new levels in-between.
|
|
Once we are giving up on a package that we will stop processing, we need
to mark it as PKG_ISTOBE_NORMAL so that the dependency checks know they
cannot expect this package to be processed anymore. Otherwise we might
end up never detecting that we are not making progress, as we expect to
process this package at a later point, when that will never happen
anymore. This then would end up causing asserts in the process queue
loop.
Closes: #901127, #910819
|
|
|
|
Assign hare->next to hare instead of using the temporary variable, so
that it's quicker to spot as an iterator assignment.
|
|
Initialize the next member when we are allocating the struct.
|
|
Makes its usage more obvious.
|
|
This makes it possible to disable any pager usage from these programs.
For dpkg this also becomes a configuration option.
Closes: #909754
|
|
Let's just handle opening the file and passing its data to the pager
ourselves, as that gives us more control, and then can decide not to
run a pager at all, and do not need to mess with arguments which might
need to be passed to «sh -c».
|
|
This makes it possible to use alternative installation directories.
And will make these commands honor those directories when specified
for dpkg, and passed down to the maintainer script via the DPKG_ROOT
environment variable.
|
|
Ignore EPERM for chown and chmod based syscalls. And give a more
meaningful error message on chroot().
Closes: #614126
|
|
When not passing any argument these commands will dump the entire
database. This way external programs will have a proper public
interface to get all package records, even when there are unmerged
journal entries.
Closes: #616342
|