dpkg 1.22.7-3-g89f48
|
Data Structures | |
struct | dependency |
struct | deppossi |
struct | arbitraryfield |
struct | conffile |
struct | archivedetails |
struct | pkgbin |
Node describing a binary package file. More... | |
struct | trigpend |
Node indicates that parent's Triggers-Pending mentions name. More... | |
struct | trigaw |
Node indicates that aw's Triggers-Awaited mentions pend. More... | |
struct | pkginfo |
Node describing an architecture package instance. More... | |
struct | pkgset |
Node describing a package set sharing the same package name. More... | |
Functions | |
const char * | dpkg_db_set_dir (const char *dir) |
Set current on-disk database directory. | |
const char * | dpkg_db_get_dir (void) |
Get current on-disk database directory. | |
char * | dpkg_db_get_path (const char *pathpart) |
Get a pathname to the current on-disk database directory. | |
void | modstatdb_init (void) |
void | modstatdb_done (void) |
bool | modstatdb_is_locked (void) |
bool | modstatdb_can_lock (void) |
void | modstatdb_lock (void) |
void | modstatdb_unlock (void) |
enum modstatdb_rw | modstatdb_open (enum modstatdb_rw reqrwflags) |
enum modstatdb_rw | modstatdb_get_status (void) |
void | modstatdb_note (struct pkginfo *pkg) |
void | modstatdb_note_ifwrite (struct pkginfo *pkg) |
void | modstatdb_checkpoint (void) |
void | modstatdb_shutdown (void) |
void | pkgset_blank (struct pkgset *set) |
int | pkgset_installed_instances (struct pkgset *set) |
Get the number of installed package instances in a package set. | |
void | pkg_blank (struct pkginfo *pp) |
void | pkgbin_blank (struct pkgbin *pkgbin) |
bool | pkg_is_informative (struct pkginfo *pkg, struct pkgbin *info) |
Check if a pkg is informative. | |
struct pkgset * | pkg_hash_find_set (const char *name) |
Return the package set with the given name. | |
struct pkginfo * | pkg_hash_get_singleton (struct pkgset *set) |
Return the singleton package instance from a package set. | |
struct pkginfo * | pkg_hash_find_singleton (const char *name) |
Return the singleton package instance with the given name. | |
struct pkginfo * | pkg_hash_get_pkg (struct pkgset *set, const struct dpkg_arch *arch) |
Return the package instance in a set with the given architecture. | |
struct pkginfo * | pkg_hash_find_pkg (const char *name, const struct dpkg_arch *arch) |
Return the package instance with the given name and architecture. | |
int | pkg_hash_count_set (void) |
Return the number of package sets available in the database. | |
int | pkg_hash_count_pkg (void) |
Return the number of package instances available in the database. | |
void | pkg_hash_reset (void) |
struct pkg_hash_iter * | pkg_hash_iter_new (void) |
Create a new package iterator. | |
struct pkgset * | pkg_hash_iter_next_set (struct pkg_hash_iter *iter) |
struct pkginfo * | pkg_hash_iter_next_pkg (struct pkg_hash_iter *iter) |
void | pkg_hash_iter_free (struct pkg_hash_iter *iter) |
void | pkg_hash_report (FILE *) |
const char * | pkg_name_is_illegal (const char *p) |
const struct fieldinfo * | find_field_info (const struct fieldinfo *fields, const char *fieldname) |
const struct arbitraryfield * | find_arbfield_info (const struct arbitraryfield *arbs, const char *fieldname) |
int | parsedb (const char *filename, enum parsedbflags, struct pkginfo **donep) |
Parse a deb822 style file. | |
void | copy_dependency_links (struct pkginfo *pkg, struct dependency **updateme, struct dependency *newdepends, bool available) |
Copy dependency links structures. | |
void | varbufversion (struct varbuf *, const struct dpkg_version *, enum versiondisplayepochwhen) |
int | parseversion (struct dpkg_version *version, const char *, struct dpkg_error *err) |
Parse a version string and check for invalid syntax. | |
const char * | versiondescribe (const struct dpkg_version *, enum versiondisplayepochwhen) |
const char * | versiondescribe_c (const struct dpkg_version *version, enum versiondisplayepochwhen vdew) |
void | varbuf_add_pkgbin_name (struct varbuf *vb, const struct pkginfo *pkg, const struct pkgbin *pkgbin, enum pkg_name_arch_when pnaw) |
Add a string representation of the package name to a varbuf. | |
const char * | pkgbin_name_archqual (const struct pkginfo *pkg, const struct pkgbin *pkgbin) |
const char * | pkgbin_name (struct pkginfo *pkg, struct pkgbin *pkgbin, enum pkg_name_arch_when pnaw) |
Return a string representation of the package name. | |
const char * | pkg_name (struct pkginfo *pkg, enum pkg_name_arch_when pnaw) |
Return a string representation of the installed package name. | |
const char * | pkgbin_name_const (const struct pkginfo *pkg, const struct pkgbin *pkgbin, enum pkg_name_arch_when pnaw) |
Return a string representation of the package name. | |
const char * | pkg_name_const (const struct pkginfo *pkg, enum pkg_name_arch_when pnaw) |
Return a string representation of the installed package name. | |
void | pkg_source_version (struct dpkg_version *version, const struct pkginfo *pkg, const struct pkgbin *pkgbin) |
void | varbuf_add_source_version (struct varbuf *vb, const struct pkginfo *pkg, const struct pkgbin *pkgbin) |
Add a string representation of the source package version to a varbuf. | |
const char * | pkg_want_name (const struct pkginfo *pkg) |
Return a string representation of the package want status name. | |
const char * | pkg_status_name (const struct pkginfo *pkg) |
Return a string representation of the package current status name. | |
const char * | pkg_eflag_name (const struct pkginfo *pkg) |
Return a string representation of the package eflag status name. | |
const char * | pkg_priority_name (const struct pkginfo *pkg) |
Return a string representation of the package priority name. | |
void | write_stanza (FILE *, const char *, const struct pkginfo *, const struct pkgbin *) |
void | writedb_stanzas (FILE *fp, const char *filename, enum writedb_flags flags) |
void | writedb (const char *filename, enum writedb_flags flags) |
void | varbuf_stanza (struct varbuf *, const struct pkginfo *, const struct pkgbin *) |
void | varbufdependency (struct varbuf *vb, struct dependency *dep) |
bool | versionsatisfied (struct pkgbin *it, struct deppossi *against) |
bool | deparchsatisfied (struct pkgbin *it, const struct dpkg_arch *arch, struct deppossi *against) |
Check if the architecture qualifier in the dependency is satisfied. | |
bool | archsatisfied (struct pkgbin *it, struct deppossi *against) |
bool | pkg_virtual_deppossi_satisfied (struct deppossi *dependee, struct deppossi *provider) |
Check if the dependency is satisfied by a virtual package. | |
void * | nfmalloc (size_t) |
char * | nfstrsave (const char *) |
char * | nfstrnsave (const char *, size_t) |
void | nffreeall (void) |
Variables | |
enum DPKG_ATTR_ENUM_FLAGS | conffile_flags |
enum DPKG_ATTR_ENUM_FLAGS | modstatdb_rw |
enum DPKG_ATTR_ENUM_FLAGS | parsedbflags |
const struct namevalue | booleaninfos [] |
const struct namevalue | multiarchinfos [] |
const struct namevalue | priorityinfos [] |
const struct namevalue | statusinfos [] |
const struct namevalue | eflaginfos [] |
const struct namevalue | wantinfos [] |
enum DPKG_ATTR_ENUM_FLAGS | writedb_flags |
enum deptype |
enum pkg_name_arch_when |
enum pkgeflag |
enum pkgmultiarch |
enum pkgpriority |
enum pkgstatus |
enum pkgwant |
References deparchsatisfied(), and dpkg_arch::type.
Referenced by deppossi_pkg_iter_next().
void copy_dependency_links | ( | struct pkginfo * | pkg, |
struct dependency ** | updateme, | ||
struct dependency * | newdepends, | ||
bool | available | ||
) |
Copy dependency links structures.
This routine is used to update the ‘reverse’ dependency pointers when new ‘forwards’ information has been constructed. It first removes all the links based on the old information. The old information starts in *updateme; after much brou-ha-ha the reverse structures are created and *updateme is set to the value from newdepends.
pkg | The package we're doing this for. This is used to construct correct uplinks. |
updateme | The forwards dependency pointer that we are to update. This starts out containing the old forwards info, which we use to unthread the old reverse links. After we're done it is updated. |
newdepends | The value that we ultimately want to have in updateme. |
available | The pkgbin to modify, available or installed. |
It is likely that the backward pointer for the package in question (‘depended’) will be updated by this routine, but this will happen by the routine traversing the dependency data structures. It doesn't need to be told where to update that; just mentioned here as something that one should be cautious about.
References pkgset::available, pkgset::depended, deppossi::ed, pkgset::installed, dependency::list, dependency::next, deppossi::next, deppossi::rev_next, deppossi::rev_prev, dependency::type, and dependency::up.
bool deparchsatisfied | ( | struct pkgbin * | it, |
const struct dpkg_arch * | it_arch, | ||
struct deppossi * | against | ||
) |
Check if the architecture qualifier in the dependency is satisfied.
The rules are supposed to be:
References dep_breaks, dep_conflicts, dep_replaces, DPKG_ARCH_ALL, dpkg_arch_get(), DPKG_ARCH_NATIVE, DPKG_ARCH_NONE, DPKG_ARCH_WILDCARD, PKG_MULTIARCH_ALLOWED, PKG_MULTIARCH_FOREIGN, and dpkg_arch::type.
Referenced by archsatisfied(), and dependencies_ok().
const char * dpkg_db_get_dir | ( | void | ) |
Get current on-disk database directory.
This function will take care of initializing the directory if it has not been initialized before.
Referenced by dpkg_arch_save_list(), dpkg_db_get_path(), main(), modstatdb_can_lock(), modstatdb_is_locked(), modstatdb_lock(), modstatdb_open(), set_instdir(), and updateavailable().
char * dpkg_db_get_path | ( | const char * | pathpart | ) |
Get a pathname to the current on-disk database directory.
This function returns an allocated string, which should be freed with free(2).
pathpart | The pathpart to append to the new pathname. |
References dpkg_db_get_dir(), and str_fmt().
Referenced by dpkg_arch_load_list(), dpkg_arch_save_list(), dpkg_db_reopen(), main(), modstatdb_init(), pkg_infodb_get_dir(), trig_incorporate(), trigdef_update_start(), and updateavailable().
const char * dpkg_db_set_dir | ( | const char * | dir | ) |
Set current on-disk database directory.
This function can be used to set the directory to a new value, or to reset it to a default value if dir is NULL.
dir | The new database directory, or NULL to set to default. |
References m_strdup().
Referenced by set_admindir(), and set_root().
const struct arbitraryfield * find_arbfield_info | ( | const struct arbitraryfield * | arbs, |
const char * | fieldname | ||
) |
References arbitraryfield::name, and arbitraryfield::next.
Referenced by pkg_format_print().
const struct fieldinfo * find_field_info | ( | const struct fieldinfo * | fields, |
const char * | fieldname | ||
) |
References fieldinfo::name.
Referenced by pkg_format_print().
bool modstatdb_can_lock | ( | void | ) |
References _, dpkg_db_get_dir(), and ohshite().
Referenced by modstatdb_lock().
void modstatdb_checkpoint | ( | void | ) |
References _, varbuf::buf, dir_sync_path(), IMPORTANTFMT, IMPORTANTMAXLEN, internerr, msdbrw_write, ohshite(), varbuf_printf(), varbuf_rollback(), varbuf_rollback_len(), varbuf_rollback_start(), wdb_must_sync, and writedb().
Referenced by modstatdb_shutdown().
void modstatdb_done | ( | void | ) |
References varbuf_destroy().
Referenced by modstatdb_shutdown(), and updateavailable().
enum modstatdb_rw modstatdb_get_status | ( | void | ) |
Referenced by pkg_infodb_upgrade(), and post_postinst_tasks().
void modstatdb_init | ( | void | ) |
References dpkg_db_get_path(), IMPORTANTMAXLEN, varbuf_add_dir(), varbuf_init(), and varbuf_snapshot().
Referenced by modstatdb_open(), and updateavailable().
bool modstatdb_is_locked | ( | void | ) |
References _, dpkg_db_get_dir(), file_is_locked(), and ohshite().
Referenced by audit().
void modstatdb_lock | ( | void | ) |
References _, dpkg_db_get_dir(), file_lock(), FILE_LOCK_NOWAIT, modstatdb_can_lock(), and ohshit().
Referenced by modstatdb_open(), and updateavailable().
void modstatdb_note | ( | struct pkginfo * | pkg | ) |
References trigaw::aw, pkginfo::head, pkginfo::installed, log_message(), msdbrw_write, trigaw::next, onerr_abort, pkginfo::othertrigaw_head, pkg_name(), PKG_STAT_CONFIGFILES, PKG_STAT_TRIGGERSAWAITED, PKG_STAT_TRIGGERSPENDING, pkg_status_name(), pnaw_always, pnaw_nonambig, trigaw::sameaw, pkginfo::status, pkginfo::status_dirty, statusfd_send(), pkginfo::tail, trig_clear_awaiters(), pkginfo::trigaw, pkginfo::trigpend_head, vdew_nonambig, pkgbin::version, and versiondescribe_c().
Referenced by cu_preinstnew(), cu_preinstupgrade(), cu_preinstverynew(), deferred_configure(), deferred_remove(), modstatdb_note_ifwrite(), post_postinst_tasks(), process_archive(), removal_bulk(), trig_clear_awaiters(), and trigproc().
void modstatdb_note_ifwrite | ( | struct pkginfo * | pkg | ) |
enum modstatdb_rw modstatdb_open | ( | enum modstatdb_rw | reqrwflags | ) |
References _, dir_make_path(), dpkg_arch_load_list(), dpkg_db_get_dir(), internerr, modstatdb_init(), modstatdb_lock(), msdbrw_available_mask, msdbrw_available_readonly, msdbrw_needsuperuser, msdbrw_needsuperuserlockonly, msdbrw_readonly, msdbrw_write, msdbrw_writeifposs, ohshit(), ohshite(), parsedb(), pdb_parse_available, trig_fixup_awaiters(), trig_incorporate(), and varbuf_init().
Referenced by archivefiles(), audit(), clearselections(), getselections(), packages(), predeppackage(), setselections(), unpackchk(), and verify().
void modstatdb_shutdown | ( | void | ) |
References modstatdb_checkpoint(), modstatdb_done(), modstatdb_unlock(), msdbrw_available_write, msdbrw_needsuperuserlockonly, msdbrw_write, pkg_hash_reset(), varbuf_destroy(), wdb_dump_available, and writedb().
Referenced by archivefiles(), clearselections(), getselections(), packages(), setselections(), and verify().
void modstatdb_unlock | ( | void | ) |
References ehflag_normaltidy, and pop_cleanup().
Referenced by modstatdb_shutdown(), and updateavailable().
void nffreeall | ( | void | ) |
void * nfmalloc | ( | size_t | size | ) |
References OBSTACK_INIT.
Referenced by do_auto(), do_join(), ensure_diversions(), ensure_package_clientdata(), ensure_statoverrides(), f_archives(), f_conffiles(), f_dependency(), f_obs_revision(), fsys_hash_find_node(), pkg_files_add_file(), pkg_hash_find_set(), pkg_hash_get_pkg(), pkgbin_name_archqual(), process_archive(), statusfd_add(), trig_note_aw(), trig_note_pend_core(), and unpackchk().
char * nfstrnsave | ( | const char * | string, |
size_t | size | ||
) |
References OBSTACK_INIT.
Referenced by do_split(), and parseversion().
char * nfstrsave | ( | const char * | string | ) |
References OBSTACK_INIT.
Referenced by ensure_statoverrides(), f_archives(), f_charfield(), f_obs_revision(), f_priority(), f_section(), f_trigpend(), pkg_hash_find_set(), and read_info().
int parsedb | ( | const char * | filename, |
enum parsedbflags | flags, | ||
struct pkginfo ** | pkgp | ||
) |
Parse a deb822 style file.
donep may be NULL. If donep is not NULL only one package's information is expected.
References parsedb_state::filename, parsedb_state::flags, parsedb_close(), parsedb_load(), parsedb_open(), parsedb_parse(), and parsedb_state::type.
Referenced by do_showinfo(), modstatdb_open(), process_archive(), and updateavailable().
int parseversion | ( | struct dpkg_version * | rversion, |
const char * | string, | ||
struct dpkg_error * | err | ||
) |
Parse a version string and check for invalid syntax.
Distinguish between lax (warnings) and strict (error) parsing.
rversion | The parsed version. |
string | The version string to parse. |
err | The warning or error message if any. |
0 | On success. |
-1 | On failure, and err is set accordingly. |
References _, dpkg_put_error(), dpkg_put_warn(), dpkg_version::epoch, nfstrnsave(), dpkg_version::revision, and dpkg_version::version.
Referenced by cmpversions(), parse_db_version(), pkg_source_version(), and validate_version().
void pkg_blank | ( | struct pkginfo * | pp | ) |
References pkgbin::arch, pkginfo::archives, pkginfo::available, pkginfo::clientdata, pkginfo::configversion, dpkg_arch_get(), DPKG_ARCH_NONE, dpkg_version_blank(), pkginfo::eflag, pkginfo::files, pkginfo::files_list_phys_offs, pkginfo::files_list_valid, pkginfo::head, pkginfo::installed, pkgbin::multiarch, pkginfo::otherpriority, pkginfo::othertrigaw_head, PKG_EFLAG_OK, PKG_MULTIARCH_NO, PKG_PRIO_UNKNOWN, PKG_STAT_NOTINSTALLED, PKG_WANT_UNKNOWN, pkgbin_blank(), pkginfo::priority, pkginfo::section, pkginfo::status, pkginfo::status_dirty, pkginfo::tail, pkginfo::trigaw, pkginfo::trigpend_head, and pkginfo::want.
Referenced by pkg_hash_get_pkg(), pkgset_blank(), and process_archive().
const char * pkg_eflag_name | ( | const struct pkginfo * | pkg | ) |
Return a string representation of the package eflag status name.
pkg | The package to consider. |
References pkginfo::eflag, eflaginfos, and namevalue::name.
Referenced by w_status().
int pkg_hash_count_pkg | ( | void | ) |
Return the number of package instances available in the database.
Referenced by ensure_allinstfiles_available(), and pkg_array_init_from_hash().
int pkg_hash_count_set | ( | void | ) |
Return the number of package sets available in the database.
Return the package instance with the given name and architecture.
name | The package name. |
arch | The requested architecture. |
References pkg_hash_find_set(), pkg_hash_get_pkg(), and pkginfo::set.
struct pkgset * pkg_hash_find_set | ( | const char * | inname | ) |
Return the package set with the given name.
If the package already exists in the internal database, then it returns the existing structure. Otherwise it allocates a new one and will return it. The actual name associated to the package set is a lowercase version of the name given in parameter.
A package set (struct pkgset) can be composed of multiple package instances (struct pkginfo) where each instance is distinguished by its architecture (as recorded in pkg.installed.arch and pkg.available.arch).
inname | Name of the package set. |
References BINS, m_strdup(), pkgset::name, pkgset::next, nfmalloc(), nfstrsave(), pkgset_blank(), and str_fnv_hash().
Referenced by ensure_diversions(), f_dependency(), f_name(), pkg_hash_find_pkg(), pkg_hash_find_singleton(), pkg_spec_is_illegal(), and pkg_spec_iter_init().
struct pkginfo * pkg_hash_find_singleton | ( | const char * | name | ) |
Return the singleton package instance with the given name.
name | The package name. |
References _, pkgset::name, ohshit(), pkg_hash_find_set(), pkg_hash_get_singleton(), and pkginfo::set.
Return the package instance in a set with the given architecture.
It traverse the various instances to find out whether there's one matching the given architecture. If found, it returns it. Otherwise it allocates a new instance and registers it in the package set before returning it.
set | The package set to use. |
arch | The requested architecture. |
References pkgbin::arch, pkginfo::arch_next, pkginfo::available, DPKG_ARCH_NONE, pkginfo::installed, internerr, nfmalloc(), pkgset::pkg, pkg_blank(), pkginfo::set, and dpkg_arch::type.
Referenced by pkg_hash_find_pkg().
Return the singleton package instance from a package set.
This means, if none are installed either an instance with native or all arch or the first if none found, the single installed instance, or NULL if more than one instance is installed.
set | The package set to use. |
References pkgbin::arch, pkginfo::arch_next, pkginfo::available, DPKG_ARCH_ALL, DPKG_ARCH_NATIVE, internerr, pkgset::name, pkgset::pkg, PKG_STAT_NOTINSTALLED, pkgset_installed_instances(), pkginfo::set, pkginfo::status, and dpkg_arch::type.
Referenced by pkg_hash_find_singleton().
void pkg_hash_iter_free | ( | struct pkg_hash_iter * | iter | ) |
Referenced by clear_istobes(), clearselections(), findbreakcycle(), pkg_array_init_from_hash(), pkg_spec_iter_destroy(), predeppackage(), trigproc_populate_deferred(), unpackchk(), and verify().
struct pkg_hash_iter * pkg_hash_iter_new | ( | void | ) |
Create a new package iterator.
It can iterate either over package sets or over package instances.
References m_malloc(), pkg_hash_iter::nbinn, and pkg_hash_iter::pkg.
Referenced by clear_istobes(), clearselections(), findbreakcycle(), pkg_array_init_from_hash(), pkg_spec_iter_init(), predeppackage(), trigproc_populate_deferred(), unpackchk(), and verify().
struct pkginfo * pkg_hash_iter_next_pkg | ( | struct pkg_hash_iter * | iter | ) |
References pkginfo::arch_next, BINS, pkg_hash_iter::nbinn, pkgset::next, pkgset::pkg, pkg_hash_iter::pkg, and pkginfo::set.
Referenced by clear_istobes(), clearselections(), findbreakcycle(), pkg_array_init_from_hash(), predeppackage(), trigproc_populate_deferred(), unpackchk(), and verify().
struct pkgset * pkg_hash_iter_next_set | ( | struct pkg_hash_iter * | iter | ) |
References BINS, pkg_hash_iter::nbinn, pkgset::next, pkgset::pkg, pkg_hash_iter::pkg, and pkginfo::set.
void pkg_hash_report | ( | FILE * | file | ) |
void pkg_hash_reset | ( | void | ) |
References dpkg_arch_reset_list(), and nffreeall().
Referenced by modstatdb_shutdown().
Check if a pkg is informative.
Used by dselect and dpkg query options as an aid to decide whether to display things, and by dump to decide whether to write them out.
References pkgbin::arbs, pkgbin::bugs, pkgbin::conffiles, pkginfo::configversion, pkgbin::depends, pkgbin::description, dpkg_version_is_informative(), pkginfo::eflag, pkginfo::installed, pkgbin::installedsize, pkgbin::maintainer, pkgbin::origin, PKG_EFLAG_OK, PKG_STAT_NOTINSTALLED, PKG_WANT_UNKNOWN, pkgbin::source, pkginfo::status, pkgbin::version, and pkginfo::want.
Referenced by setselections(), and writedb_stanzas().
const char * pkg_name | ( | struct pkginfo * | pkg, |
enum pkg_name_arch_when | pnaw | ||
) |
Return a string representation of the installed package name.
This is equivalent to pkgbin_name() but just for its installed pkgbin.
pkg | The package to consider. |
pnaw | When to display the architecture qualifier. |
References pkginfo::installed, and pkgbin_name().
Referenced by check_breaks(), check_conflict(), conffderef(), conffile_mark_obsolete(), cu_prermdeconfigure(), deferred_configure(), deferred_remove(), dependencies_ok(), depisok(), describedepcon(), dir_has_conffiles(), dir_is_used_by_others(), dir_is_used_by_pkg(), ensure_packagefiles_available(), filesavespackage(), maintscript_fallback(), maintscript_new(), md5hash(), modstatdb_note(), parse_filehash(), process_archive(), process_queue(), removal_bulk(), skip_due_to_hold(), tarobject(), trig_activate_packageprocessing(), trig_clear_awaiters(), trigproc(), trigproc_run_deferred(), unpackchk(), verify(), and wanttoinstall().
const char * pkg_name_const | ( | const struct pkginfo * | pkg, |
enum pkg_name_arch_when | pnaw | ||
) |
Return a string representation of the installed package name.
This is equivalent to pkgbin_name_const() but just for its installed pkgbin.
pkg | The package to consider. |
pnaw | When to display the architecture qualifier. |
References pkginfo::installed, and pkgbin_name_const().
const char * pkg_name_is_illegal | ( | const char * | p | ) |
References _.
Referenced by f_dependency(), f_name(), pkg_spec_is_illegal(), and validate_pkgname().
const char * pkg_priority_name | ( | const struct pkginfo * | pkg | ) |
Return a string representation of the package priority name.
pkg | The package to consider. |
References namevalue::name, pkginfo::otherpriority, PKG_PRIO_OTHER, pkginfo::priority, and priorityinfos.
Referenced by w_priority().
void pkg_source_version | ( | struct dpkg_version * | version, |
const struct pkginfo * | pkg, | ||
const struct pkgbin * | pkgbin | ||
) |
References _, ohshit(), parseversion(), pkgbin::source, dpkg_error::str, varbuf_add_buf(), varbuf_destroy(), VARBUF_INIT, varbuf_str(), pkgbin::version, and dpkg_version::version.
Referenced by varbuf_add_source_version().
const char * pkg_status_name | ( | const struct pkginfo * | pkg | ) |
Return a string representation of the package current status name.
pkg | The package to consider. |
References namevalue::name, pkginfo::status, and statusinfos.
Referenced by deferred_configure(), modstatdb_note(), process_archive(), process_queue(), trigproc(), w_status(), w_trigaw(), and w_trigpend().
Check if the dependency is satisfied by a virtual package.
For versioned depends, we only check providers with DPKG_RELATION_EQ. It does not make sense to check ones without a version since we have nothing to verify against. Also, it is way too complex to allow anything but an equal in a provided version. A few examples below to deter you from trying:
This could be handled by switching to a SAT solver, but that would imply lots of work for very little gain. Packages can easily get around most of these by providing multiple DPKG_RELATION_EQ versions.
References DPKG_RELATION_EQ, DPKG_RELATION_NONE, dpkg_version_relate(), and dpkg_arch::type.
Referenced by depisok(), and predeppackage().
const char * pkg_want_name | ( | const struct pkginfo * | pkg | ) |
Return a string representation of the package want status name.
pkg | The package to consider. |
References namevalue::name, pkginfo::want, and wantinfos.
Referenced by w_status().
void pkgbin_blank | ( | struct pkgbin * | pkgbin | ) |
References pkgbin::arbs, pkgbin::bugs, pkgbin::conffiles, pkgbin::depends, pkgbin::description, dpkg_version_blank(), pkgbin::essential, pkgbin::installedsize, pkgbin::is_protected, pkgbin::maintainer, pkgbin::origin, pkgbin::pkgname_archqual, pkgbin::source, and pkgbin::version.
Referenced by cu_preinstverynew(), pkg_blank(), and removal_bulk().
const char * pkgbin_name | ( | struct pkginfo * | pkg, |
struct pkgbin * | pkgbin, | ||
enum pkg_name_arch_when | pnaw | ||
) |
Return a string representation of the package name.
The returned string must not be freed, and it's permanently allocated so can be used as long as the non-freeing memory pool has not been freed.
The pnaw parameter should be one of pnaw_never (never print arch), pnaw_foreign (print arch for foreign packages only), pnaw_nonambig (print arch for non ambiguous cases) or pnaw_always (always print arch),
pkg | The package to consider. |
pkgbin | The binary package instance to consider. |
pnaw | When to display the architecture qualifier. |
References pkgset::name, pkgbin_name_archqual(), pkgbin::pkgname_archqual, and pkginfo::set.
Referenced by check_breaks(), check_conflict(), cu_prermdeconfigure(), cu_prerminfavour(), depisok(), log_action(), namenodetouse(), pkg_infodb_foreach(), pkg_name(), predeppackage(), process_archive(), wanttoinstall(), and writedb_stanzas().
References pkgbin::arch, DPKG_ARCH_EMPTY, DPKG_ARCH_NONE, dpkg_arch::name, pkgset::name, nfmalloc(), pkginfo::set, str_concat(), and dpkg_arch::type.
Referenced by pkgbin_name(), and pkgbin_name_const().
const char * pkgbin_name_const | ( | const struct pkginfo * | pkg, |
const struct pkgbin * | pkgbin, | ||
enum pkg_name_arch_when | pnaw | ||
) |
Return a string representation of the package name.
The returned string must not be freed, and it's permanently allocated so can be used as long as the non-freeing memory pool has not been freed.
Note, that this const variant will "leak" a new non-freeing string on each call if the internal cache has not been previously initialized, so it is advised to use it only in error reporting code paths.
The pnaw parameter should be one of pnaw_never (never print arch), pnaw_foreign (print arch for foreign packages only), pnaw_nonambig (print arch for non ambiguous cases) or pnaw_always (always print arch),
pkg | The package to consider. |
pkgbin | The binary package instance to consider. |
pnaw | When to display the architecture qualifier. |
References pkgset::name, pkgbin_name_archqual(), pkgbin::pkgname_archqual, and pkginfo::set.
Referenced by pkg_name_const(), w_dependency(), w_priority(), w_status(), w_trigaw(), w_trigpend(), and write_stanza().
void pkgset_blank | ( | struct pkgset * | set | ) |
References pkginfo::arch_next, pkgset::available, pkgset::depended, pkgset::installed, pkgset::installed_instances, pkgset::name, pkgset::pkg, pkg_blank(), and pkginfo::set.
Referenced by parsedb_parse(), and pkg_hash_find_set().
int pkgset_installed_instances | ( | struct pkgset * | set | ) |
Get the number of installed package instances in a package set.
set | The package set to use. |
References pkgset::installed_instances.
Referenced by pkg_hash_get_singleton(), and pkg_spec_is_illegal().
void varbuf_add_pkgbin_name | ( | struct varbuf * | vb, |
const struct pkginfo * | pkg, | ||
const struct pkgbin * | pkgbin, | ||
enum pkg_name_arch_when | pnaw | ||
) |
Add a string representation of the package name to a varbuf.
Works exactly like pkgbin_name() but acts on the varbuf instead of returning a string. It NUL terminates the varbuf.
vb | The varbuf struct to modify. |
pkg | The package to consider. |
pkgbin | The binary package instance to consider. |
pnaw | When to display the architecture qualifier. |
References pkgbin::arch, pkgset::name, pkginfo::set, varbuf_add_archqual(), and varbuf_add_str.
Referenced by dependencies_ok(), and w_trigaw().
void varbuf_add_source_version | ( | struct varbuf * | vb, |
const struct pkginfo * | pkg, | ||
const struct pkgbin * | pkgbin | ||
) |
Add a string representation of the source package version to a varbuf.
It parses the Source field (if present), and extracts the optional version enclosed in parenthesis. Otherwise it falls back to use the binary package version. It NUL terminates the varbuf.
vb | The varbuf struct to modify. |
pkg | The package to consider. |
pkgbin | The binary package instance to consider. |
References DPKG_VERSION_INIT, pkg_source_version(), varbufversion(), vdew_nonambig, and dpkg_version::version.
References pkgbin::arbs, fieldinfos, fw_printheader, fieldinfo::name, arbitraryfield::next, varbuf_add_arbfield(), and fieldinfo::wcall.
Referenced by write_stanza(), and writedb_stanzas().
void varbufdependency | ( | struct varbuf * | vb, |
struct dependency * | dep | ||
) |
References deppossi::arch, deppossi::arch_is_implicit, DPKG_RELATION_EQ, DPKG_RELATION_GE, DPKG_RELATION_GT, DPKG_RELATION_LE, DPKG_RELATION_LT, DPKG_RELATION_NONE, deppossi::ed, internerr, dependency::list, pkgset::name, deppossi::next, deppossi::up, varbuf_add_archqual(), varbuf_add_char(), varbuf_add_str, varbufversion(), vdew_nonambig, deppossi::verrel, and deppossi::version.
Referenced by dependencies_ok(), describedepcon(), and w_dependency().
void varbufversion | ( | struct varbuf * | vb, |
const struct dpkg_version * | version, | ||
enum | versiondisplayepochwhen | ||
) |
References dpkg_version::epoch, internerr, dpkg_version::revision, varbuf_add_char(), varbuf_add_str, varbuf_printf(), vdew_always, vdew_never, vdew_nonambig, and dpkg_version::version.
Referenced by varbuf_add_source_version(), varbufdependency(), versiondescribe(), w_configversion(), and w_version().
const char * versiondescribe | ( | const struct dpkg_version * | version, |
enum | versiondisplayepochwhen | ||
) |
References varbuf::buf, C_, dpkg_version_is_informative(), varbuf_reset(), and varbufversion().
Referenced by cu_postrmupgrade(), cu_preinstnew(), cu_preinstupgrade(), cu_prermdeconfigure(), cu_prerminfavour(), cu_prermupgrade(), deferred_configure(), deferred_remove(), depisok(), maintscript_fallback(), process_archive(), tarobject(), trigproc(), versiondescribe_c(), and wanttoinstall().
const char * versiondescribe_c | ( | const struct dpkg_version * | version, |
enum versiondisplayepochwhen | vdew | ||
) |
References dpkg_locale_switch_back(), dpkg_locale_switch_C(), dpkg_locale::oldloc, and versiondescribe().
Referenced by cmpversions(), log_action(), modstatdb_note(), and tarobject().
References dpkg_version_relate(), deppossi::verrel, deppossi::version, and pkgbin::version.
Referenced by depisok(), and predeppackage().
void write_stanza | ( | FILE * | file, |
const char * | filename, | ||
const struct pkginfo * | pkg, | ||
const struct pkgbin * | pkgbin | ||
) |
References _, ohshite(), pkgbin_name_const(), pnaw_nonambig, varbuf_destroy(), VARBUF_INIT, varbuf_stanza(), and varbuf_str().
Referenced by predeppackage().
void writedb | ( | const char * | filename, |
enum writedb_flags | flags | ||
) |
References ATOMIC_FILE_BACKUP, atomic_file_close(), atomic_file_commit(), atomic_file_flags, atomic_file_free(), atomic_file_new(), atomic_file_open(), atomic_file_sync(), dir_sync_path_parent(), atomic_file::flags, wdb_dump_available, wdb_must_sync, and writedb_stanzas().
Referenced by modstatdb_checkpoint(), modstatdb_shutdown(), and updateavailable().
void writedb_stanzas | ( | FILE * | fp, |
const char * | filename, | ||
enum writedb_flags | flags | ||
) |
References _, pkginfo::available, pkginfo::installed, pkg_array::n_pkgs, ohshite(), pkg_array_destroy(), pkg_array_init_from_hash(), pkg_array_sort(), pkg_is_informative(), pkg_sorter_by_nonambig_name_arch(), pkgbin_name(), pkg_array::pkgs, pnaw_nonambig, varbuf_add_char(), varbuf_destroy(), VARBUF_INIT, varbuf_reset(), varbuf_stanza(), varbuf_str(), and wdb_dump_available.
Referenced by writedb().
|
extern |
Referenced by f_boolean().
enum DPKG_ATTR_ENUM_FLAGS conffile_flags |
|
extern |
Referenced by f_status(), and pkg_eflag_name().
enum DPKG_ATTR_ENUM_FLAGS modstatdb_rw |
Referenced by archivefiles(), clearselections(), and setselections().
|
extern |
Referenced by f_multiarch(), and w_multiarch().
enum DPKG_ATTR_ENUM_FLAGS parsedbflags |
Referenced by process_archive().
|
extern |
Referenced by f_priority(), and pkg_priority_name().
|
extern |
Referenced by f_status(), and pkg_status_name().
|
extern |
Referenced by f_status(), pkg_want_name(), and setselections().
enum DPKG_ATTR_ENUM_FLAGS writedb_flags |