Age | Commit message (Collapse) | Author | Files | Lines |
|
If a statoverride gets removed in a maintainer script, it will not be
reflected on the database until after the current dpkg process has been
restarted. So we need to reset the statoverride information whenever we
are going to reload the statoverride database.
|
|
|
|
The database files must be kept open during an entire dpkg run, because
we need to check if the files have changed, and rely on the inode number,
which could get eagerly reused by the filesystem if these files get
replaced multiple times in maintainer scripts.
Add a code comment explaining the rationale, so that this does not happen
again in the future.
This partially reverts commit 579b90b61b24a538cf1709d7ceda0b38fec631b3.
Closes: #731524
|
|
|
|
This fixes several related issues. The list of conflictors has always
really been a queue, where packages were added and then acted on,
although no package was removed from the list after being processed,
which in turn made subsequent conflictors accumulate and reach the
arbitrary limit due to previous unrelated Conflicts/Replaces pairs,
giving possibly very confusing error messages due to that.
Another theoretical problem is that because the list was not cleaned up
after processing it, a package could have been enqueued to be removed,
then a newer version reinstalled which could get removed again on a
subsequent package processing, being it on the list.
Closes: #726112
|
|
Fixes InputOutput::RequireBracedFileHandleWithPrint.
Warned-by: perlcritic
|
|
Fixes InputOutput::RequireCheckedOpen.
Warned-by: perlcritic
|
|
Properly reset the pkg_prev pointer for each file iteration, by moving
the variable declaration inside the loop.
Regression introduced in commit a2ee7d0bb4d56afb82438f09a50251acfa690643.
Reported-by: Raphaël Hertzog <hertzog@debian.org>
|
|
The verify_output function pointer was not initialized, and if the user
did not specify --verify-output the program would segfault.
Reported-by: Raphaël Hertzog <hertzog@debian.org>
|
|
Move the ensure_diversions debug progress message just before the
function call, to make this less confusing.
|
|
Fold post_postinst_tasks_core() into post_postinst_tasks(), and replace
open-coded implementation in trigproc().
|
|
Pass the modstatdb status value used when opening the database, instead
of hardcoding msdbrw_write to trig_incorporate() calls, and avoiding
calling them on --no-act.
|
|
|
|
Switch all program to use the new function instead of open-coding it.
|
|
|
|
|
|
|
|
This will allow passing any other data to the printer callback beside
a string.
|
|
|
|
There's no point in keeping the files open across subsequent calls,
when the only thing we want to know is if the new file is the same as
the old one, just preserve the stat information for that. With this we
do no longer need to set the close-on-exec bit either.
|
|
Do not proceed within the function if we cannot open the current
database because it does not exist and we opened it before. This
will only get us to read garbage from memory or segfault.
Warned-by: clang static analyzer
|
|
Name them as stab_prev and stab_next to denote the previous and next
database file to read.
|
|
There's no point in reallocating these on every function invocation,
if in the future we need to change the paths between calls, then the
function can be reworked to take a pathname for example.
|
|
There's no actual behavior change with this, but it makes the code
clearer and squashes a warning.
Warned-by: clang static analyzer
|
|
Warned-by: clang static analyzer
|
|
Using a list of package arrays waste at least 10 pointers per path that
is not shared by multiple packages, which adds up to significant amount
with lots of installed paths and 64-bit pointers.
Also the new waste we get from each pkg_list node for each shared file is
really minor, as the common thing is for num. paths >>> num. packages.
|
|
This should help people diagnose problems by providing more context on
what's going on by being explicit about what packages is being handled.
|
|
Unifies the output, makes it symmetric in case of upgrade or new install
by always printing two messages, properly shows from what version we
are upgrading to which one, and some cases of cross-grading.
Closes: #32427, #71106
|
|
For now this checks that the files have not been modified by computing
and comparing their md5sum hashes against the ones in the database.
The only currently supported output format will try to mimick the one
from «rpm --verify», but the default might change in the future in case
it is found cumbersome or lacking, and as such programs parsing the
command output should be explicit about the format they want.
Closes: #187019
|
|
|
|
|
|
|
|
|
|
These will perform any necessary action when starting and exiting a
dpkg-based program.
|
|
|
|
When cropping strings, possibly multibyte ones, take into account that
there's three different counts to be considered, the number of
characters to display, their screen width and the number of bytes they
take on the multibyte string.
Closes: #257505, #718541
Based-on-patch-by: Changwoo Ryu <cwryu@debian.org>
|
|
|
|
Activate them only when we know we are inevitably removing things.
|
|
Because directory processing might get skipped on removal (contrary to
unpack), as they might be shared with other packages, some file triggers
will not get activated as the code was changed to do more optimal
activation. The problem is that the removed paths need to activate all
parent paths to be effective.
Regression introduced in commit 65ade6390b47fe3ec6a0e2ba341f3d553bf4bbc6.
Closes: #725437
|
|
|
|
Because we've taken out the package from the queue, and acted on it, by
way of ignoring it, we need to consider that progress when processing
the queue, otherwise for huge amount of requests the decreasing queue
length at some point will be shorter than the amount of packages that
have not supposedly progressed.
Closes: #143307
|
|
|
|
|
|
|
|
The new variable DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT will contain the
number of package instances with a state grater than not-installed.
This should allow packages to easily perform actions on the first
instance installed or the last instance removed, for example.
Closes: #681370
|
|
The debug() function automatically appends a newline, no need to
duplicate it.
|
|
Instead of trying to implement automatic word-wrapping, which is really
tricky when having to take into account wide characters, and locales
supporting things like combining characters, or special rules for when
to word-wrap, just take the easy way out, and require a newline
character to know when to wrap the line.
|
|
|
|
Do not leave the «.dpkg-divert.tmp» temporary file around if the file
copy failed for any reason.
|
|
Suggested-by: Ma Xiaojun <damage3025@gmail.com>
|