Age | Commit message (Collapse) | Author | Files | Lines |
|
This clarifies the purpose of the file related to the dpkg action to
perform.
|
|
Document this in the man page, and warn whenever we find unknown
packages during the --set-selections processing.
Closes: #703092
|
|
Fixes RegularExpressions::ProhibitUnusualDelimiters.
Warned-by: perlcritic
|
|
Do not read each line to then join it, just switch on slurp mode and
do it in one go. Use the newly created function file_slurp.
Fixes InputOutput::ProhibitJoinedReadline.
Warned-by: perlcritic
|
|
Fixes ControlStructures::ProhibitCStyleForLoops.
Warned-by: perlcritic
|
|
Using double-quotes imposes a small performance penalty as the perl
parser needs to check if any interpolation is needed. Use double-quotes
only when the string contains single-quotes. Ideally we'd use
double-quotes too for escaped meta-characters that might otherwise be
confusing to immediately see if they need interpolation or not, but the
policy does not (currently) allow to ignore these.
Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals.
Warned-by: perlcritic
|
|
Addresses ValuesAndExpressions::ProhibitInterpolationOfLiterals.
Warned-by: perlcritic
|
|
Fixes Subroutines::ProhibitReturnSort.
Warned-by: perlcritic
|
|
Fixes InputOutput::ProhibitBarewordFileHandles.
Warned-by: perlcritic
|
|
Fixes InputOutput::ProhibitTwoArgOpen.
Warned-by: perlcritic
|
|
|
|
This makes the HEREDOC quoting-style used explicit, so that it's obvious
if the code text will get interpolated or not.
Fixes ValuesAndExpressions::RequireQuotedHeredocTerminator.
Warned-by: perlcritic
|
|
This marks all these files as script files, so that tools like
perlcritic do not misrecognize them as modules.
|
|
|
|
These just clutter the code base, as adding modelines for each possible
editor out there does not scale, and they are currently not exhaustive
anyway.
|
|
|
|
|
|
This should give maintainer scripts a more stable and sane environment.
This change does not work too well with relative admindir paths, as they
need to be normalized on input. But then several dpkg tools do not play
nice with relative amindirs anyway, and this needs a general cleanup
which will be done on subsequent commits.
Closes: #686782
|
|
Activate them only when we know we are inevitably removing things.
|
|
Clean them up only when we are definitely removing the main path.
|
|
Move pkg_set_want() call from wanttoinstall() to the call site in
process_archive(), so that the status-want change affects all ‘true’
return values and not just on “selecting previously unselected package”.
This also makes wanttoinstall() a function that just performs a decision
without acting on it, matching its name.
Closes: #162541
|
|
Move pkg_set_want() and modstatdb_note() calls from deferred_remove()
to the beginning of the function so that it affects all remove/purge
requests, even if it ends up getting ignored so that we can properly
update the wanted status.
Do not try to set the want status for packages with want_unknown.
Closes: #163763
|
|
Move the modstatdb_note() inside the !f_pending conditional where
the want status is being changed, there's no point in always calling
this function afterwards if there's been no status change at all.
|
|
This moves the calls near where the package status is being changed,
and makes it obvious that we are creating an update log entry.
|
|
Try to create a new execution context based on the current one and the
specific maintainer script filename. If it is the same as the current
one, use "dpkg_script_t" as a fallback.
The maintscript_set_exec_context() function is heavily based on the
libselinux rpm_execcon() function, which is licensed as Public Domain.
|
|
Rework the code to use the selabel API instead of the matchpathcon
wrappers, so that we can query if the label database has changed
during the previous unpack, for example while upgrading the SELinux
policy package. This also allows us to more easily free the resources
allocated for the label database.
|
|
The selabel_file(5) man page clearly states that the function may never
return such context, so do not check for it.
|
|
Print a description even for empty or missing architectures, to ensure
the column is always filled.
|
|
This clarifies the term removing the need to mention what file actually
refers to. And gets rid of a first person usage.
|
|
|
|
The new file was accidentally introduced with old-style indentation.
|
|
|
|
|
|
|
|
Not setting the correct security context for a new file might have
security implications. If the operation is supported by the system
on such path and it fails, abort instead of just printing an error
message and continuing as if nothing happened.
|
|
The architecture restrictions were not being considered on package
configuration and removal, which would cause a system to end up in
broken states. Refuse to get into those states.
Closes: #683411
|
|
Make sure to always read the format file whenever we are about to access
the info database, so that we can verify that we understand the format,
and bail out otherwise.
This fixes a currently possible info database corruption and bogus
access, whenever the format is lower than 0 or higher than the last
understood one, and makes the info database code future-proof in case
new actual formats get introduced.
|
|
When checking for the validity of the Conffiles database field, do not
just assume that a package that is just in stat_unpacked has never
before been configured. Instead check if the last configured version
is the same as the currently extracted version, which will mean the
values in the Conffiles field are valid.
Closes: #684776
|
|
When configuring the second and subsequent package instances with
conffiles, the *.dpkg-new conffiles will have been already handled by
the first instance. As such, whenever the *.dpkg-new file is missing,
copy the hash from an already processed instance.
|
|
This ensures that when taking over conffiles from another package
the obsolete conffiles are marked as such on the other package.
|
|
This ensures conffile entries are not misshandled nor mixed up when
configuring packages owning the non-obsolete conffiles. Otherwise we
end up with bogus entries in the database, which could cause unpack
failures, leftover directories on removal or wrong processing of
conffiles.
Closes: #689836
Based-on-patch-by: Andreas Beckmann <debian@abeckmann.de>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
This will allow to insert other actions before the check, and still
managing to execute them on each iteration.
|
|
This check is already covered by comparing if they are part of the same
package set. As the fileslistvalid check needs to be moved just before
the write_filelist_except() call to be able to insert actions into the
loop that get executed on each iteration, this test there would be too
late by then, and keeping it standalone does not make much sense, so
let's just remove it right away to make the refactoring smoother.
|
|
The code was not matching directories on subpatterns due to trailing
slashes, which was causing unpack failures as the containing
subdirectories were not being unpacked and as such, they were
subsequently missing from the file system.
While unpacking a «/usr/share/locale/de/LC_MESSAGES/foo.mo» file,
for example, something like the following options would trigger
this problem:
--path-exclude=/usr/share/locale/*
--path-include=/usr/share/locale/de/*
Closes: #688416
|
|
Use a string precision instead of a field width, which was causing the
output to be just blanks with the length of the subpattern.
|
|
The variable was being initialized after the debug statement, and if
there was no NUL terminator the code could access out of bounds memory.
|
|
Free the filepackages_iterator also when returning false.
|
|
Remove variables set by dpkg which affect the dpkg-divert behaviour,
and as such make it unreliable and cause test failures.
Closes: #687656
|
|
Closes: #686995
|
|
Reported-by: Sven Joachim <svenjoac@gmx.de>
|