summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2011-03-14Use dpkg_db_get_path() instead of ad-hoc building the string with varbufGuillem Jover3-26/+22
2011-03-14Make modstatdb locking functions not take an admindir argumentGuillem Jover2-2/+6
Initialize the lockfile on modstatdb_init() via the fnis array. Make sure we call modstatdb_init() and modstatdb_done() in case we are not calling modstatdb_open() and modstatdb_shutdown().
2011-03-14libdpkg: Rename modstatdb_init() to modstatdb_open()Guillem Jover5-17/+17
We'll need to reuse the modstatdb_init() function name for further refactoring.
2011-03-14Make modstatdb available file options explicitGuillem Jover3-6/+6
The options were either explicit or dependent on the main status options, now they are always explicit. This detangles the actions on the available file from the ones on the status file. Rename the enum flags accordingly.
2011-03-14Do not write the available file unnecessarilyGuillem Jover1-1/+1
Some times we need to write back the status file, but not the available file. Add a new flag to handle those cases. Based-on-patch-by: Michel Lespinasse <walken@zoy.org>
2011-03-14Do not read the available file unnecessarilyGuillem Jover5-13/+19
For commands that only make use of information from the status file, there's no need to make them read and parse the available file. This change does not alter the current behaviour, and commands that were previously updating the available file will continue doing so. Removing further access to it is pending a decision on how to treat globally the available file, which needs interaction with the package manager frontend developers. Closes: #397121 Based-on-patch-by: Michel Lespinasse <walken@zoy.org>
2011-03-14Switch the logic from msdbrw_noavail to msdbrw_availableGuillem Jover5-20/+21
2011-03-04dpkg: Call gettext() on force option description printingGuillem Jover1-1/+2
Regression introduced in commit 97205c1bab2d5fd18e9dd33f5329db209b866634.
2011-03-03dpkg-query: Document that --list and --show arguments are optionalGuillem Jover1-1/+1
Do that in the --help output and in the man page.
2011-03-02dpkg: Pass correct DPKG_ADMINDIR to maintainer scripts with --rootGuillem Jover1-5/+6
When passing the DPKG_ADMINDIR environment variable to the maintainer scripts we need to trim the installation directory name from admindir, otherwise the directory won't be found. Regression introduced in commit e63e1fa4a4afdf98847f13f2506a0aeea68c33c7. Based-on-patch-by: Steve Langasek <steve.langasek@linaro.org> Improved-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-02dpkg-divert: Honour --local when DPKG_MAINTSCRIPT_PACKAGE is presentGuillem Jover1-1/+1
Regression introduced in commit dc98261980767f258046f8a4c2e020fcdc92c8b6- Reported-by: Martin Pitt <martin.pitt@ubuntu.com> Suggested-by: Colin Watson <cjwatson@ubuntu.com>
2011-03-02dpkg: Refactor infodb update on unpack into new pkg_infodb_update()Guillem Jover1-74/+90
2011-03-02dpkg: Refactor infodb directory traversal into new pkg_infodb_foreach()Guillem Jover6-134/+69
Move the common code into a new function which will call an action pointer function on matched files to perform the specific logic.
2011-03-02dpkg: Refactor specific infodb traversal logic into their own functionsGuillem Jover3-42/+76
This will allow further refactoring now that the infodb traversal code is the same eveyrwhere.
2011-03-02dpkg: Refactor match_node allocation into new match_node_new()Guillem Jover1-5/+14
2011-03-02dpkg: Refactor match_node deallocation into new match_node_free()Guillem Jover1-3/+9
2011-03-02dpkg: Switch the rename_list logic to match_nodeGuillem Jover1-24/+27
Instead of directly preparing the arguments on traversal, store the information of the matched files, which we'll be acting on later in the code. This will allow for further refactoring.
2011-03-02dpkg: Refactor infodb file existence check into new pkg_infodb_has_file()Guillem Jover5-23/+86
2011-03-02dpkg: Sync and print the correct info database directoryGuillem Jover2-12/+6
On unpack sync the info database directory instead of the temporary control information directory, and print the correct pathname on error instead of the last file acted on that directory.
2011-03-02Rename namevalue variables to nv and nv_headGuillem Jover1-4/+4
2011-03-02Use varbuf_end_str() instead of ad-hoc varbuf_add_char() callsGuillem Jover16-60/+60
This allows the strings to be terminated, thus printable or accessed through the standard C string functions, and at the same time appendable.
2011-03-02dpkg: Only copy already counted output lines from findGuillem Jover1-6/+3
Instead of appending two NUL characters to be able to track the end of the NUL terminated lines from find's output. Just handle the number of lines we have already counted previously.
2011-03-02dpkg: Reduce local variable scope in archivefiles()Guillem Jover1-6/+7
2011-03-02dpkg: Move varbuf related calls close together in setselections()Guillem Jover1-4/+8
It's easier to read if the varbuf calls affecting the same variable are close together, rather than dispersed around in the code.
2011-03-02dpkg: Use pkgadminfile() instead of varbuf_pkgadminfile()Guillem Jover2-12/+17
This simplifies the API, and unifies the different call sites, the extremely small performance penalty is irrelevant in these cases.
2011-02-11libdpkg: Rename cmdinfo arg membersGuillem Jover10-40/+41
The current names are not descriptive enough, so rename parg to arg_ptr, farg to arg_func, and finally arg to arg_int (which disambiguates what kind of data it's holding).
2011-02-11dpkg: Automate force help output printingGuillem Jover1-52/+76
Move the force type (normal, default, dangerous) and force description to struct forceinfo, so that its printing can be automated. This has multiple purposes (similar to the debuginfo output automation); there's one less place to modify when adding a new force flag, the ouput is easier to modify w/o fuzzying the translated strings, it's easier for the translators to deal with new force flag additions.
2011-02-11dpkg: Reduce the scope of a if/else in setforce()Guillem Jover1-8/+9
2011-02-11dpkg: Handle --force-all as any other force optionGuillem Jover1-6/+6
Add an entry for "all" to forceinfos, so that the code paths are more clear on what each is doing. This will also make further refactoring easier.
2011-02-11dpkg: Fix typo in debug help outputGuillem Jover1-1/+1
2011-02-11dpkg: Capitalize debug help output table titlesGuillem Jover1-1/+1
2011-02-11dpkg: Automate debug help output printingGuillem Jover1-16/+32
Add a new array of struct debuginfo to hold debug flag information, so that it can be handled automatically. This has multiple purposes; it will guarantee the output value always matches the one defined in the code, there's one less place to modify when adding a new debug flag, the ouput is easier to modify w/o fuzzying the translated strings, it's easier for the translators to deal with new debug flag additions, it will not allow for the source reference name to be translated thus avoiding errors.
2011-02-11dpkg: Refactor conflictor addition to a new push_conflictor() functionGuillem Jover3-12/+16
Move the conflictor and cflict_index variables to processarc.c and make them static. And create a new push_conflictor() function to hide the implementation details. This fixes a warning on variable shadowing.
2011-02-11dpkg: Use m_realloc() instead of free()+m_malloc() on process_archive()Guillem Jover1-3/+1
2011-02-11dpkg: Remove useless cidirbuf variable in process_archive()Guillem Jover1-9/+8
Remove cidirbuf and make cidir a static function scope variable.
2011-02-11dpkg: Remove temporary variable admindirlen in process_archive()Guillem Jover1-3/+3
Inline the strlen() call instead of using the intermediate variable.
2011-02-11Move and generalize debug API from dpkg to libdpkgGuillem Jover4-33/+7
2011-02-11dpkg: Always call pkg_has_postrm_script() in removal_bulk()Guillem Jover1-11/+6
Instead of letting removal_bulk_remove_files() tell the caller it has found a postrm script in its branch and calling pkg_has_postrm_script() on the other, just unconditionally call it always. This removes the need to pass back the value via out_foundpostrm, which makes further refactoring slightly more convoluted.
2011-02-11dpkg: Refactor out pkg_has_postrm_script() from removal_bulk()Guillem Jover1-10/+16
2011-02-11dpkg: Use varbuf_pkgadminfile() instead of manually building the pathGuillem Jover2-16/+3
2011-02-06dpkg: Do not segfault on “dpkg -i --no-act”Guillem Jover1-2/+9
mkdtemp() takes the string allocated by path_make_temp_template() and modifies it, but there's not enough allocated room for the subsequent string appends done starting from cidirrest, for the control files. Regression introduced in commit ffccc65580189420a0a64736bba0fb661de56dcb.
2011-02-01dpkg: Document packages w/o Architecture field need --force-architectureGuillem Jover1-1/+1
The commit 58e7276b69be105735eccb3c18c2b28d3a2ec2e5 didn't explicitly document this behavioural change, do so now.
2011-02-01Revert "Fix installation of packages without architecture field"Guillem Jover1-2/+1
This reverts commit 13637ddfaf473fa5fd67264da9f38841eeed7401. The changes in commit 58e7276b69be105735eccb3c18c2b28d3a2ec2e5 were intentional, supported here meant (although the commit did not document this properly) that the non-compliant package can still be installed, although --force-architecture is now required.
2011-01-31Fix installation of packages without architecture fieldRaphaël Hertzog1-1/+2
Refactoring done in commit 58e7276b69be105735eccb3c18c2b28d3a2ec2e5 introduced a regression: a package without an architecture field can no longer be installed without --force-architecture.
2011-01-31libdpkg: Ensure parsed packages have a usable arch memberGuillem Jover1-2/+1
In case the package didn't have an Architecture field, warn and initialize it to an empty string, so that it can be safely used for string comparisons, printing, etc. This fixes a potential segfault when setting the environment variable DPKG_MAINTSCRIPT_ARCH from a package w/o an Architecture field, which are a thing from the distant past, but still should be supported.
2011-01-31dpkg: Rename arch variable to native_archGuillem Jover4-5/+5
This disambiguates the usage and avoids unneeded shadowing.
2011-01-31Rename architecture variables to archGuillem Jover5-9/+9
The “arch” name is unambiguous in this context, and as we are going to be using it more often, let's avoid unnecessary typing.
2011-01-31Use pid instead of c1 for variable nameGuillem Jover3-19/+22
2011-01-16dpkg-query: Use ohshit() for not installed package in --control-pathGuillem Jover1-1/+1
The use of badusage() here is not appropriate.
2011-01-16dpkg: Do not fail when trying to remove the root directoryGuillem Jover1-0/+10
This will happen when removing the last package from an installation, which does never happen on normal conditions on Debian-based systems. But it can happen either on other distributions where dpkg is a foreign package manager, or on test databases.