Age | Commit message (Collapse) | Author | Files | Lines |
|
Always set DPKG_ADMINDIR from dpkg so that all subprocesses inherit
the variable and there's no possible security risk from a user process
setting the variable to write onto a user controlled area.
As usual, the order in which the admindir value is overridden is the
following: built-in default, environment variable and command line
option.
Closes: #97076
Suggested-by: Brendan O'Dea <bod@debian.org>
|
|
The environment variable names are part of the exposed API, and as such
would need a transition plan in case of name change. Inline the macro
values to ease code reading.
|
|
|
|
The code was mixing usages of the argument ver, with printing from
pkg->available.version, which is rather confusing. Just use the
available and installed pkg members instead.
This also will guarantee we'll never get a NULL version.
|
|
There's just one caller and it always requests to say why we are
installing. So remove this unneeded logic.
|
|
|
|
|
|
|
|
When the string is only created once, used several times and then
freed, there's no much point in using a varbuf instead of the simpler
m_asprintf(). The former needs more state and makes using the string
slightly more cumbersome. Using m_asprintf() should be slightly faster
too, but not significantly enough to justify this change by itself.
|
|
This is way more compact, the strings are for temporary values, and the
minimal possible performance difference does not matter here.
|
|
This avoid the need to know the resulting string length beforehand, and
makes sure it's always going to get the right size. It also makes the
code way clearer.
|
|
Make the varbuf API a bit more consistent.
|
|
Make the varbuf API a bit more consistent.
|
|
Make the varbuf API a bit more consistent.
|
|
Make the varbuf API a bit more consistent.
|
|
Make the varbuf API a bit more consistent.
|
|
Make the varbuf API a bit more consistent.
|
|
Using sync() on unpack causes _all_ filesystems to be sync'd, which is
not so great when one of those is a thumb drive, mounted over a network,
or otherwise slow. Remove the sync-instead-of-fsync codepath due to
those side-effects and to simplify maintenance.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The options were not taking effect as they were only being applied to
installed packages, while the first stage usually implies unpacking
and then configuring in a later stage. Which implies having those
packages going from installed to unpacked, and then skipping any of
the checks requested by the user on subsequently processed packages.
Closes: #31141
|
|
Add an accessor function to be able to replace the old warn counters
in the rest of the code.
|
|
|
|
The latter is doing unneeded work. Switch to use a simpler but equally
functional variant.
|
|
|
|
It's not really needed for dpkg correct operation.
|
|
Closes: #604914
Suggested-by: Andrei Popescu <andreimpopescu@gmail.com>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Reported-by: Andrei Popescu <andreimpopescu@gmail.com>
|
|
The shorter form is unambiguous and takes less screen size.
|
|
|
|
|
|
Conflicts:
debian/changelog
dselect/po/es.po
po/es.po
po/pt.po
scripts/po/es.po
src/archives.c
|
|
The code was only printing a delimiting new line on the second to last
stanza. Invert the logic and do it always except on the last one.
Closes: #606315
|
|
Use the posix_fadvise(POSIX_FADV_DONTNEED) hint to notify the kernel
dpkg does not need the unpacked files any longer and as such it can
start writeback asynchronously.
Although POSIX does not explicitly say so, and this is merely a hint,
this is the only sensible thing to do for the kernel. On Linux at least
it also evicts the pages if they are not currently under writeback,
locked or dirty, which might be undesired if a maintainer script has
to use the data, but unlikely as the writeback will still be ongoing
if it started at all.
In addition it could be argued the Linux implementation is not optimal
as the standard talks about the application not needing the data any
longer, not the system. So it seems the NetBSD implementation which
just marks the pages as not active would be more correct.
|
|
The second sync_file_range() call, with the operation
SYNC_FILE_RANGE_WAIT_BEFORE, will block until the previously
initiated writeback has completed.
We finish the writeback for all files before calling fsync. This
basically ensures that the delayed allocation has been resolved;
that is, the data blocks have been allocated and written, and the
inode updated (in memory), but not necessarily pushed out to disk.
So that later fsync can become no-ops, minimizing the number of
(costly) jbd2 commits.
Suggested-by: Ted Ts'o <tytso@mit.edu>
Based-on-patch-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
To avoid performance degradation on filesystems with "allocate on
flush" semantics (like xfs, ubifs, hfs+, and ext4 without nodelalloc),
start writing back each file once it has finished being extracted.
This doesn't actually wait for the write to finish; it just starts
the writeback.
The sync_file_range() call has been available since Linux 2.6.17.
On non-Linux systems we can skip it.
Closes: #605009
Suggested-by: Ted Ts'o <tytso@mit.edu>
Based-on-patch-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The broken symlinks are particularly pernicious as they imply a shared
library SONAME path might point to nowhere and thus applications will
fail to get dynamically linked.
Deferring symlinks is safe as they are always at the end of the tar
archive, and they are processed last on deferred renames as they are
appended at the end of the new list files.
Closes: #605536
|
|
Conflicts:
debian/changelog
m4/dpkg-funcs.m4
man/dpkg.1
|
|
This allows to not perform file system syncs before file renames
to guarantee its atomicity, which is known to cause substantial
performance degradation on some file systems, unfortunately the ones
that require the safe I/O on the first place due to their unreliable
behaviour causing zero-length files on abrupt system crashes (sudden
reboot, bus locks, pulling the plug, etc).
Using this option might improve performance at the cost of losing
data, and should thus be used with care, but that's ultimately
something for the user of the affected file systems to decide.
Closes: #584254
|
|
It causes undesired I/O on unrelated file systems. It also makes the
code behave differently on Linux systems.
Allow the possibility to enable it again for the benefit of downstreams,
which might want to use it regardless of its problems. Although this
code path will most probably be removed in the near future.
Closes: #588339, #595927, #600075
|
|
This option works in a similar way to --status-fd, the main difference
is that we invoke the provided command and pass the status information
to its standard input instead.
Suggested-by: Raphaël Hertzog <hertzog@debian.org>
|
|
|
|
|
|
Instead of cryptic literal integers use named enums.
|
|
Instead of cryptic literal integers use named enums.
|
|
Instead of cryptic literal integers use named enums.
|
|
|
|
Remove trailing spaces. Remove blank lines not separating different code
blocks. Remove blank lines at the end of the file.
|
|
Global review, which includes the following changes to try to increase
consistency, update and improve the source code comments:
- Spelling fixes.
- Use American English forms.
- Uppercase NULL, NUL and ASCII.
- Use “Note: ” instead of the slightly cryptic “NB: ” form.
- Write comments as proper sentences, including capitalizations and
ending dots.
- Move comments before the code, function or variable they refer to.
- Move general function comments outside the body.
- Convert function and variable description comments to doxygen.
- Use one space before dot, exclamation and question marks.
- Use ‘’ or “” instead of `' style quoting.
- Remove author names from comments, already visible from “git blame”.
- Mark strings for translators with “TRANSLATORS: ”.
- Remove useless or outdated comments.
- Fix comment indentation.
- Standardize comment format:
/* Short text comment. */
/* Long text,
* comment. */
/*
* Section text.
*/
|
|
Remove now unused warnto from parsedb_stat struct.
|
|
|
|
|