summaryrefslogtreecommitdiff
path: root/src/querycmd.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-07libdpkg: Rename myopt module to optionsGuillem Jover1-1/+1
2011-07-07Use new dpkg_set_progname and dpkg_get_progname instead of thisnameGuillem Jover1-3/+3
The current implementation demanded libdpkg users to define thisname themselves, which is not really a nice interface to offer to programs. Closes: #631757
2011-07-07libdpkg: Do not require programs to define printforhelpGuillem Jover1-2/+3
Instead define it in myopt.c and initialize it through a new argument to myopt().
2011-04-02Rename struct cmdinfo member arg_func to action and call it directlyGuillem Jover1-4/+1
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 Jover1-2/+2
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-14Make admindir file local everywhereGuillem Jover1-1/+1
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 Jover1-8/+8
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 Jover1-2/+2
Remove now unused pkgadmindir_init().
2011-03-14libdpkg: Rename modstatdb_init() to modstatdb_open()Guillem Jover1-8/+8
We'll need to reuse the modstatdb_init() function name for further refactoring.
2011-03-14Make modstatdb available file options explicitGuillem Jover1-3/+3
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 read the available file unnecessarilyGuillem Jover1-5/+11
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 Jover1-6/+6
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: Refactor infodb directory traversal into new pkg_infodb_foreach()Guillem Jover1-50/+2
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 Jover1-18/+17
This will allow further refactoring now that the infodb traversal code is the same eveyrwhere.
2011-03-02Use varbuf_end_str() instead of ad-hoc varbuf_add_char() callsGuillem Jover1-4/+4
This allows the strings to be terminated, thus printable or accessed through the standard C string functions, and at the same time appendable.
2011-02-11libdpkg: Rename cmdinfo arg membersGuillem Jover1-4/+4
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-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-16Propagate --admindir to programs run from maintainer scriptsGuillem Jover1-1/+3
Always set DPKG_ADMINDIR from dpkg so that all subprocesses inherit the variable and there's no possible security risk from a user process setting the variable to write onto a user controlled area. As usual, the order in which the admindir value is overridden is the following: built-in default, environment variable and command line option. Closes: #97076 Suggested-by: Brendan O'Dea <bod@debian.org>
2011-01-16libdpkg: Rename varbufaddstr() to varbuf_add_str()Guillem Jover1-4/+4
Make the varbuf API a bit more consistent.
2011-01-16libdpkg: Rename varbufaddc() to varbuf_add_char()Guillem Jover1-6/+6
Make the varbuf API a bit more consistent.
2011-01-16libdpkg: Rename varbufreset() to varbuf_reset()Guillem Jover1-2/+2
Make the varbuf API a bit more consistent.
2011-01-16libdpkg: Rename varbufinit() to varbuf_init()Guillem Jover1-1/+1
Make the varbuf API a bit more consistent.
2011-01-08dpkg-query: Refactor --list header printing into list_format_print_header()Guillem Jover1-33/+42
2011-01-08dpkg-query: Refactor --list format creation into new list_format_init()Guillem Jover1-48/+72
2010-12-20Merge branch 'sid' (through tag '1.15.8.7')Guillem Jover1-1/+1
Conflicts: debian/changelog dselect/po/es.po po/es.po po/pt.po scripts/po/es.po src/archives.c
2010-12-10dpkg-query: Fix stanza delimiting on -L, -s and -p outputGuillem Jover1-1/+1
The code was only printing a delimiting new line on the second to last stanza. Invert the logic and do it always except on the last one. Closes: #606315
2010-11-19libdpkg: Rename path_rtrim_slash_slashdot to path_trim_slash_slashdotGuillem Jover1-1/+1
2010-11-19Cleanup white spacesGuillem Jover1-10/+5
Remove trailing spaces. Remove blank lines not separating different code blocks. Remove blank lines at the end of the file.
2010-11-19Cleanup and improve source code commentsGuillem Jover1-16/+33
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. */
2010-11-19libdpkg: Rename informative to pkg_is_informativeGuillem Jover1-2/+2
2010-11-19libdpkg: Namespace package database functions with pkg_db_ prefixGuillem Jover1-2/+2
2010-11-19Use push_error_context() instead of ad-hoc codeGuillem Jover1-2/+1
2010-11-19dpkg-query: Fix --search not found string to be more meaningfulGuillem Jover1-1/+2
2010-11-19Use thisname variable instead of hard-coded 'dpkg' stringGuillem Jover1-1/+1
This corrects the current program name printed by other tools.
2010-11-19Add a comment for translators to 'dpkg-query -l' header stringGuillem Jover1-0/+6
Reported-by: Ask Hjorth Larsen <asklarsen@gmail.com>
2010-11-19Move action and obsolete related functionality to the myopt moduleGuillem Jover1-14/+0
Reduce repeated code, and localize it where it belongs.
2010-07-26Use varbuf_trunc instead of directly assigning to member 'used'Guillem Jover1-2/+3
2010-07-16dpkg-query: Rename query.c to querycmd.cGuillem Jover1-0/+704
This makes it obvious the file contains the main() function for dpkg-query in line with the rest of the tools.