summaryrefslogtreecommitdiff
path: root/src/trigproc.c
AgeCommit message (Collapse)AuthorFilesLines
2012-04-03Move pkg_infodb_get_dir() and pkg_infodb_get_file() to infodb-format.cGuillem Jover1-0/+1
These functions have never belonged in the filesdb module, but were put there temporarily for convenience.
2012-04-03Rename pkgadmin*() to pkg_infodb_get_*()Guillem Jover1-3/+5
2012-04-01Use cmp() == 0 instead of !cmp()Guillem Jover1-1/+1
2012-03-18dpkg: Change debug output to always arch-qualify package namesGuillem Jover1-9/+9
2012-03-14dpkg: Use package specifiers in statusfd and log messagesGuillem Jover1-2/+2
The colon is often used as a separator but it is always preceded and/or followed by a space so that it's possible to distinguish between the colon used as a separator and the colon embedded in a package name (like in "libc6:amd64"). Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-02-18Use new package status setters instead of direct assignmentsGuillem Jover1-8/+17
This does not apply for package constructors.
2012-02-01Change debug, progress and error output to use package specifiersGuillem Jover1-18/+28
Replace pkg->set->name with varbuf_add_pkgbin_name(), pkgbin_name() or pkg_name(). This only changes informative output, so no behaviour change should result from this. Based-on-patch-by: Raphaël Hertzog <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2012-02-01dpkg: Pass struct pkgbin to log_action()Guillem Jover1-1/+1
2012-01-23libdpkg: Pass pkgbin to trig_parse_ci callbacksGuillem Jover1-6/+8
[hertzog@debian.org: - Track pkgbin in struct trigfileint. ]
2012-01-09libdpkg: Pass pkginfo instead of void * to trig_parse_ci callbacksGuillem Jover1-5/+5
Use strict types instead of a ‘void *’ pointer.
2011-11-14Replace all pkg_db_iter_next() calls with pkg_db_iter_next_pkg()Raphaël Hertzog1-2/+2
Sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
2011-10-30Switch pkgadminfile() to get an explicit pkgbin as argumentGuillem Jover1-2/+2
The code does not do anything yet with this new argument, but it will allow it to access the multiarch information, once the on-disk layout is changed.
2011-10-27Switch from pkginfo->name to pkginfo->set->nameGuillem Jover1-18/+23
Remove now unused struct pkginfo name member.
2011-10-06dpkg: fix trigger setup code to not reset the status of unconfigured packagesRaphaël Hertzog1-0/+2
The change in commit a36cadba41b19d5908bdfcb658cf01af07c1436a was wrongly assuming that all packages would be in one of the states triggers-awaited, triggers-pending or installed when trig_transitional_activate kicks in. That is not the case and the status reset should hence only be done when the current status is already such that the trigger information are meaningful. transitional_interest_callback_ro() is already taking care to not add anything in the Triggers-Pending field when the status is such that it would not make sense. Reported-by: Hector Oron <hector.oron@gmail.com>
2011-07-07Use new dpkg_set_progname and dpkg_get_progname instead of thisnameGuillem Jover1-1/+1
The current implementation demanded libdpkg users to define thisname themselves, which is not really a nice interface to offer to programs. Closes: #631757
2011-06-25dpkg: implement "interest-noawait" and "activate-noawait" trigger commandsRaphaël Hertzog1-4/+6
Those variants do not put triggering packages in triggers-awaited status and thus do not record the package with the corresponding pending triggers in the Triggers-Awaited field. This should be used for triggers which do not provide essential functionality when we can safely consider that the triggering packages are able to satisfy dependencies even if the trigger processing has not yet happened.
2011-06-17dpkg: ensure that trig_transitional_activate() doesn't introduce bad dataRaphaël Hertzog1-0/+7
trig_transitional_activate() is emptying Triggers-Pending without ensuring that the status is set back to something which is not triggers-pending. In theory it's ok because the trig_parse_ci() call is supposed to reactivate all the triggers. But if there's no triggers file any more then we're effectively introducing a skew which is going to be fatal the next time we try to write down the status file. The disparition of the triggers file can happen with file system problems, bad user manipulation or even an old dpkg bug that kept triggers alive when in fact the trigger was dropped from the package. Or the triggers file has effectively been removed in the package but the user has restored an old status file with a triggers-pending status that the current package should no longer be able to generate. In other words, properly resetting the status in trig_transitional_activate() makes dpkg more robust.
2011-03-02Use varbuf_end_str() instead of ad-hoc varbuf_add_char() callsGuillem Jover1-1/+1
This allows the strings to be terminated, thus printable or accessed through the standard C string functions, and at the same time appendable.
2011-01-16libdpkg: Rename varbufaddstr() to varbuf_add_str()Guillem Jover1-1/+1
Make the varbuf API a bit more consistent.
2011-01-16libdpkg: Rename varbufaddc() to varbuf_add_char()Guillem Jover1-2/+2
Make the varbuf API a bit more consistent.
2011-01-16libdpkg: Rename varbufreset() to varbuf_reset()Guillem Jover1-1/+1
Make the varbuf API a bit more consistent.
2010-11-19Cleanup white spacesGuillem Jover1-1/+0
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-25/+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: Namespace package database functions with pkg_db_ prefixGuillem Jover1-7/+7
2010-11-19libdpkg: Use push_error_context_jump() instead of push_error_handler()Guillem Jover1-1/+2
Remove obsolete and now unused push_error_handler compatibility macro.
2010-11-19libdpkg: Rename error_unwind() to pop_error_context()Guillem Jover1-2/+2
2010-11-19Move error context display handler reset to error_unwind()Guillem Jover1-1/+0
Never print an error message when doing normal cleanup, as this is something we always want to do.
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-05-19Use bool instead of int wherever appropriateGuillem Jover1-3/+3
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-03-21libdpkg: Move triglib declarations to a new triglib.hGuillem Jover1-0/+1
2010-03-05libdpkg: Add new trig_override_hooks to avoid exposing trighGuillem Jover1-1/+1
Make trigh static and create an overrider function for it.
2010-02-25dpkg: Switch code to use “struct pkg_queue” instead of “struct pkgqueue”Guillem Jover1-8/+8
The semantics of the pkq-queue module are more clear, so it makes the code slightly easier to handle.
2009-11-08Unify text in license headersGuillem Jover1-5/+5
Add a missing “of the License” after “version 2”. Move “but” and “GNU” at the end of line to the next line. This matches more closely the paragraph found in the license text for the GPL version 2.
2009-11-08Replace FSF address by pointing to the gnu.org URLGuillem Jover1-3/+2
Use the <http://www.gnu.org/licenses/> URL, instead of in most cases the outdated FSF address, which is way more stable, as the latter has changed several times in the past.
2009-10-26Sort order of header includesGuillem Jover1-3/+3
Place first <config.h> and <compat.h>, then all <sys/*.h> sorted by complexity, followed by the rest of the system headers, then <dpkg/*.h> and finally the local "*.h" ones. Move <dpkg/i18n.h> inclusion into libdpkg inclusion block, as the <gettext.h> compatibility header already takes care of including <locale.h> before <libintl.h> on environments were its probamatic. Removed duplicated inclusions.
2009-10-14Use named intializers in structuresGuillem Jover1-5/+5
2009-09-15Switch ad-hoc code to use struct pkg_list data typeGuillem Jover1-1/+1
Free the trig_awaited_pend_head list now that it is a pkg_list and it switched from being allocated with m_malloc instead of nfmalloc.
2009-07-15Disable default automake preprocessor include pathsGuillem Jover1-2/+2
Tell automake not to add “-I.” to the preprocessor flags, to avoid file collisions with system headers. Re-add the path where config.h is located. Namespace and use bracketed file inclusions for libdpkg headers, and use quoted inclusions for program headers.
2009-07-15libdpkg: Rename dpkg-i18n.h to i18n.hGuillem Jover1-1/+1
2009-05-26Fix memory leaks due to not destroying pkg iteratorsGuillem Jover1-0/+1
2008-09-14libdpkg: Move stdlib.h inclusion to its direct includersGuillem Jover1-0/+1
2008-09-14libcompat: Add new compat.h headerGuillem Jover1-0/+1
2008-09-14libdpkg: Move gettext related definitions to a new dpkg-i18n.hGuillem Jover1-0/+2
2008-08-26Merge branch 'lenny' (through tag '1.14.21')Guillem Jover1-6/+8
Conflicts: ChangeLog configure.ac debian/changelog lib/fields.c man/ChangeLog man/dpkg-buildpackage.1 man/po/de.po man/po/dpkg-man.pot man/po/es.po man/po/fr.po man/po/hu.po man/po/ja.po man/po/pl.po man/po/pt_BR.po man/po/ru.po man/po/sv.po po/ChangeLog po/ja.po po/ko.po po/ro.po src/main.c
2008-08-15Fix --no-act in triggers related codeGuillem Jover1-6/+8
Closes: #495097
2008-06-30Switch to use UTF-8 copyright symbol and add missing onesGuillem Jover1-1/+1
Some 'Copyright <year>' entries didn't have a copyright symbol. Add it and switch the rest from '(C)' to '©', but we don't do this on program output which for now should remain pure ascii.
2008-06-19Add a few more comment around obscure bits of trigger handling codeColin Watson1-0/+3
2008-03-30Implement triggers supportIan Jackson1-0/+393
Closes: #17243, #68981, #215374, #217622, #248693, #308285