summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2010-07-16dpkg: Rename symlink variable to target to not shadow symlink(2)Guillem Jover1-10/+11
2010-07-11dpkg: Rename the remove variable to skip to not shadow remove(3)Guillem Jover1-5/+5
2010-07-11build: Move dpkg_divert test case from scripts to srcGuillem Jover3-0/+572
2010-07-08dpkg-divert: Refactor writable directory check into a new functionGuillem Jover1-22/+18
2010-07-08dpkg-divert: Disable renaming of the source file does not existGuillem Jover1-7/+6
This makes it consistent with the general dpkg behaviour of honouring file removals by the administrator. Closes: #550252 As a side effect, this avoids useless errors when the destination directory is not existent or writable. Closes: #581544
2010-07-03Add new dpkg --force-confask optionHenning Makholm3-1/+10
The option forces a conffile prompt when the conffile from the new package does not differ from the previous one version. Closes: #102609 Signed-off-by: Guillem Jover <guillem@debian.org>
2010-07-03dpkg: Detect locked databases on --auditGuillem Jover1-0/+8
Detect when another process has locked the database, and mention that problematic dpkg --audit results might be due to ongoing operations. Closes: #80252
2010-07-03dpkg-divert: Rewrite in CGuillem Jover3-0/+770
2010-06-27Use consistent naming for linked lists membersGuillem Jover5-20/+20
Use next/prev instead of next/back (which would complement forward). Also move next to the end of member names and seprate it with an underscore, to simulate it being a sub struct member.
2010-06-27dpkg: Place deferred extract rename debug message closer to the actionGuillem Jover1-2/+2
2010-06-27dpkg-query: Change actionfunction to return int instead of voidGuillem Jover1-11/+25
This avoids a global exit code variable.
2010-06-27dpkg: Do not use abbreviations for 'distributed'Guillem Jover1-2/+3
2010-06-27libdpkg: Remove 'valid' member from struct pkginfoperfileGuillem Jover6-29/+23
The two struct pkginfoperfile inside struct pkginfo are always valid, as blankpackage does a blankpackageperfile on each. So there's no actual need for the boolean member, neither for validity checks all over the place and possible subsequent redundant initializations. This is due to commit 5f100a01af636c14a600bf53b22e2ca3f2fcc546.
2010-06-27dpkg: Mark hook command error string for translationGuillem Jover1-1/+2
2010-06-27dpkg: Remove redundant trailing newlines from debug outputGuillem Jover3-5/+5
debug() already prints a trailing newline, so there's no point in including it in the string to be printed.
2010-06-27libdpkg: Rename trigdef_yylex() to trigdef_parse()Guillem Jover1-1/+1
2010-06-25dpkg-trigger: Mark do_check with DPKG_ATTR_NORETGuillem Jover1-1/+1
2010-06-25dpkg: Use iterators instead of exposing packageslump directlyGuillem Jover6-182/+238
2010-06-25dpkg: Mark the summarize_filename() ellipsed string for translationGuillem Jover1-2/+1
Coallesce the ellipsed string with the format string so that it makes a bit more sense for translators. This will allow translators to use for example the UTF-8 ellipsis character.
2010-06-19dpkg: Switch existingdirectory and keepexisting from int to boolGuillem Jover1-8/+9
2010-06-19dpkg: Remove filtered existing directories on upgradeGuillem Jover1-2/+4
Move the return point in tarobject() for the existing directories check after the path filter one. This makes sure the latter takes precedence over the former, and existing directories get properly filtered and removed on upgrades. Reported-by: Martin Pitt <martin.pitt@ubuntu.com> Signed-off-by: Guillem Jover <guillem@debian.org>
2010-06-19dpkg: Remove filtered files on upgradeGuillem Jover3-0/+6
Because the filtered file is left in the new file list, the code that verifies if the old file is present (maybe with a different name) in the new list matches the stat information. So we mark and treat filtered files as if they were already not present on the file system. Reported-by: Martin Pitt <martin.pitt@ubuntu.com> Signed-off-by: Guillem Jover <guillem@debian.org>
2010-06-07dpkg: Add two new dpkg options --path-exclude and --path-includeGuillem Jover5-1/+188
This provides support for filtering paths on package installation. This allows embedded systems to skip /usr/share/doc, manpages, etc. dpkg does not lose track of excluded paths during filtering, and they get checked for file conflicts as usual, so filters are not a way to avoid file conflict situations. Closes: #68788, #68861, #497304, #525567, #583902 Based-on-patch-by: Tollef Fog Heen <tfheen@err.no> Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com> Signed-off-by: Guillem Jover <guillem@debian.org>
2010-06-07Unify naming of va_list variables to args or args_copyGuillem Jover2-23/+25
2010-06-02dpkg: Refactor file list removal into new remove_file_from_list functionGuillem Jover1-8/+15
This detangles the two independent actions, removing from the list and skiping the file from the tarball.
2010-06-02Refactor glob functions into its own moduleGuillem Jover4-28/+91
2010-05-26dpkg: Reduce scope of variables in audit()Guillem Jover1-4/+4
2010-05-19Use bool instead of int wherever appropriateGuillem Jover13-56/+72
2010-05-17dpkg: On Linux use sync() instead of an fsync() per fileGuillem Jover1-0/+7
Due to the performance degradation on ext4 file systems, as a workaround on Linux, we use sync() which is synchronous, before rename() to make sure it's truly atomic. Closes: #578635
2010-05-10dpkg: Fix --root by properly stripping root from maintainer script pathGuillem Jover1-1/+1
The cmd->filename variable was getting the full path to the maintainer script inside the chroot, and once dpkg had changed root, the path was not valid anymore. Regression introduced in 5050748f1a6bb0c0728f8c07f9058d545c80d7e0. Closes: #580984
2010-04-21Fix installation of disappearing replaced packages in reverse orderGuillem Jover1-0/+1
This happens when the we install first the replacing then the replaced package, for which the replaced package is supposed to get disappeared. And fixes it to disappear the correct package and not lose track of the ownership of the replaced files, by marking the replaced file as not being part of the unpacked archive.
2010-04-21Fix versioned Replaces to not produce file overwrite errors on downgradesGuillem Jover1-7/+9
Change does_replace() to take an additional argument for the old ‘struct pkginfoperfile’, instead of hardcoding oldpigp->installed. Which we use by passing pkg->available when checking if the current package has files replaced by files from an already installed package. Closes: #568566
2010-04-16dpkg: export DPKG_LIBDIR to maintainer scriptsRaphaël Hertzog2-0/+2
It can be used to find out the location of some internal dpkg programs that might be called from maintainer scripts. That way we can avoid hardcoding /usr/lib/dpkg and maintainer scripts will still work when called from a dpkg manually installed in /usr/local for example.
2010-04-16dpkg: export DPKG_MAINTSCRIPT_NAME to tell what kind of script we're runningRaphaël Hertzog1-2/+2
The idea is that specialized hooks can benefit from this information to do the right thing. The same call would be put in the various maintainer scripts but the actions taken would be different depending on the script nevertheless.
2010-04-15dpkg: Fix hard link extraction for normal files due to deferred renameGuillem Jover1-1/+6
When creating hard links on extraction use the .dpkg-new filename for source as the normal file is not yet in place due to the rename deferral. We avoid doing this for hard links to special files (which do not have the fnnf_deferred_rename flag) because they are already in place. Although this should not always pose a problem because not all tar creation implementations support hard links for non-normal files, but at least FreeBSD libarchive based ones support them for fifos, so better be safe than sorry. Based-on-patch-by: Colin Watson <cjwatson@ubuntu.com>
2010-04-14dpkg: Report deferred trigger errors on status-fdMichael Vogt1-0/+11
Report these errors directly through status-fd, instead of reporting later on errors which are a consequence of those first errors, which can be pretty confusing for a front-end. Closes: #574599 Signed-off-by: Guillem Jover <guillem@debian.org>
2010-04-14dpkg: Factor out extension into its own variable in enqueue_specified()Guillem Jover1-3/+3
2010-04-14dpkg: Factor out package-listing functions from packages()Jonathan Nieder1-48/+64
Split packages() into bite-sized pieces. No functional change intended. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Guillem Jover <guillem@debian.org>
2010-04-14dpkg: fix deferred rename/fsync processingColin Watson3-4/+4
It was scanning the old list of files so it would never install new files.
2010-04-14dpkg: fix rename deferralColin Watson1-1/+1
Modern tar files typically use NormalFile1 rather than NormalFile0 for file objects. A typo meant that the former never triggered rename deferral.
2010-04-09dpkg: fix metadata installation by not mixing rename() in a readdir() loopRaphaël Hertzog1-7/+32
dpkg's process_archive() was doing the improper assumption that a readdir() loop would not return the same filename twice even when the scanned directory has files renamed into it (coming from tmp.ci). The net result of having the same filename returned twice is that the the second time the updated file to install is no longer there and thus dpkg removed the current metadata file believing that it was obsolete. btrfs triggers this bug consistently. All other readdir() occurrences have been reviewed as well for similar problems. But they are all safe, they mainly unlink() files rather than adding new files into the scanned directory. Thanks to Carey Underwood and Chris Mason for their help in diagnosing this problem. Acked-by: Guillem Jover <guillem@debian.org>
2010-03-25dpkg: Defer the fsync and rename for normal files in tar extractionGuillem Jover4-12/+79
This way it's done in one pass afterwards, to avoid massive I/O degradation due to the serialization from each write + fsync. This restores extraction times to numbers closer to the ones before the fsync patch introduced in 1.15.6.
2010-03-24dpkg-query: Make local functions staticGuillem Jover2-8/+12
2010-03-21dpkg-statoverride: Fix bogus arguments in ACTION macrosGuillem Jover1-3/+3
Remove bogus short options and use more appropriate act_ values for each action.
2010-03-21libdpkg: Move trigdeferred declarations to a new trigdeferred.hGuillem Jover1-0/+1
2010-03-21libdpkg: Move triglib declarations to a new triglib.hGuillem Jover7-0/+7
2010-03-12Do an fsync on database directoriesGuillem Jover4-0/+28
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>
2010-03-12libdpkg: Create new pkgadmindir() to hide admindir and INFODIRGuillem Jover4-12/+6
The callers should not be concerned about where the package info directory is located, the new functions encapsulates the knowdlegde in the dbmodify module.
2010-03-12Use License instead of Licence in stringsGuillem Jover1-1/+1
This removes almost duplicate strings for translation.
2010-03-06Do an fsync on files written to diskGuillem Jover2-0/+6
This guarantees the file contents will be there in case of abrupt program termination (due to crashes for example, or user intervention). This also guarantees the atomicity of rename(2) calls. Closes: #430958 Based-on-patch-by: Jean-Baptiste Lallement <jeanbaptiste.lallement@gmail.com>