summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2011-05-15dpkg: Add debug output on match in dir_is_used_by_others()Guillem Jover1-0/+2
The debug output was not balanced, and was only printing when no match happened, making the output confusing.
2011-05-14dpkg: improve pre-dependency check on unpackRaphaël Hertzog1-7/+13
When a pre-dependency is not satisfied due to a package in triggers-awaited state, immediately run the trigger processing and continue without errors. This make it possible to blindly use --no-triggers and not break when you're not fully configuring a pre-dependency. See test case t-predepends-no-triggers.
2011-05-14dpkg: depisok() can now suggest to process awaited triggers for a packageRaphaël Hertzog5-12/+27
Package in triggers-awaited state do not satisfy dependencies but they could easily if their awaited triggers were processed. So we enhance the function to return such a hint when possible. All the callers pass NULL to the new parameter so that this commit should not change the current behaviour.
2011-05-14dpkg: use the correct version in "pkg-foo is unpacked, but is version <v>"Raphaël Hertzog1-1/+1
The error message used while analyzing pre-dependencies did improperly use the available version instead of the installed version.
2011-05-14dpkg: small bugfix in the dependency checking code for virtual packagesRaphaël Hertzog1-1/+2
A dependency on a virtual package provided by a package in triggers-pending status is now correctly considered as satisfied.
2011-05-06dpkg: Rename isdirectoryinuse() to dir_is_used_by_others()Guillem Jover4-8/+11
This clarifies the action performed by the function, which could be easily confused as being used by the given package, instead of by other packages.
2011-05-06dpkg: Rename hasdirectoryconffiles() to dir_has_conffiles()Guillem Jover3-6/+6
2011-05-06dpkg: Fix wrong matching for check on directory containing conffilesGuillem Jover1-1/+2
On package removal, keep only directories actually containing conffiles, and not directories just matching the substring in the conffile or the directory itself. The directory itself is not matched either as strictly speaking it is not contained in itself, and it should already be in the leftover lists. Previously when checking for directory ‘/foo’ the following conffiles would match: /foo /foobar /foo/bar Now only the following will match: /foo/bar Spotted-by: Ondřej Surý <ondrej@debian.org>
2011-04-29dpkg: Move <dpkg/tarfn.h> inclusion from cleanup.c to archives.hGuillem Jover2-1/+2
The former is not using any declarations from tarfn.h, but the latter is.
2011-04-29dpkg: Use “unselected” as an adjective instead of “deselected”Guillem Jover1-2/+2
When being used as an adjective “unselected” is the correct word to use. Closes: #231089
2011-04-29dpkg: Remove --new and --old dpkg-deb option handlingGuillem Jover1-2/+0
These have been non-functional for a long time, and were being treated as dpkg commands which would conflict with the dpkg-deb commands.
2011-04-29dpkg: Refactor force flags to parsedb flags into parsedb_force_flags()Guillem Jover1-1/+12
This will make it easier to convert new flags in the future.
2011-04-26dpkg: Do not fail when unpacking a diverted hardlinkGuillem Jover1-1/+1
Closes: #245322 Based-on-patch-by: Christopher Baines <cbaines8@gmail.com>
2011-04-26Add --force-bad-version to allow installing packages with bogus versionsGuillem Jover3-2/+6
This allows to install old packages with such versions, to ease debugging, testing, etc.
2011-04-26Support conffiles with spaces when diffing themGuillem Jover1-1/+2
Closes: #147583
2011-04-21dpkg: Remove unused force_conff_new() and force_conff_miss() declarationsGuillem Jover1-2/+0
2011-04-05Merge branch 'sid' (through tag '1.16.0.1')Guillem Jover1-2/+2
Conflicts: debian/changelog
2011-04-03dpkg: Rename set_selinux_path_context() to tarobject_set_se_context()Guillem Jover1-3/+3
This puts it in line with the rest of tarobject filesystem metadata setters.
2011-04-03dpkg: don't ohshite if lutimes() fails with ENOSYSRaphaël Hertzog1-1/+1
Glibc implements lutimes() on top of utimensat() which is only provided by Linux >= 2.6.22. With older kernels it returns ENOSYS. This regression was introduced by commit b3eb59cf43c286bb6c906c00ef1cdc0ec21f474d which implemented support for setting timestamps of symlinks. Reported-by: Michael Prokop <mika@debian.org>
2011-04-03dpkg: fix regression when using -R optionRaphaël Hertzog1-1/+1
The regression was introduced in commit 280ac914cc52ee5de079c0833bb1df5005c1e7ab. The variable used for the loop got incremented twice for each iteration, the net result is that the list of filenames contains random data on half of the entries. Reported-by: Craig Sanders <cas@taz.net.au>
2011-04-02dpkg-divert: Unlink the source file when moving across filesystemsGuillem Jover1-0/+4
Otherwise we might leave cruft behind. Regression introduced in commit 02b12d75f1eff7c184fafb5a663a0421e9a645ea.
2011-04-02dpkg-divert: Inline rename_mv() into file_rename()Guillem Jover1-12/+5
2011-04-02dpkg-divert: Move atomic rename logic from rename_mv() to file_copy()Guillem Jover1-11/+9
This makes file_copy() safe to use by itself, and will allow to pull it out and use it in other places in the future.
2011-04-02dpkg-divert: Change file_copy() and rename_mv() to ohshite() on errorGuillem Jover1-17/+10
This has several consequences, the code will not trigger leak detectors like cppcheck due to ohshite() being marked non-returning, and the error messages are going to be more descriptive. Closes: #620380
2011-04-02Revert "dpkg-divert: fix minor file descriptor leak found by cppcheck"Guillem Jover1-3/+1
This reverts commit bdcee319a90eee494af70e6725fed8b4e8f16584.
2011-04-02dpkg: Set the modification time for unpacked symlinks if possibleGuillem Jover1-5/+9
Use lutimes() conditionally as it might not be widely available.
2011-04-02dpkg: Move lchown() call from tarobject() to tarobject_set_perms()Guillem Jover1-9/+9
This unifies a bit more the tarobject permission handling into a single place.
2011-04-02libdpkg: Move mtime from file_stat back to tar_infoGuillem Jover1-7/+5
There's never a reason to override the mtime, no point in carrying and copying it around in file_stat for now.
2011-04-02dpkg: Use utimes(2) instead of obsolete utime(2)Guillem Jover1-5/+8
POSIX.1-2008 marked utime(2) as obsolete. Ideally we'd switch to use utimensat(2), which would simplify quite a bit the code, but it's not yet widely available, and using it would imply having to support fallback code at compilation and run-time. This can be done later on once we up the POSIX baseline.
2011-04-02dpkg: Move conditionals to tarobject_set_*() functionsGuillem Jover1-6/+14
This will allow to handle the different cases transparently. Pass a tar_entry to each of the functions.
2011-04-02dpkg: Rename newtarobject_allmodes() to tarobject_set_perms()Guillem Jover1-2/+2
2011-04-02dpkg: Rename newtarobject_utime() to tarobject_set_mtime()Guillem Jover1-2/+2
2011-04-02dpkg: Factor out newtarobject_allmodes() callGuillem Jover1-5/+2
2011-04-02dpkg: Move newtarobject_utime() call out of newtarobject_allmodes()Guillem Jover1-2/+2
Always call newtarobject_utime() for all tar object types, except symlinks.
2011-04-02dpkg: Fix typo in comment ‘cheched’ → ‘checked’Guillem Jover1-1/+1
2011-04-02Rename struct cmdinfo member arg_func to action and call it directlyGuillem Jover4-18/+5
This avoids a temporary variable, given that now the function is strongly prototyped.
2011-04-02Use new action_func typedef instead of ad-hoc function castsGuillem Jover4-11/+11
2011-04-02Make all command line action functions return intGuillem Jover8-64/+132
This will allow using type-safe function pointers instead of casting them around. Replace all exit(3) calls with return statements. Remove DPKG_ATTR_NORET from function declarations, all functions are expected to return now.
2011-04-01dpkg: Pass default return value to reportbroken_retexitstatus()Guillem Jover3-4/+6
This will allow to pass arbitrary values from the command actions when there's not been any reported error.
2011-04-01dpkg-divert: fix minor file descriptor leak found by cppcheckRaphaël Hertzog1-1/+3
Reported-by: Niels Thykier <niels@thykier.net>
2011-03-21dpkg: use the correct mtime when installing a file with statoverridesRaphaël Hertzog1-2/+4
Regression introduced by commit ceb07b08dad4d5eead630064f45c7e7ded00a341. Reported-by: Marc A. Donges
2011-03-17dpkg-divert: fix return value of rename_mvRaphaël Hertzog1-1/+1
This is a regression introduced by the C rewrite of dpkg-divert (commit 02b12d75f1eff7c184fafb5a663a0421e9a645ea) that made it unable to rename files when that rename implies a copy on another file system. The code has provision to do a copy when a simple rename is not enough but the associated function erroneously returned a failure value when that operation was performed. Reported-by: Durk Strooisma
2011-03-14Use off_t and %jd or %jx to handle file sizes and offsetsGuillem Jover2-3/+5
This allows to support large files on 32-bit systems were a ‘long int’ type might not be of at least 64-bits. For printing %jd or %jx is used, and the value is cast to intmax_t.
2011-03-14dpkg-query: Return a valid width even if opening /dev/tty failedGuillem Jover1-3/+6
This was spotted by a run with the clang static analyzer.
2011-03-14dpkg: Add comment about why writeback code ignores return valuesGuillem Jover1-0/+6
Suggested-by: Sven Mueller <sven@debian.org>
2011-03-14Move pkgadmindir() and pkgadminfile() to the filesdb moduleGuillem Jover3-0/+44
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.
2011-03-14Make admindir file local everywhereGuillem Jover8-7/+9
The interface to get and set the database directory is dpkg_db_get_dir() and dpkg_db_set_dir().
2011-03-14Do not pass admindir to database initialization functionsGuillem Jover8-24/+22
Use dpkg_db_get_dir() and dpkg_db_get_path() to globally retrieve the database directory instead of passing it around.
2011-03-14Use dpkg_db_set_dir() instead of pkgadmindir_init()Guillem Jover5-8/+10
Remove now unused pkgadmindir_init().
2011-03-14Use dpkg_db_get_path() instead of using m_asprintf() and admindirGuillem Jover3-3/+3