dpkg 1.22.7-3-g89f48
|
#include <stdbool.h>
#include <dpkg/debug.h>
#include <dpkg/pkg-list.h>
#include "force.h"
#include "actions.h"
#include "security-mac.h"
Go to the source code of this file.
Data Structures | |
struct | perpackagestate |
struct | invoke_hook |
struct | invoke_list |
Enumerations | |
enum | pkg_istobe { PKG_ISTOBE_NORMAL , PKG_ISTOBE_REMOVE , PKG_ISTOBE_INSTALLNEW , PKG_ISTOBE_DECONFIGURE , PKG_ISTOBE_PREINSTALL } |
enum | pkg_cycle_color { PKG_CYCLE_WHITE , PKG_CYCLE_GRAY , PKG_CYCLE_BLACK } |
enum | dep_check { DEP_CHECK_HALT = 0 , DEP_CHECK_DEFER = 1 , DEP_CHECK_OK = 2 } |
enum | dependtry { DEPEND_TRY_NORMAL = 1 , DEPEND_TRY_CYCLES = 2 , DEPEND_TRY_TRIGGERS = 3 , DEPEND_TRY_TRIGGERS_CYCLES = 4 , DEPEND_TRY_FORCE_DEPENDS_VERSION = 5 , DEPEND_TRY_FORCE_DEPENDS = 6 , DEPEND_TRY_LAST } |
enum | trigproc_type { TRIGPROC_TRY_DEFERRED , TRIGPROC_TRY_QUEUED , TRIGPROC_REQUIRED } |
enum | which_pkgbin { wpb_installed , wpb_available , wpb_by_istobe } |
Functions | |
void | ensure_package_clientdata (struct pkginfo *pkg) |
int | archivefiles (const char *const *argv) |
void | process_archive (const char *filename) |
bool | wanttoinstall (struct pkginfo *pkg) |
Decide whether we want to install a new version of the package. | |
int | forgetold (const char *const *argv) |
int | updateavailable (const char *const *argv) |
int | audit (const char *const *argv) |
int | unpackchk (const char *const *argv) |
int | assert_feature (const char *const *argv) |
int | validate_pkgname (const char *const *argv) |
int | validate_trigname (const char *const *argv) |
int | validate_archname (const char *const *argv) |
int | validate_version (const char *const *argv) |
int | predeppackage (const char *const *argv) |
Print a single package which: (a) is the target of one or more relevant predependencies. | |
int | printarch (const char *const *argv) |
int | printinstarch (const char *const *argv) |
int | print_foreign_arches (const char *const *argv) |
int | cmpversions (const char *const *argv) |
bool | verify_set_output (const char *name) |
int | verify (const char *const *argv) |
int | getselections (const char *const *argv) |
int | setselections (const char *const *argv) |
int | clearselections (const char *const *argv) |
void | md5hash (struct pkginfo *pkg, char *hashbuf, const char *fn) |
Generate a file contents MD5 hash. | |
void | enqueue_package (struct pkginfo *pkg) |
void | enqueue_package_mark_seen (struct pkginfo *pkg) |
void | process_queue (void) |
int | packages (const char *const *argv) |
void | removal_bulk (struct pkginfo *pkg) |
int | conffderef (struct pkginfo *pkg, struct varbuf *result, const char *in) |
Dereference a file by following all possibly used symlinks. | |
enum dep_check | dependencies_ok (struct pkginfo *pkg, struct pkginfo *removing, struct varbuf *aemsgs) |
enum dep_check | breakses_ok (struct pkginfo *pkg, struct varbuf *aemsgs) |
void | deferred_remove (struct pkginfo *pkg) |
void | deferred_configure (struct pkginfo *pkg) |
Process the deferred configure package. | |
void | cu_prermremove (int argc, void **argv) |
void | print_error_perpackage (const char *emsg, const void *data) |
void | print_error_perarchive (const char *emsg, const void *data) |
int | reportbroken_retexitstatus (int ret) |
bool | skip_due_to_hold (struct pkginfo *pkg) |
bool | ignore_depends (const struct pkginfo *pkg) |
bool | force_breaks (struct deppossi *possi) |
bool | force_depends (struct deppossi *possi) |
bool | force_conflicts (struct deppossi *possi) |
bool | conffile_is_disappearing (struct conffile *conff) |
Returns whether the conffile is disappearing, because it is obsolete or marked for removal on upgrade. | |
void | conffile_mark_obsolete (struct pkginfo *pkg, struct fsys_namenode *namenode) |
Mark a conffile as obsolete. | |
void | pkg_conffiles_mark_old (struct pkginfo *pkg) |
Mark all package conffiles as old. | |
void | checkpath (void) |
Verify that some programs can be found in the PATH. | |
struct fsys_namenode * | namenodetouse (struct fsys_namenode *namenode, struct pkginfo *pkg, struct pkgbin *pkgbin) |
int | maintscript_installed (struct pkginfo *pkg, const char *scriptname, const char *desc,...) DPKG_ATTR_SENTINEL |
int | maintscript_new (struct pkginfo *pkg, const char *scriptname, const char *desc, const char *cidir, char *cidirrest,...) DPKG_ATTR_SENTINEL |
int | maintscript_fallback (struct pkginfo *pkg, const char *scriptname, const char *desc, const char *cidir, char *cidirrest, const char *ifok, const char *iffallback) |
int | maintscript_postinst (struct pkginfo *pkg,...) DPKG_ATTR_SENTINEL |
void | post_postinst_tasks (struct pkginfo *pkg, enum pkgstatus new_status) |
void | clear_istobes (void) |
bool | dir_is_used_by_others (struct fsys_namenode *namenode, struct pkginfo *pkg) |
bool | dir_is_used_by_pkg (struct fsys_namenode *namenode, struct pkginfo *pkg, struct fsys_namenode_list *list) |
bool | dir_has_conffiles (struct fsys_namenode *namenode, struct pkginfo *pkg) |
void | log_action (const char *action, struct pkginfo *pkg, struct pkgbin *pkgbin) |
void | trigproc_install_hooks (void) |
void | trigproc_populate_deferred (void) |
Populate the deferred trigger queue. | |
void | trigproc_run_deferred (void) |
void | trigproc_reset_cycle (void) |
void | trigproc (struct pkginfo *pkg, enum trigproc_type type) |
void | trig_activate_packageprocessing (struct pkginfo *pkg) |
struct deppossi_pkg_iterator * | deppossi_pkg_iter_new (struct deppossi *possi, enum which_pkgbin wpb) |
struct pkginfo * | deppossi_pkg_iter_next (struct deppossi_pkg_iterator *iter) |
void | deppossi_pkg_iter_free (struct deppossi_pkg_iterator *iter) |
bool | depisok (struct dependency *dep, struct varbuf *whynot, struct pkginfo **fixbyrm, struct pkginfo **fixbytrigaw, bool allowunconfigd) |
bool | findbreakcycle (struct pkginfo *pkg) |
void | describedepcon (struct varbuf *addto, struct dependency *dep) |
Variables | |
const char *const | statusstrings [] |
int | f_robot |
int | f_pending |
int | f_recursive |
int | f_alsoselect |
int | f_skipsame |
int | f_noact |
int | f_autodeconf |
int | f_nodebsig |
int | f_triggers |
bool | abort_processing |
int | errabort |
struct pkg_list * | ignoredependss |
const char * | assert_feature_name |
enum dependtry | dependtry |
int | sincenothing |
enum dep_check |
enum dependtry |
enum pkg_cycle_color |
enum pkg_istobe |
enum trigproc_type |
enum which_pkgbin |
int archivefiles | ( | const char *const * | argv | ) |
References _, abort_processing, act_avail, act_configure, act_install, act_purge, act_remove, act_triggers, act_unpack, cmdinfo::arg_int, badusage(), checkpath(), cipaction, DEBEXT, dpkg_fsys_get_dir(), dpkg_selabel_close(), dpkg_selabel_load(), ehflag_bombout, ehflag_normaltidy, ensure_diversions(), ensure_statoverrides(), f_noact, f_recursive, fname_state, fnamenew_state, fnamenewvb, fnametmp_state, fnametmpvb, fnamevb, FORCE_NON_ROOT, in_force(), internerr, log_message(), m_output(), m_realloc(), m_strdup(), modstatdb_open(), modstatdb_rw, modstatdb_shutdown(), msdbrw_available_write, msdbrw_needsuperuser, msdbrw_readonly, msdbrw_write, ohshit(), ohshite(), cmdinfo::olong, onerr_abort, pkg_infodb_upgrade(), pop_error_context(), print_error_perarchive(), process_archive(), process_queue(), push_error_context_jump(), STATDB_PARSE_NORMAL, treenode_get_mode(), treenode_get_pathname(), treewalk_close(), TREEWALK_FOLLOW_LINKS, treewalk_next(), treewalk_open(), trigproc_install_hooks(), trigproc_run_deferred(), dependency::type, varbuf_add_str, varbuf_reset(), and varbuf_snapshot().
int assert_feature | ( | const char *const * | argv | ) |
References _, assert_feature(), assert_feature_name, badusage(), cipaction, dpkg_get_progname(), and cmdinfo::olong.
Referenced by assert_feature().
int audit | ( | const char *const * | argv | ) |
References _, audit_problem::check, audit_problem::explanation, head, m_output(), modstatdb_is_locked(), modstatdb_open(), msdbrw_readonly, pkg_array::n_pkgs, pkg_array_destroy(), pkg_array_init_from_hash(), pkg_array_init_from_names(), pkg_array_sort(), pkg_sorter_by_nonambig_name_arch(), and pkg_array::pkgs.
References dbg_depcon, dbg_depcondetail, debug(), DEP_CHECK_OK, dep_provides, pkgbin::depends, deppossi::ed, pkginfo::installed, dependency::list, pkgset::name, dependency::next, pkginfo::set, and dependency::type.
Referenced by deferred_configure().
void checkpath | ( | void | ) |
Verify that some programs can be found in the PATH.
References _, BACKEND, command_in_path(), DIFF, FORCE_BAD_PATH, forcibleerr(), P_, RM, and warning().
Referenced by archivefiles(), and packages().
void clear_istobes | ( | void | ) |
References pkginfo::clientdata, ensure_package_clientdata(), perpackagestate::istobe, pkg_hash_iter_free(), pkg_hash_iter_new(), pkg_hash_iter_next_pkg(), PKG_ISTOBE_NORMAL, and perpackagestate::replacingfilesandsaid.
Referenced by predeppackage(), process_archive(), and process_queue().
int clearselections | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, pkgbin::essential, f_noact, pkginfo::installed, pkgbin::is_protected, modstatdb_open(), modstatdb_rw, modstatdb_shutdown(), msdbrw_readonly, msdbrw_write, cmdinfo::olong, pkg_hash_iter_free(), pkg_hash_iter_new(), pkg_hash_iter_next_pkg(), pkg_infodb_upgrade(), pkg_set_want(), PKG_WANT_DEINSTALL, PKG_WANT_UNKNOWN, dpkg_error::type, and pkginfo::want.
int cmpversions | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, dbg_general, debug(), dpkg_error_destroy(), dpkg_error_print(), dpkg_version_blank(), dpkg_version_compare(), dpkg_version_is_informative(), cmdinfo::olong, parseversion(), dpkg_error::type, vdew_always, versiondescribe_c(), and warning().
Dereference a file by following all possibly used symlinks.
[in] | pkg | The package to act on. |
[out] | result | The dereference conffile path. |
[in] | in | The conffile path to dereference. |
0 | Everything went ok. |
-1 | Otherwise. |
References _, varbuf::buf, dbg_conff, dbg_conffdetail, debug(), dpkg_fsys_get_dir(), file_readlink(), pkg_name(), pnaw_nonambig, varbuf::used, varbuf_add_str, varbuf_add_varbuf(), VARBUF_INIT, varbuf_set_str, varbuf_str(), varbuf_trunc(), and warning().
Referenced by tarobject().
bool conffile_is_disappearing | ( | struct conffile * | conff | ) |
Returns whether the conffile is disappearing, because it is obsolete or marked for removal on upgrade.
References CONFFILE_OBSOLETE, CONFFILE_REMOVE_ON_UPGRADE, and conffile::flags.
Referenced by deferred_configure(), and dir_has_conffiles().
void conffile_mark_obsolete | ( | struct pkginfo * | pkg, |
struct fsys_namenode * | namenode | ||
) |
Mark a conffile as obsolete.
pkg | The package owning the conffile. |
namenode | The namenode for the obsolete conffile. |
References CONFFILE_OBSOLETE, pkgbin::conffiles, dbg_conff, debug(), conffile::flags, pkginfo::installed, conffile::name, fsys_namenode::name, conffile::next, pkg_name(), and pnaw_always.
void cu_prermremove | ( | int | argc, |
void ** | argv | ||
) |
References cleanup_pkg_failed, maintscript_postinst(), pkg_clear_eflags(), PKG_EFLAG_REINSTREQ, and post_postinst_tasks().
Referenced by deferred_remove().
void deferred_configure | ( | struct pkginfo * | pkg | ) |
Process the deferred configure package.
pkg | The package to act on. |
References _, pkginfo::arch_next, breakses_ok(), pkginfo::clientdata, conffile_is_disappearing(), pkgbin::conffiles, pkginfo::configversion, dbg_general, debug(), DEP_CHECK_DEFER, DEP_CHECK_HALT, DEPEND_TRY_CYCLES, dependencies_ok(), dpkg_version_compare(), dpkg_version_is_informative(), pkginfo::eflag, enqueue_package(), ensure_package_clientdata(), f_noact, findbreakcycle(), FORCE_REMOVE_REINSTREQ, forcibleerr(), pkginfo::installed, internerr, perpackagestate::istobe, log_action(), maintscript_postinst(), modstatdb_note(), conffile::next, notice(), ohshit(), pkgset::pkg, PKG_EFLAG_REINSTREQ, PKG_ISTOBE_INSTALLNEW, PKG_ISTOBE_NORMAL, pkg_name(), pkg_reset_eflags(), pkg_set_status(), PKG_STAT_CONFIGFILES, PKG_STAT_HALFCONFIGURED, PKG_STAT_INSTALLED, PKG_STAT_NOTINSTALLED, PKG_STAT_UNPACKED, pkg_status_name(), pnaw_always, pnaw_nonambig, post_postinst_tasks(), pkginfo::set, sincenothing, pkginfo::status, trig_activate_packageprocessing(), pkginfo::trigpend_head, trigproc_reset_cycle(), varbuf::used, varbuf_destroy(), VARBUF_INIT, varbuf_str(), vdew_nonambig, pkgbin::version, and versiondescribe().
Referenced by process_queue().
void deferred_remove | ( | struct pkginfo * | pkg | ) |
References _, act_purge, cmdinfo::arg_int, cipaction, pkginfo::clientdata, cu_prermremove(), dbg_depcon, dbg_general, debug(), DEP_CHECK_DEFER, DEP_CHECK_HALT, DEP_CHECK_OK, dep_provides, pkgbin::depends, pkginfo::eflag, ehflag_normaltidy, enqueue_package(), ensure_allinstfiles_available(), ensure_package_clientdata(), pkgbin::essential, f_noact, f_pending, FORCE_REMOVE_ESSENTIAL, FORCE_REMOVE_PROTECTED, FORCE_REMOVE_REINSTREQ, forcibleerr(), fsys_hash_init(), pkginfo::installed, pkgbin::is_protected, perpackagestate::istobe, log_action(), maintscript_installed(), modstatdb_note(), notice(), ohshit(), pkg_conffiles_mark_old(), PKG_EFLAG_REINSTREQ, PKG_ISTOBE_NORMAL, PKG_ISTOBE_REMOVE, pkg_name(), pkg_set_status(), pkg_set_want(), PKG_STAT_CONFIGFILES, PKG_STAT_HALFCONFIGURED, PKG_STAT_NOTINSTALLED, PKG_STAT_UNPACKED, PKG_WANT_DEINSTALL, PKG_WANT_PURGE, PKG_WANT_UNKNOWN, pnaw_always, pnaw_nonambig, PRERMFILE, push_cleanup(), removal_bulk(), pkginfo::set, sincenothing, pkginfo::status, trig_activate_packageprocessing(), dependency::type, varbuf_destroy(), VARBUF_INIT, varbuf_str(), vdew_nonambig, pkgbin::version, versiondescribe(), pkginfo::want, and warning().
Referenced by process_queue().
enum dep_check dependencies_ok | ( | struct pkginfo * | pkg, |
struct pkginfo * | removing, | ||
struct varbuf * | aemsgs | ||
) |
References _, pkginfo::clientdata, dbg_depcon, dbg_depcondetail, debug(), DEP_CHECK_DEFER, DEP_CHECK_HALT, DEP_CHECK_OK, dep_depends, dep_predepends, dep_provides, deparchsatisfied(), DEPEND_TRY_FORCE_DEPENDS, pkgset::depended, pkgbin::depends, deppossi_pkg_iter_free(), deppossi_pkg_iter_new(), deppossi_pkg_iter_next(), deppossi::ed, FORCE_DEPENDS, FOUND_DEFER, FOUND_FORCED, FOUND_NONE, FOUND_OK, in_force(), pkginfo::installed, pkgset::installed, internerr, perpackagestate::istobe, dependency::list, dependency::next, deppossi::next, PKG_ISTOBE_REMOVE, pkg_name(), pnaw_always, pnaw_nonambig, deppossi::rev_next, dependency::type, varbuf_add_pkgbin_name(), varbuf_add_str, varbuf_add_varbuf(), varbuf_destroy(), VARBUF_INIT, varbuf_reset(), varbuf_str(), varbufdependency(), and wpb_installed.
Referenced by deferred_configure(), and trigproc().
bool depisok | ( | struct dependency * | dep, |
struct varbuf * | whynot, | ||
struct pkginfo ** | fixbyrm, | ||
struct pkginfo ** | fixbytrigaw, | ||
bool | allowunconfigd | ||
) |
References _, pkginfo::available, pkgset::available, pkginfo::clientdata, pkginfo::configversion, dep_breaks, dep_conflicts, dep_depends, dep_enhances, dep_predepends, dep_provides, dep_recommends, dep_suggests, pkgset::depended, deppossi_pkg_iter_free(), deppossi_pkg_iter_new(), deppossi_pkg_iter_next(), describedepcon(), dpkg_version_is_informative(), dpkg_version_relate(), deppossi::ed, pkginfo::installed, pkgset::installed, internerr, perpackagestate::istobe, dependency::list, pkgset::name, deppossi::next, PKG_ISTOBE_DECONFIGURE, PKG_ISTOBE_INSTALLNEW, PKG_ISTOBE_NORMAL, PKG_ISTOBE_PREINSTALL, PKG_ISTOBE_REMOVE, pkg_name(), PKG_STAT_CONFIGFILES, PKG_STAT_HALFCONFIGURED, PKG_STAT_HALFINSTALLED, PKG_STAT_INSTALLED, PKG_STAT_NOTINSTALLED, PKG_STAT_TRIGGERSAWAITED, PKG_STAT_TRIGGERSPENDING, PKG_STAT_UNPACKED, pkg_virtual_deppossi_satisfied(), pkgbin_name(), pnaw_nonambig, deppossi_pkg_iterator::possi, deppossi::rev_next, pkginfo::set, pkginfo::status, statusstrings, dependency::type, dependency::up, deppossi::up, varbuf_add_char(), varbuf_add_str, varbuf_reset(), vdew_nonambig, deppossi::verrel, deppossi::version, pkgbin::version, versiondescribe(), versionsatisfied(), and wpb_by_istobe.
Referenced by check_breaks(), check_conflict(), and predeppackage().
void deppossi_pkg_iter_free | ( | struct deppossi_pkg_iterator * | iter | ) |
Referenced by dependencies_ok(), depisok(), and predeppackage().
struct deppossi_pkg_iterator * deppossi_pkg_iter_new | ( | struct deppossi * | possi, |
enum which_pkgbin | wpb | ||
) |
References deppossi::ed, m_malloc(), pkgset::pkg, deppossi_pkg_iterator::pkg_next, deppossi_pkg_iterator::possi, and deppossi_pkg_iterator::which_pkgbin.
Referenced by dependencies_ok(), depisok(), and predeppackage().
struct pkginfo * deppossi_pkg_iter_next | ( | struct deppossi_pkg_iterator * | iter | ) |
References pkginfo::arch_next, archsatisfied(), pkginfo::available, pkginfo::clientdata, pkginfo::installed, internerr, perpackagestate::istobe, PKG_ISTOBE_INSTALLNEW, deppossi_pkg_iterator::pkg_next, deppossi_pkg_iterator::possi, deppossi_pkg_iterator::which_pkgbin, wpb_available, wpb_by_istobe, and wpb_installed.
Referenced by dependencies_ok(), depisok(), and predeppackage().
void describedepcon | ( | struct varbuf * | addto, |
struct dependency * | dep | ||
) |
References _, varbuf::buf, dep_breaks, dep_conflicts, dep_depends, dep_enhances, dep_predepends, dep_recommends, dep_suggests, internerr, pkg_name(), pnaw_nonambig, dependency::type, dependency::up, varbuf_destroy(), VARBUF_INIT, varbuf_printf(), and varbufdependency().
Referenced by depisok(), and predeppackage().
bool dir_has_conffiles | ( | struct fsys_namenode * | namenode, |
struct pkginfo * | pkg | ||
) |
References conffile_is_disappearing(), pkgbin::conffiles, dbg_veryverbose, debug(), pkginfo::installed, conffile::name, file::name, conffile::next, pkg_name(), and pnaw_always.
bool dir_is_used_by_others | ( | struct fsys_namenode * | namenode, |
struct pkginfo * | pkg | ||
) |
References dbg_veryverbose, debug(), fsys_node_pkgs_iter_free(), fsys_node_pkgs_iter_new(), fsys_node_pkgs_iter_next(), file::name, pkg_name(), and pnaw_always.
bool dir_is_used_by_pkg | ( | struct fsys_namenode * | namenode, |
struct pkginfo * | pkg, | ||
struct fsys_namenode_list * | list | ||
) |
References dbg_veryverbose, debug(), fsys_namenode::name, file::name, fsys_namenode_list::namenode, fsys_namenode_list::next, pkg_name(), and pnaw_always.
void enqueue_package | ( | struct pkginfo * | pkg | ) |
References pkginfo::clientdata, perpackagestate::enqueued, ensure_package_clientdata(), and pkg_queue_push().
Referenced by deferred_configure(), deferred_remove(), enqueue_package_mark_seen(), ok_prermdeconfigure(), process_queue(), and trigproc().
void enqueue_package_mark_seen | ( | struct pkginfo * | pkg | ) |
References pkginfo::clientdata, perpackagestate::cmdline_seen, and enqueue_package().
Referenced by process_archive().
void ensure_package_clientdata | ( | struct pkginfo * | pkg | ) |
References pkginfo::clientdata, perpackagestate::cmdline_seen, perpackagestate::color, perpackagestate::enqueued, perpackagestate::istobe, nfmalloc(), PKG_CYCLE_WHITE, PKG_ISTOBE_NORMAL, perpackagestate::replacingfilesandsaid, and perpackagestate::trigprocdeferred.
Referenced by check_breaks(), check_conflict(), clear_istobes(), deferred_configure(), deferred_remove(), enqueue_deconfigure(), enqueue_package(), findbreakcycle(), process_queue(), tarobject(), trigproc(), and trigproc_run_deferred().
bool findbreakcycle | ( | struct pkginfo * | pkg | ) |
References pkginfo::clientdata, perpackagestate::color, ensure_package_clientdata(), PKG_CYCLE_WHITE, pkg_hash_iter_free(), pkg_hash_iter_new(), and pkg_hash_iter_next_pkg().
Referenced by deferred_configure(), and trigproc().
bool force_breaks | ( | struct deppossi * | possi | ) |
References FORCE_BREAKS, ignore_depends(), in_force(), dependency::up, and deppossi::up.
Referenced by check_breaks().
bool force_conflicts | ( | struct deppossi * | possi | ) |
References FORCE_CONFLICTS, and in_force().
Referenced by check_conflict().
bool force_depends | ( | struct deppossi * | possi | ) |
References FORCE_DEPENDS, ignore_depends(), in_force(), dependency::up, and deppossi::up.
int forgetold | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, cmdinfo::olong, and warning().
int getselections | ( | const char *const * | argv | ) |
References _, pkginfo::installed, m_output(), modstatdb_open(), modstatdb_shutdown(), msdbrw_readonly, pkg_array::n_pkgs, notice(), pkg_array_destroy(), pkg_array_init_from_hash(), pkg_array_sort(), pkg_sorter_by_nonambig_name_arch(), PKG_SPEC_ARCH_WILDCARD, pkg_spec_destroy(), pkg_spec_init(), pkg_spec_match_pkg(), pkg_spec_parse(), PKG_SPEC_PATTERNS, PKG_STAT_NOTINSTALLED, pkg_array::pkgs, and pkginfo::status.
bool ignore_depends | ( | const struct pkginfo * | pkg | ) |
References ignoredependss, pkg_list::next, and pkg_list::pkg.
Referenced by force_breaks(), and force_depends().
References pkginfo::available, pkginfo::installed, log_message(), pkgbin_name(), pnaw_always, pnaw_nonambig, statusfd_send(), vdew_nonambig, pkgbin::version, and versiondescribe_c().
Referenced by deferred_configure(), deferred_remove(), process_archive(), and trigproc().
int maintscript_fallback | ( | struct pkginfo * | pkg, |
const char * | scriptname, | ||
const char * | desc, | ||
const char * | cidir, | ||
char * | cidirrest, | ||
const char * | ifok, | ||
const char * | iffallback | ||
) |
References _, pkginfo::available, command_add_args(), command_destroy(), command_init(), dbg_scripts, debug(), pkginfo::installed, m_asprintf(), command::name, notice(), ohshit(), ohshite(), pkg_infodb_get_file(), pkg_name(), pnaw_nonambig, SUBPROC_WARN, vdew_nonambig, pkgbin::version, versiondescribe(), and warning().
Referenced by process_archive().
int maintscript_installed | ( | struct pkginfo * | pkg, |
const char * | scriptname, | ||
const char * | desc, | ||
... | |||
) |
References args.
Referenced by cu_postrmupgrade(), deferred_remove(), and process_archive().
int maintscript_new | ( | struct pkginfo * | pkg, |
const char * | scriptname, | ||
const char * | desc, | ||
const char * | cidir, | ||
char * | cidirrest, | ||
... | |||
) |
References _, args, pkginfo::available, command_add_arg(), command_add_argv(), command_destroy(), command_init(), dbg_scripts, debug(), m_asprintf(), ohshite(), pkg_name(), and pnaw_nonambig.
Referenced by cu_preinstnew(), cu_preinstupgrade(), cu_preinstverynew(), and process_archive().
int maintscript_postinst | ( | struct pkginfo * | pkg, |
... | |||
) |
References args, ensure_diversions(), and POSTINSTFILE.
Referenced by cu_prermdeconfigure(), cu_prerminfavour(), cu_prermremove(), cu_prermupgrade(), deferred_configure(), and trigproc().
void md5hash | ( | struct pkginfo * | pkg, |
char * | hashbuf, | ||
const char * | fn | ||
) |
Generate a file contents MD5 hash.
The caller is responsible for providing a buffer for the hash result at least MD5HASHLEN + 1 characters long.
[in] | pkg | The package to act on. |
[out] | hashbuf | The buffer to store the generated hash. |
[in] | fn | The filename. |
References _, cu_closefd(), ehflag_bombout, ehflag_normaltidy, EMPTYHASHFLAG, fd_md5, NONEXISTENTFLAG, ohshit(), pkg_name(), pnaw_nonambig, pop_cleanup(), push_cleanup(), dpkg_error::str, dpkg_error::type, and warning().
Referenced by tarobject().
struct fsys_namenode * namenodetouse | ( | struct fsys_namenode * | namenode, |
struct pkginfo * | pkg, | ||
struct pkgbin * | pkgbin | ||
) |
References fsys_diversion::camefrom, dbg_eachfile, debug(), fsys_namenode::divert, pkgset::name, fsys_namenode::name, pkgbin_name(), fsys_diversion::pkgset, pnaw_always, pkginfo::set, and fsys_diversion::useinstead.
Referenced by tar_deferred_extract(), and tarobject().
int packages | ( | const char *const * | argv | ) |
References _, badusage(), checkpath(), cipaction, ensure_diversions(), f_noact, f_pending, FORCE_NON_ROOT, in_force(), log_message(), modstatdb_open(), modstatdb_shutdown(), msdbrw_needsuperuser, msdbrw_readonly, msdbrw_write, cmdinfo::olong, pkg_infodb_upgrade(), process_queue(), trigproc_install_hooks(), and trigproc_run_deferred().
void pkg_conffiles_mark_old | ( | struct pkginfo * | pkg | ) |
Mark all package conffiles as old.
pkg | The package owning the conffiles. |
References pkgbin::conffiles, dbg_conffdetail, debug(), FHFF_NONE, fsys_namenode::flags, FNNF_OLD_CONFF, fsys_hash_find_node(), conffile::hash, pkginfo::installed, conffile::name, fsys_namenode::name, conffile::next, and fsys_namenode::oldhash.
Referenced by deferred_remove(), and process_archive().
References dbg_triggersdetail, debug(), pkginfo::head, modstatdb_get_status(), modstatdb_note(), pkg_set_status(), PKG_STAT_INSTALLED, PKG_STAT_TRIGGERSAWAITED, PKG_STAT_TRIGGERSPENDING, trig_incorporate(), pkginfo::trigaw, and pkginfo::trigpend_head.
Referenced by cu_prermdeconfigure(), cu_prerminfavour(), cu_prermremove(), cu_prermupgrade(), deferred_configure(), and trigproc().
int predeppackage | ( | const char *const * | argv | ) |
Print a single package which: (a) is the target of one or more relevant predependencies.
(b) has itself no unsatisfied pre-dependencies.
If such a package is present output is the Packages file entry, which can be massaged as appropriate.
Exit status: 0 = a package printed, OK 1 = no suitable package available 2 = error
References _, pkginfo::archives, pkginfo::available, pkgset::available, badusage(), varbuf::buf, cipaction, clear_istobes(), pkginfo::clientdata, dep_predepends, dep_provides, pkgset::depended, pkgbin::depends, depisok(), deppossi_pkg_iter_free(), deppossi_pkg_iter_new(), deppossi_pkg_iter_next(), describedepcon(), deppossi::ed, internerr, perpackagestate::istobe, dependency::list, m_output(), modstatdb_open(), msdbrw_available_readonly, msdbrw_readonly, dependency::next, deppossi::next, notice(), ohshit(), cmdinfo::olong, pkg_hash_iter_free(), pkg_hash_iter_new(), pkg_hash_iter_next_pkg(), PKG_ISTOBE_NORMAL, PKG_ISTOBE_PREINSTALL, pkg_virtual_deppossi_satisfied(), PKG_WANT_INSTALL, pkgbin_name(), pnaw_nonambig, deppossi_pkg_iterator::possi, dependency::type, dependency::up, varbuf_reset(), versionsatisfied(), pkginfo::want, wpb_available, and write_stanza().
void print_error_perarchive | ( | const char * | emsg, |
const void * | data | ||
) |
References _, cipaction, notice(), cmdinfo::olong, and statusfd_send().
Referenced by archivefiles().
void print_error_perpackage | ( | const char * | emsg, |
const void * | data | ||
) |
References _, cipaction, notice(), cmdinfo::olong, and statusfd_send().
Referenced by process_queue(), and trigproc_run_deferred().
int print_foreign_arches | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, DPKG_ARCH_FOREIGN, dpkg_arch_get_list(), dpkg_arch_load_list(), m_output(), dpkg_arch::name, dpkg_arch::next, cmdinfo::olong, and dpkg_arch::type.
int printarch | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, dpkg_arch_get(), DPKG_ARCH_NATIVE, m_output(), and cmdinfo::olong.
int printinstarch | ( | const char *const * | argv | ) |
void process_archive | ( | const char * | filename | ) |
References _, act_avail, act_install, pkgbin::arch, pkginfo::arch_next, pkginfo::archives, cmdinfo::arg_int, pkginfo::available, BACKEND, tarcontext::backendpipe, cipaction, cleanup_conflictor_failed, cleanup_pkg_failed, clear_deconfigure_queue(), clear_istobes(), CONFFILESFILE, CONTROLFILE, tar_archive::ctx, cu_cidir(), cu_closepipe(), cu_fileslist(), cu_postrmupgrade(), cu_preinstnew(), cu_preinstupgrade(), cu_preinstverynew(), cu_prerminfavour(), cu_prermupgrade(), dbg_general, debug(), dir_sync_contents(), DPKG_ARCH_ALL, DPKG_ARCH_FOREIGN, dpkg_arch_get(), DPKG_ARCH_NATIVE, DPKG_ERROR_OBJECT, dpkg_error_print(), dpkg_version_compare(), ehflag_bombout, ehflag_normaltidy, enqueue_deconfigure(), enqueue_package_mark_seen(), ensure_allinstfiles_available(), tar_archive::err, f_noact, f_nodebsig, fd_skip, FORCE_ARCHITECTURE, FORCE_BAD_VERSION, forcibleerr(), fsys_hash_init(), fsys_namenode_queue::head, pkg_queue::head, in_force(), pkginfo::installed, internerr, log_action(), m_dup2(), m_pipe(), maintscript_fallback(), maintscript_installed(), maintscript_new(), archivedetails::md5sum, modstatdb_note(), archivedetails::msdosname, pkgbin::multiarch, dpkg_arch::name, archivedetails::name, tarcontext::newfiles_queue, archivedetails::next, pkg_list::next, nfmalloc(), ohshit(), ohshite(), tar_archive::ops, parsedb(), parsedbflags, pdb_ignore_archives, pdb_lax_version_parser, pdb_parse_available, pdb_parse_binary, pkgset::pkg, pkg_list::pkg, tarcontext::pkg, pkg_blank(), pkg_conffiles_mark_old(), PKG_EFLAG_REINSTREQ, pkg_infodb_get_file(), pkg_name(), pkg_queue_is_empty(), pkg_queue_pop(), pkg_reset_eflags(), pkg_set_eflags(), pkg_set_status(), pkg_set_want(), PKG_STAT_CONFIGFILES, PKG_STAT_HALFCONFIGURED, PKG_STAT_HALFINSTALLED, PKG_STAT_INSTALLED, PKG_STAT_NOTINSTALLED, PKG_STAT_TRIGGERSAWAITED, PKG_STAT_TRIGGERSPENDING, PKG_STAT_UNPACKED, pkg_status_name(), PKG_WANT_INSTALL, PKG_WANT_UNKNOWN, pkgbin_name(), tarcontext::pkgset_getting_in_sync, pnaw_always, pnaw_nonambig, pop_cleanup(), POSTRMFILE, PREINSTFILE, PRERMFILE, push_checkpoint(), push_cleanup(), tar_operations::read, removal_bulk(), pkginfo::set, archivedetails::size, pkginfo::status, statusstrings, dpkg_error::str, subproc_fork(), SUBPROC_NOPIPE, subproc_reap(), fsys_namenode_queue::tail, tar_deferred_extract(), tar_extractor(), tarfileread(), tarobject(), trig_activate_packageprocessing(), trig_cicb_interest_add(), trig_cicb_interest_delete(), trig_cicb_statuschange_activate(), trig_file_interests_ensure(), trig_file_interests_save(), trig_parse_ci(), TRIGGERSCIFILE, dpkg_arch::type, dpkg_error::type, vdew_nonambig, pkgbin::version, versiondescribe(), wanttoinstall(), write_filehash_except(), and write_filelist_except().
Referenced by archivefiles().
void process_queue | ( | void | ) |
References _, abort_processing, act_configure, act_install, act_purge, act_remove, act_triggers, cmdinfo::arg_int, cipaction, clear_istobes(), pkginfo::clientdata, perpackagestate::cmdline_seen, dbg_general, debug(), deferred_configure(), deferred_remove(), DEPEND_TRY_LAST, DEPEND_TRY_TRIGGERS, ehflag_bombout, ehflag_normaltidy, enqueue_package(), perpackagestate::enqueued, ensure_package_clientdata(), pkg_queue::head, internerr, perpackagestate::istobe, pkg_queue::length, m_output(), pkg_list::next, ohshit(), pkg_list::pkg, PKG_ISTOBE_INSTALLNEW, PKG_ISTOBE_NORMAL, PKG_ISTOBE_REMOVE, pkg_name(), pkg_queue_is_empty(), pkg_queue_pop(), PKG_STAT_INSTALLED, PKG_STAT_NOTINSTALLED, pkg_status_name(), pnaw_always, pnaw_nonambig, pop_error_context(), print_error_perpackage(), push_error_context_jump(), sincenothing, pkginfo::status, pkginfo::trigpend_head, trigproc(), and TRIGPROC_TRY_QUEUED.
Referenced by archivefiles(), and packages().
void removal_bulk | ( | struct pkginfo * | pkg | ) |
References _, pkgbin::conffiles, pkginfo::configversion, dbg_general, debug(), dpkg_version_blank(), pkginfo::installed, LISTFILE, modstatdb_note(), ohshite(), pkg_infodb_get_file(), pkg_infodb_has_file(), pkg_name(), pkg_reset_eflags(), pkg_set_status(), pkg_set_want(), PKG_STAT_HALFINSTALLED, PKG_STAT_NOTINSTALLED, PKG_STAT_UNPACKED, PKG_WANT_PURGE, PKG_WANT_UNKNOWN, pkgbin_blank(), pnaw_always, POSTRMFILE, pkginfo::status, and pkginfo::want.
Referenced by deferred_remove(), and process_archive().
int reportbroken_retexitstatus | ( | int | ret | ) |
References _, abort_processing, error_report::next, and error_report::what.
Referenced by main().
int setselections | ( | const char *const * | argv | ) |
References _, pkginfo::available, badusage(), cipaction, f_noact, pkginfo::installed, modstatdb_open(), modstatdb_rw, modstatdb_shutdown(), msdbrw_available_readonly, msdbrw_readonly, msdbrw_write, namevalue_find_by_name(), ohshit(), ohshite(), cmdinfo::olong, pkg_infodb_upgrade(), pkg_is_informative(), pkg_set_want(), pkg_spec_parse_pkg(), dpkg_error::str, dpkg_error::type, varbuf_add_char(), varbuf_destroy(), VARBUF_INIT, varbuf_reset(), varbuf_str(), wantinfos, and warning().
bool skip_due_to_hold | ( | struct pkginfo * | pkg | ) |
References _, FORCE_HOLD, in_force(), notice(), pkg_name(), PKG_WANT_HOLD, pnaw_nonambig, and pkginfo::want.
Referenced by check_conflict().
void trig_activate_packageprocessing | ( | struct pkginfo * | pkg | ) |
References dbg_triggersdetail, debug(), pkginfo::installed, pkg_infodb_get_file(), pkg_name(), pnaw_always, trig_cicb_statuschange_activate(), trig_parse_ci(), and TRIGGERSCIFILE.
Referenced by deferred_configure(), deferred_remove(), and process_archive().
void trigproc | ( | struct pkginfo * | pkg, |
enum trigproc_type | type | ||
) |
References _, pkginfo::clientdata, dbg_triggers, debug(), DEP_CHECK_DEFER, DEP_CHECK_HALT, DEPEND_TRY_CYCLES, DEPEND_TRY_TRIGGERS, DEPEND_TRY_TRIGGERS_CYCLES, dependencies_ok(), enqueue_package(), ensure_package_clientdata(), f_noact, findbreakcycle(), pkginfo::installed, internerr, log_action(), maintscript_postinst(), modstatdb_note(), trigpend::name, trigpend::next, notice(), ohshit(), pkg_list::pkg, pkg_name(), pkg_set_status(), PKG_STAT_HALFCONFIGURED, PKG_STAT_INSTALLED, PKG_STAT_TRIGGERSAWAITED, PKG_STAT_TRIGGERSPENDING, pkg_status_name(), pnaw_always, pnaw_nonambig, post_postinst_tasks(), sincenothing, pkginfo::status, trig_clear_awaiters(), pkginfo::trigpend_head, trigproc_reset_cycle(), TRIGPROC_TRY_DEFERRED, TRIGPROC_TRY_QUEUED, perpackagestate::trigprocdeferred, varbuf::used, varbuf_add_char(), varbuf_add_str, varbuf_destroy(), VARBUF_INIT, varbuf_reset(), varbuf_str(), vdew_nonambig, pkgbin::version, and versiondescribe().
Referenced by process_queue(), and trigproc_run_deferred().
void trigproc_install_hooks | ( | void | ) |
References trig_override_hooks().
Referenced by archivefiles(), and packages().
void trigproc_populate_deferred | ( | void | ) |
Populate the deferred trigger queue.
When dpkg is called with a specific set of packages to act on, we might have packages pending trigger processing. But because there are frontends that do not perform a final «dpkg –configure –pending» call (i.e. apt), the system is left in a state with packages not fully installed.
We have to populate the deferred trigger queue from the entire package database, so that we might try to do opportunistic trigger processing when going through the deferred trigger queue, because a fixed apt will not request the necessary processing anyway.
XXX: This can be removed once apt is fixed in the next stable release.
References pkg_hash_iter_free(), pkg_hash_iter_new(), pkg_hash_iter_next_pkg(), PKG_STAT_TRIGGERSAWAITED, PKG_STAT_TRIGGERSPENDING, PKG_WANT_HOLD, PKG_WANT_INSTALL, pkginfo::status, pkginfo::trigpend_head, and pkginfo::want.
void trigproc_reset_cycle | ( | void | ) |
void trigproc_run_deferred | ( | void | ) |
References pkginfo::clientdata, dbg_triggers, debug(), ehflag_bombout, ehflag_normaltidy, ensure_package_clientdata(), pkg_name(), pkg_queue_is_empty(), pkg_queue_pop(), pnaw_nonambig, pop_error_context(), print_error_perpackage(), push_error_context_jump(), trigproc(), TRIGPROC_TRY_DEFERRED, and perpackagestate::trigprocdeferred.
Referenced by archivefiles(), and packages().
int unpackchk | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, sectionentry::count, m_output(), modstatdb_open(), msdbrw_readonly, sectionentry::name, sectionentry::next, nfmalloc(), cmdinfo::olong, P_, pkg_hash_iter_free(), pkg_hash_iter_new(), pkg_hash_iter_next_pkg(), pkg_name(), and pnaw_nonambig.
int updateavailable | ( | const char *const * | argv | ) |
References _, act_avclear, act_avmerge, act_avreplace, cmdinfo::arg_int, AVAILFILE, badusage(), cipaction, dpkg_db_get_dir(), dpkg_db_get_path(), f_noact, internerr, modstatdb_done(), modstatdb_init(), modstatdb_lock(), modstatdb_unlock(), ohshit(), ohshite(), cmdinfo::olong, P_, parsedb(), pdb_dash_is_stdin, pdb_ignoreolder, pdb_parse_available, wdb_dump_available, and writedb().
int validate_archname | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, dpkg_arch_name_is_illegal(), ohshit(), cmdinfo::olong, and dpkg_arch::type.
int validate_pkgname | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, ohshit(), cmdinfo::olong, pkg_name_is_illegal(), and dpkg_arch::type.
int validate_trigname | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, ohshit(), cmdinfo::olong, trig_name_is_illegal(), and dpkg_arch::type.
int validate_version | ( | const char *const * | argv | ) |
References _, badusage(), cipaction, dpkg_error_destroy(), dpkg_error_print(), cmdinfo::olong, parseversion(), and dpkg_version::version.
int verify | ( | const char *const * | argv | ) |
References _, cipaction, dpkg_options_parse_pkgname(), ensure_diversions(), m_output(), modstatdb_open(), modstatdb_shutdown(), msdbrw_readonly, notice(), pkg_hash_iter::pkg, pkg_hash_iter_free(), pkg_hash_iter_new(), pkg_hash_iter_next_pkg(), pkg_name(), PKG_STAT_NOTINSTALLED, pnaw_nonambig, and pkginfo::status.
bool verify_set_output | ( | const char * | name | ) |
bool wanttoinstall | ( | struct pkginfo * | pkg | ) |
Decide whether we want to install a new version of the package.
pkg | The package with the version we might want to install |
true | If the package should be skipped. |
false | If the package should be installed. |
References _, pkgbin::arch, pkginfo::available, dpkg_version_compare(), pkginfo::eflag, f_alsoselect, f_skipsame, FORCE_DOWNGRADE, in_force(), pkginfo::installed, notice(), PKG_EFLAG_REINSTREQ, pkg_name(), PKG_STAT_UNPACKED, PKG_WANT_HOLD, PKG_WANT_INSTALL, pkgbin_name(), pnaw_nonambig, pkginfo::status, vdew_nonambig, pkgbin::version, versiondescribe(), pkginfo::want, and warning().
Referenced by process_archive().
|
extern |
Referenced by archivefiles(), process_queue(), and reportbroken_retexitstatus().
|
extern |
Referenced by assert_feature().
|
extern |
int f_alsoselect |
|
extern |
Referenced by check_breaks().
int f_noact |
int f_nodebsig |
|
extern |
Referenced by deferred_remove(), and packages().
int f_recursive |
|
extern |
int f_skipsame |
|
extern |
Referenced by main().
|
extern |
Referenced by ignore_depends().
|
extern |
Referenced by deferred_configure(), deferred_remove(), process_queue(), and trigproc().
|
extern |
Referenced by depisok(), and process_archive().