Age | Commit message (Collapse) | Author | Files | Lines |
|
When FIEMAP is not available try to use posix_fadvise() to request
the preloading of the .list files. A search with dpkg-query went
from 28 to 17 seconds, giving around 40% improvement.
Closes: #557560
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
When running dpkg from a cold cache on a system where <admindir>/info/
lies on a hard disk, a lot of time is spent waiting for seeks between
(typically) thousands of files. This patch changes the behavior of
ensure_allinstfiles_available(), so that it accesses the packages in
the order of their .list files' physical locations on the hard disk,
greatly reducing drive head movements.
The performance improvement is around 70% on my system: reinstalling
a simple package takes 8 seconds instead of 27 seconds. The caches were
dropped before each run, and 10 runs were done with consistent results.
The performance is identical to the previous patch using FIBMAP,
althought this one has the advantage of not needing root privileges.
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The current code sets the default context and does not clean it on
conffile extraction or in case of unpack error, which causes the wrong
context to be applied to files under <admindir>.
Switch the code to explicitly set the path context for newly extracted
and created files so that we don't need to care about unpack error
recovery or conffile extraction to restore the default context.
Refactor the code into a new function and remove an unneeded setting of
the context just before the rename from <node>.dpkg-new to <node>.
Closes: #498438
|
|
The code looks more balanced this way.
|
|
This is a cause of memory leaks, but in these cases the program is about
to exit anyway, so we do it for correctness.
|
|
Make trigh static and create an overrider function for it.
|
|
Make trig_new_deferred static and create a printer function for it.
|
|
Make trigdef static and create a setter function for it.
|
|
Remove now redudant database suffix from the function names.
|
|
When an error occurs during unpack the code is not securely removing
the newly installed files that might be still laying around, which
gives attackers a small window were they could hard link a file with
set id bits. This situation is pretty contrived as the attacked would
need to control the failing of the package during unpack.
|
|
The options are pretty useless and non-standard. The user can surely
cat a file from the installed package. In addition this option has not
worked ever on non-Debian systems as it's relying on the GPL-2 file
from the base-files Debian package. So remove it, and we get some code
reduction as a nice side-effect.
|
|
Those two functions are deprecated, produce warnings at link time,
and should not be used as they are cause of possible race conditions.
As a side effect we don't need to ensure the path is not existing as
mkdtemp has done that for us, which slightly simplifies the code.
|
|
The semantics of the pkq-queue module are more clear, so it makes the
code slightly easier to handle.
|
|
Put it close to the other alternatives file and directory handling.
|
|
Set DPKG_SHELL_REASON, DPKG_CONFFILE_OLD and DPKG_CONFFILE_NEW
environment variables when spawning a shell for conffile
examination, so that the user can easily use them for scripting, or
as easy mnemonics.
Suggested-by: Daniel Martin <Daniel.Martin@jhu.edu>
Closes: #60329
|
|
Stop supporting self backgrounding, remove DPKG_NO_TSTP environment
variable support, as we always spawn a shell now.
This will allow setting useful environment variables for the user to use
with other tools. And is less confusing, as the action to go back to
dpkg does not depend on how dpkg was run.
Closes: #38334
|
|
Renames:
struct lstitem → struct pkg_format_node
itemtype_t → enum pkg_format_type
alloclstitem() → pkg_format_node_new()
parseformat() → pkg_format_parse()
freeformat() → pkg_format_free()
show1package() → pkg_format_show()
|
|
Move declarations from dpkg-db.h to a new pkg-format.h, and rename
showpkg.c to pkg-format.c.
|
|
Triggered by https://bugs.maemo.org/show_bug.cgi?id=4103
|
|
|
|
This was making it confusing related to the parent bullets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove now unused macro.
|
|
|
|
|
|
|
|
The convention is for functions named free to deallocate the contents
and the given pointer, while this one only deallocates the contents, so
we rename it to make this distinction clear.
|
|
The convention is for functions named _free to deallocate the contents
and the given pointer, while this one only deallocates the contents, so
we rename it to make this distinction clear.
|
|
|
|
Use lower case names, and name members closer to the Unix functions
doing the same actions.
|
|
|
|
|
|
Also namespace cleanup function to subproc_fork_cleanup.
|
|
|
|
Instead of duplicating the code with chown calls when lchown is not
available, just map it with a macros.
|
|
|
|
The cleanup functions do not need a static variable when it's a pointer
and we pass its value to it.
|
|
Do not link against selinux on dpkg-deb, and do not link against the
compression libraries on dpkg.
|
|
Instead of hardcoding the usage of the pkginfo installed member,
pass it as an argument of a pointer to a struct pkginfoperfile, so
that we can choose what to show.
|
|
The only user of this field is in the dependency cycle detection,
only found under src/. So move it there where it belongs.
|
|
The last increment to argv was not being used, but instead the
increment, make it useful by checking if there's any additional
argument after the second, and bail out in that case.
This was spotted by a run with the clang static analyzer.
|
|
The safe_read function protects against interruptions and partial reads,
but not against other types of errors, for which we need to check the
return value.
This was spotted by a run with the clang static analyzer.
|
|
Initialize newargs to NULL now that oldargs is not there for the initial
value.
This was spotted by a run with the clang static analyzer.
|
|
This was spotted by a run with the clang static analyzer.
|
|
This was spotted by a run with the clang static analyzer.
|