Age | Commit message (Collapse) | Author | Files | Lines |
|
When the package has never been installed before, and the unpack has not
yet finished, the package will be present on the database but the files
list file will not, which would produce a bogus warning. Check if the
package has ever been configured, before printing the warning.
Closes: #673518
|
|
Closes: #552517
|
|
These functions have never belonged in the filesdb module, but were put
there temporarily for convenience.
|
|
|
|
This will guarantee there's never a time a call site can get NULL
from the function, and detangles it from the in-core filesdb
initialization.
|
|
|
|
|
|
|
|
|
|
|
|
The usage of the new layout is conditional to a prior database
upgrade that should write a version number greater than 0 in
<admindir>/info/format.
The file is parsed when needed from pkg_infodb_get_format().
Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org>
Patch-sponsored-by: Linaro Limited
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
This will be used for checksum generation at unpack time, and for shared
file verification.
|
|
Regression introduced in commit 0b8652b226a7601dfd71471797d15168a7337242.
Spotted-by: Raphaël Hertzog <hertzog@debian.org>
|
|
Replace pkg->set->name with varbuf_add_pkgbin_name(), pkgbin_name() or
pkg_name(). This only changes informative output, so no behaviour change
should result from this.
Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org>
Patch-sponsored-by: Linaro Limited
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
[hertzog@debian.org:
- Switch dselect method option file. ]
|
|
LP: #369898
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Although all users of replacingfilesandsaid are previously calling
clear_istobes() to make sure it's initialized, doing so when allocating
clientdata is safer from an API point of view.
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
Sponsored-by: Linaro Limited
Signed-off-by: Guillem Jover <guillem@debian.org>
|
|
The code does not do anything yet with this new argument, but it will
allow it to access the multiarch information, once the on-disk layout
is changed.
|
|
Remove now unused struct pkginfo name member.
|
|
This fixes two related issues when the FIGETBSZ ioctl fails, it avoids
a file descriptor leak because we can get the block size before the
loop, and avoids a segfault when sorting the package array due to the
cliendata possibly being NULL on some of the package entries because
we can bail out before performing the actual sorting.
We use the Linux specific statfs(2), because it does way less work than
statvfs(3) and the surrounding code is already non-portable due to its
dependency on FIEMAP.
LP: #872734
|
|
This makes it more natural to manage the directory names, and avoids
some doubled slashes.
|
|
This generalizes the function to exclude any desired file namenode
flag and not just fnnf_elide_other_lists. It also gets rid of the
bool variable which is generally a bad interface to change function
behaviour when it should really be a named flag or a mask.
|
|
The push_cleanup() call takes a pointer to the fd variable which resides
in the stack. In case of error and stack unwinding due to longjmp, the
value of fd might get overwritten by subsequent stack usage. Thus this
kind of variables need to be static so that their value cannot change
on stack rollback.
|
|
This should make it clear we are referring to a stdio stream, and not
the future planned ‘struct file’.
|
|
These functions are not really part of the modstatdb module, and by
moving them out they get detangled and will make it possible to extend
them w/o pulling additional code into binaries not using the functions.
|
|
This allows the strings to be terminated, thus printable or accessed
through the standard C string functions, and at the same time
appendable.
|
|
This simplifies the API, and unifies the different call sites, the
extremely small performance penalty is irrelevant in these cases.
|
|
|
|
Make the varbuf API a bit more consistent.
|
|
Make the varbuf API a bit more consistent.
|
|
Make the varbuf API a bit more consistent.
|
|
The latter is doing unneeded work. Switch to use a simpler but equally
functional variant.
|
|
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.
*/
|
|
|
|
Some of the singular forms are not currently used, but we keep them for
consistency, and to avoid confusing translators.
Closes: #594218
|
|
|
|
|
|
After creating, renaming or unlinking database files sync its
containing directory, to guarantee the new file entry is correctly
listed in the directory.
Closes: #567089
Base-on-patch-by: Jean-Baptiste Lallement <jeanbaptiste.lallement@gmail.com>
|
|
The callers should not be concerned about where the package info
directory is located, the new functions encapsulates the knowdlegde
in the dbmodify module.
|
|
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 only user of this field is in the dependency cycle detection,
only found under src/. So move it there where it belongs.
|
|
Add a missing “of the License” after “version 2”. Move “but” and “GNU”
at the end of line to the next line. This matches more closely the
paragraph found in the license text for the GPL version 2.
|
|
Use the <http://www.gnu.org/licenses/> URL, instead of in most cases
the outdated FSF address, which is way more stable, as the latter has
changed several times in the past.
|
|
Place first <config.h> and <compat.h>, then all <sys/*.h> sorted by
complexity, followed by the rest of the system headers, then <dpkg/*.h>
and finally the local "*.h" ones.
Move <dpkg/i18n.h> inclusion into libdpkg inclusion block, as the
<gettext.h> compatibility header already takes care of including
<locale.h> before <libintl.h> on environments were its probamatic.
Removed duplicated inclusions.
|
|
Introduced on commit 4985c686c30b2d0682aab0885d32c36007a7998d by me
while manually merging the patch that didn't apply cleanly on master.
Reported-by: Sean Finney <seanius@debian.org>
|
|
Added private function pkg_files_add_file for inserting a file to a
package's entries. The function takes a file_tail to avoid an O(n^2)
loop when adding to the end of the list. (This is what the original code
does, so I have mirrored its behavior.)
Signed-off-by: David Benjamin <davidben@mit.edu>
Signed-off-by: Guillem Jover <guillem@debian.org>
|