summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2013-12-07dpkg: Reset the statoverrides from the in-core database on reloadGuillem Jover1-0/+7
If a statoverride gets removed in a maintainer script, it will not be reflected on the database until after the current dpkg process has been restarted. So we need to reset the statoverride information whenever we are going to reload the statoverride database.
2013-12-07dpkg: Add debug output on diversions and statoverride database loadingGuillem Jover2-0/+6
2013-12-07dpkg: Keep the diversions and statoverride database files openGuillem Jover2-7/+32
The database files must be kept open during an entire dpkg run, because we need to check if the files have changed, and rely on the inode number, which could get eagerly reused by the filesystem if these files get replaced multiple times in maintainer scripts. Add a code comment explaining the rationale, so that this does not happen again in the future. This partially reverts commit 579b90b61b24a538cf1709d7ceda0b38fec631b3. Closes: #731524
2013-12-05Rename cmdinfos set functions to have underscores between wordsGuillem Jover2-23/+35
2013-12-04dpkg: Switch conflictor tracking from a fixed-size array to a queueGuillem Jover3-30/+34
This fixes several related issues. The list of conflictors has always really been a queue, where packages were added and then acted on, although no package was removed from the list after being processed, which in turn made subsequent conflictors accumulate and reach the arbitrary limit due to previous unrelated Conflicts/Replaces pairs, giving possibly very confusing error messages due to that. Another theoretical problem is that because the list was not cleaned up after processing it, a package could have been enqueued to be removed, then a newer version reinstalled which could get removed again on a subsequent package processing, being it on the list. Closes: #726112
2013-12-04perl: Surround FileHandles with braces in print callsGuillem Jover1-3/+3
Fixes InputOutput::RequireBracedFileHandleWithPrint. Warned-by: perlcritic
2013-11-24perl: Always check open() return valueGuillem Jover1-4/+8
Fixes InputOutput::RequireCheckedOpen. Warned-by: perlcritic
2013-11-23dpkg: Do not lose track of packages owning a fileGuillem Jover1-1/+2
Properly reset the pkg_prev pointer for each file iteration, by moving the variable declaration inside the loop. Regression introduced in commit a2ee7d0bb4d56afb82438f09a50251acfa690643. Reported-by: Raphaël Hertzog <hertzog@debian.org>
2013-11-23dpkg: Set verify_output_rpm() as the default verify output formatterGuillem Jover1-2/+2
The verify_output function pointer was not initialized, and if the user did not specify --verify-output the program would segfault. Reported-by: Raphaël Hertzog <hertzog@debian.org>
2013-11-23dpkg: Split post_script_tasks() debug messageGuillem Jover1-2/+2
Move the ensure_diversions debug progress message just before the function call, to make this less confusing.
2013-11-23dpkg: Get rid of post_postinst_tasks_core()Guillem Jover3-20/+4
Fold post_postinst_tasks_core() into post_postinst_tasks(), and replace open-coded implementation in trigproc().
2013-11-23dpkg: Use modstatdb_get_status() instead of hardcoding msdbrw_writeGuillem Jover1-6/+3
Pass the modstatdb status value used when opening the database, instead of hardcoding msdbrw_write to trig_incorporate() calls, and avoiding calling them on --no-act.
2013-11-23dpkg: Rename and unify maintscript function namesGuillem Jover7-143/+138
2013-11-23libdpkg: New dpkg_locales_init()Guillem Jover5-20/+5
Switch all program to use the new function instead of open-coding it.
2013-11-08dpkg: Refactor out run_logger() from run_status_loggers()Guillem Jover1-18/+27
2013-11-08dpkg: Distinguish error reports between archives and packagesGuillem Jover3-2/+16
2013-11-08dpkg: Refactor enqueue_error_report() out from print_error_perpackage()Guillem Jover1-7/+15
2013-11-08libdpkg: Change error printer argument from const char * to const void *Guillem Jover2-2/+5
This will allow passing any other data to the printer callback beside a string.
2013-11-08libdpkg: Refactor integer parsing into new dpkg_options_parse_arg_int()Guillem Jover1-17/+4
2013-10-27dpkg: Only keep previous database stat info instead of open filesGuillem Jover2-32/+15
There's no point in keeping the files open across subsequent calls, when the only thing we want to know is if the new file is the same as the old one, just preserve the stat information for that. With this we do no longer need to set the close-on-exec bit either.
2013-10-27dpkg: Always return from ensure_statoverrides() if file is NULLGuillem Jover1-0/+5
Do not proceed within the function if we cannot open the current database because it does not exist and we opened it before. This will only get us to read garbage from memory or segfault. Warned-by: clang static analyzer
2013-10-27dpkg: Give more meaningful names to database stat variablesGuillem Jover2-14/+16
Name them as stab_prev and stab_next to denote the previous and next database file to read.
2013-10-27dpkg: Only allocate STATOVERRIDEFILE and DIVERSIONSFILE paths onceGuillem Jover2-6/+4
There's no point in reallocating these on every function invocation, if in the future we need to change the paths between calls, then the function can be reworked to take a pathname for example.
2013-10-27dpkg: Use line instead of desc to make use of the strtok() assignmentGuillem Jover1-1/+1
There's no actual behavior change with this, but it makes the code clearer and squashes a warning. Warned-by: clang static analyzer
2013-10-27dpkg, libdpkg: Remove unused variable assignmentsGuillem Jover1-1/+0
Warned-by: clang static analyzer
2013-10-26dpkg: Use a simple list to track packages owning a fileGuillem Jover2-73/+30
Using a list of package arrays waste at least 10 pointers per path that is not shared by multiple packages, which adds up to significant amount with lots of installed paths and 64-bit pointers. Also the new waste we get from each pkg_list node for each shared file is really minor, as the common thing is for num. paths >>> num. packages.
2013-10-17dpkg: Print the package version on main progress messagesGuillem Jover4-14/+24
This should help people diagnose problems by providing more context on what's going on by being explicit about what packages is being handled.
2013-10-17dpkg: Improve “Preparing to replace” and “Unpacking” messagesGuillem Jover1-8/+14
Unifies the output, makes it symmetric in case of upgrade or new install by always printing two messages, properly shows from what version we are upgrading to which one, and some cases of cross-grading. Closes: #32427, #71106
2013-10-17dpkg: Add new --verify commandGuillem Jover4-1/+188
For now this checks that the files have not been modified by computing and comparing their md5sum hashes against the ones in the database. The only currently supported output format will try to mimick the one from «rpm --verify», but the default might change in the future in case it is found cumbersome or lacking, and as such programs parsing the command output should be explicit about the format they want. Closes: #187019
2013-10-17dpkg: Add md5sums control file parsing supportGuillem Jover2-0/+101
2013-10-14Use <termios.h> instead of deprecated <sys/termios.h>Guillem Jover2-2/+2
2013-10-14Remove unused sys header inclusionsGuillem Jover2-5/+0
2013-10-14libdpkg: Rename and namespace option parsing and loading functionsGuillem Jover5-7/+7
2013-10-14libdpkg: Add dpkg-based program startup and shutdown functionsGuillem Jover5-22/+11
These will perform any necessary action when starting and exiting a dpkg-based program.
2013-10-14libdpkg: Refactor report output buffering setup into a new functionGuillem Jover5-9/+5
2013-10-14dpkg-query: Fix output when using multibyte character stringsGuillem Jover1-6/+15
When cropping strings, possibly multibyte ones, take into account that there's three different counts to be considered, the number of characters to display, their screen width and the number of bytes they take on the multibyte string. Closes: #257505, #718541 Based-on-patch-by: Changwoo Ryu <cwryu@debian.org>
2013-10-14dpkg-query: Do not hardcode summary width in list_format_print_header()Guillem Jover1-1/+1
2013-10-14dpkg: Activate file triggers on disappearance more accuratelyGuillem Jover1-1/+4
Activate them only when we know we are inevitably removing things.
2013-10-14dpkg: Activate all path components for file triggers on removalGuillem Jover1-2/+2
Because directory processing might get skipped on removal (contrary to unpack), as they might be shared with other packages, some file triggers will not get activated as the code was changed to do more optimal activation. The problem is that the removed paths need to activate all parent paths to be effective. Regression introduced in commit 65ade6390b47fe3ec6a0e2ba341f3d553bf4bbc6. Closes: #725437
2013-09-19dpkg: Use an enum for the saidread variableGuillem Jover1-7/+13
2013-09-19dpkg: When ignoring invalid remove requests consider that progressGuillem Jover1-0/+2
Because we've taken out the package from the queue, and acted on it, by way of ignoring it, we need to consider that progress when processing the queue, otherwise for huge amount of requests the decreasing queue length at some point will be shorter than the amount of packages that have not supposedly progressed. Closes: #143307
2013-09-19dpkg: Use enum dep_check type and values instead of int and literalsGuillem Jover2-7/+9
2013-09-19Decapitalize error and warning messagesGuillem Jover4-8/+8
2013-08-11dpkg: Add a debug line when hashing on-disk files on refcountingGuillem Jover1-1/+3
2013-08-11dpkg: Pass the package reference count to maintainer scriptsGuillem Jover1-0/+5
The new variable DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT will contain the number of package instances with a state grater than not-installed. This should allow packages to easily perform actions on the first instance installed or the last instance removed, for example. Closes: #681370
2013-08-11dpkg: Remove extra newline from path filter debug outputGuillem Jover1-1/+1
The debug() function automatically appends a newline, no need to duplicate it.
2013-08-10dpkg: Automatically prepend needed spaces for continuation force-help linesGuillem Jover1-6/+25
Instead of trying to implement automatic word-wrapping, which is really tricky when having to take into account wide characters, and locales supporting things like combining characters, or special rules for when to word-wrap, just take the easy way out, and require a newline character to know when to wrap the line.
2013-07-22dpkg-divert: Rename file_copy() argumentsGuillem Jover1-13/+13
2013-07-22dpkg-divert: Remove temporary file on error during --renameGuillem Jover1-1/+3
Do not leave the «.dpkg-divert.tmp» temporary file around if the file copy failed for any reason.
2013-07-18Change user-friendly UI recommendation from dselect to aptGuillem Jover1-3/+3
Suggested-by: Ma Xiaojun <damage3025@gmail.com>