dpkg 1.22.7-3-g89f48
|
#include <config.h>
#include <compat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <obstack.h>
#include <dpkg/i18n.h>
#include <dpkg/dpkg.h>
#include <dpkg/dpkg-db.h>
#include <dpkg/pkg.h>
#include <dpkg/path.h>
#include <dpkg/fdio.h>
#include <dpkg/buffer.h>
#include <dpkg/subproc.h>
#include <dpkg/command.h>
#include <dpkg/file.h>
#include <dpkg/treewalk.h>
#include <dpkg/tarfn.h>
#include <dpkg/options.h>
#include <dpkg/triglib.h>
#include <dpkg/db-ctrl.h>
#include <dpkg/db-fsys.h>
#include "main.h"
#include "archives.h"
#include "filters.h"
Macros | |
#define | obstack_chunk_alloc m_malloc |
#define | obstack_chunk_free free |
Functions | |
struct fsys_namenode_list * | tar_fsys_namenode_queue_push (struct fsys_namenode_queue *queue, struct fsys_namenode *namenode) |
bool | filesavespackage (struct fsys_namenode_list *file, struct pkginfo *pkgtobesaved, struct pkginfo *pkgbeinginstalled) |
Check if a file or directory will save a package from disappearance. | |
void | cu_pathname (int argc, void **argv) |
int | tarfileread (struct tar_archive *tar, char *buf, int len) |
void | setupfnamevbs (const char *filename) |
int | tarobject (struct tar_archive *tar, struct tar_entry *ti) |
void | tar_deferred_extract (struct fsys_namenode_list *files, struct pkginfo *pkg) |
void | enqueue_deconfigure (struct pkginfo *pkg, struct pkginfo *pkg_removal, enum pkgwant reason) |
void | clear_deconfigure_queue (void) |
void | check_breaks (struct dependency *dep, struct pkginfo *pkg, const char *pfilename) |
void | check_conflict (struct dependency *dep, struct pkginfo *pkg, const char *pfilename) |
void | cu_cidir (int argc, void **argv) |
void | cu_fileslist (int argc, void **argv) |
int | archivefiles (const char *const *argv) |
bool | wanttoinstall (struct pkginfo *pkg) |
Decide whether we want to install a new version of the package. | |
Variables | |
struct varbuf_state | fname_state |
struct varbuf_state | fnametmp_state |
struct varbuf_state | fnamenew_state |
struct varbuf | fnamevb |
struct varbuf | fnametmpvb |
struct varbuf | fnamenewvb |
struct pkg_deconf_list * | deconfigure = NULL |
#define obstack_chunk_alloc m_malloc |
#define obstack_chunk_free free |
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().
void check_breaks | ( | struct dependency * | dep, |
struct pkginfo * | pkg, | ||
const char * | pfilename | ||
) |
References _, pkginfo::available, pkginfo::clientdata, depisok(), ensure_package_clientdata(), f_autodeconf, force_breaks(), internerr, perpackagestate::istobe, dependency::list, notice(), ohshit(), PKG_ISTOBE_NORMAL, pkg_name(), pkgbin_name(), pnaw_always, pnaw_nonambig, varbuf_destroy(), VARBUF_INIT, varbuf_str(), and warning().
void check_conflict | ( | struct dependency * | dep, |
struct pkginfo * | pkg, | ||
const char * | pfilename | ||
) |
References _, pkginfo::available, dep_depends, dep_predepends, dep_provides, depisok(), enqueue_conflictor(), ensure_package_clientdata(), pkgbin::essential, force_conflicts(), FORCE_REMOVE_ESSENTIAL, FORCE_REMOVE_PROTECTED, FORCE_REMOVE_REINSTREQ, in_force(), internerr, pkgbin::is_protected, notice(), ohshit(), PKG_EFLAG_REINSTREQ, PKG_ISTOBE_DECONFIGURE, PKG_ISTOBE_INSTALLNEW, PKG_ISTOBE_NORMAL, PKG_ISTOBE_REMOVE, pkg_name(), PKG_STAT_INSTALLED, PKG_STAT_TRIGGERSAWAITED, PKG_STAT_TRIGGERSPENDING, PKG_WANT_HOLD, PKG_WANT_INSTALL, pkgbin_name(), pnaw_always, pnaw_nonambig, skip_due_to_hold(), dependency::type, varbuf_destroy(), VARBUF_INIT, varbuf_str(), and warning().
void clear_deconfigure_queue | ( | void | ) |
References deconfigure, and pkg_deconf_list::next.
Referenced by process_archive().
void cu_cidir | ( | int | argc, |
void ** | argv | ||
) |
References path_remove_tree(), and dependency::type.
Referenced by process_archive().
void cu_fileslist | ( | int | argc, |
void ** | argv | ||
) |
void cu_pathname | ( | int | argc, |
void ** | argv | ||
) |
void enqueue_deconfigure | ( | struct pkginfo * | pkg, |
struct pkginfo * | pkg_removal, | ||
enum pkgwant | reason | ||
) |
References pkginfo::clientdata, deconfigure, ensure_package_clientdata(), perpackagestate::istobe, m_malloc(), pkg_deconf_list::next, pkg_deconf_list::pkg, PKG_ISTOBE_DECONFIGURE, pkg_deconf_list::pkg_removal, and pkg_deconf_list::reason.
Referenced by process_archive().
bool filesavespackage | ( | struct fsys_namenode_list * | file, |
struct pkginfo * | pkgtobesaved, | ||
struct pkginfo * | pkgbeinginstalled | ||
) |
Check if a file or directory will save a package from disappearance.
A package can only be saved by a file or directory which is part only of itself - it must be neither part of the new package being installed nor part of any 3rd package (this is important so that shared directories don't stop packages from disappearing).
References dbg_eachfiledetail, debug(), pkginfo::files_list_valid, FNNF_NEW_INARCHIVE, fsys_node_pkgs_iter_free(), fsys_node_pkgs_iter_new(), fsys_node_pkgs_iter_next(), pkginfo::installed, pkgbin::multiarch, file::name, PKG_MULTIARCH_SAME, pkg_name(), pnaw_always, and pkginfo::set.
void setupfnamevbs | ( | const char * | filename | ) |
References varbuf::buf, dbg_eachfiledetail, debug(), DPKGNEWEXT, DPKGTEMPEXT, fname_state, fnamenew_state, fnamenewvb, fnametmp_state, fnametmpvb, fnamevb, varbuf_add_str, and varbuf_rollback().
Referenced by cu_installnew(), tar_deferred_extract(), and tarobject().
void tar_deferred_extract | ( | struct fsys_namenode_list * | files, |
struct pkginfo * | pkg | ||
) |
References _, pkginfo::available, varbuf::buf, dbg_eachfile, dbg_eachfiledetail, debug(), fsys_namenode::flags, fnamenewvb, fnamevb, FNNF_DEFERRED_FSYNC, FNNF_DEFERRED_RENAME, FNNF_ELIDE_OTHER_LISTS, FNNF_PLACED_ON_DISK, fsys_namenode::name, fsys_namenode_list::namenode, namenodetouse(), fsys_namenode_list::next, ohshite(), and setupfnamevbs().
Referenced by process_archive().
struct fsys_namenode_list * tar_fsys_namenode_queue_push | ( | struct fsys_namenode_queue * | queue, |
struct fsys_namenode * | namenode | ||
) |
References fsys_namenode_list::namenode, fsys_namenode_list::next, and fsys_namenode_queue::tail.
Referenced by tarobject().
int tarfileread | ( | struct tar_archive * | tar, |
char * | buf, | ||
int | len | ||
) |
References _, tarcontext::backendpipe, tar_archive::ctx, fd_read(), and ohshite().
Referenced by process_archive().
int tarobject | ( | struct tar_archive * | tar, |
struct tar_entry * | ti | ||
) |
References _, pkginfo::available, varbuf::buf, fsys_diversion::camefrom, pkginfo::clientdata, conffderef(), CONFFILE_OBSOLETE, pkgbin::conffiles, tar_archive::ctx, cu_installnew(), dbg_conff, dbg_conffdetail, dbg_eachfile, dbg_eachfiledetail, debug(), fsys_namenode::divert, ehflag_normaltidy, EMPTYHASHFLAG, ensure_package_clientdata(), FHFF_NONE, file_readlink(), filter_should_skip(), conffile::flags, fsys_namenode::flags, fnamenewvb, fnametmpvb, fnamevb, FNNF_DEFERRED_RENAME, FNNF_ELIDE_OTHER_LISTS, FNNF_FILTERED, FNNF_NEW_CONFF, FNNF_NEW_INARCHIVE, FNNF_NO_ATOMIC_OVERWRITE, FNNF_OBS_CONFF, FNNF_PLACED_ON_DISK, FNNF_RM_CONFF_ON_UPGRADE, FORCE_OVERWRITE, FORCE_OVERWRITE_DIR, FORCE_OVERWRITE_DIVERTED, forcible_nonroot_error(), forcibleerr(), fsys_hash_find_node(), fsys_node_pkgs_iter_free(), fsys_node_pkgs_iter_new(), fsys_node_pkgs_iter_next(), file_stat::gid, in_force(), pkginfo::installed, perpackagestate::istobe, tar_entry::linkname, md5hash(), MD5HASHLEN, file_stat::mode, pkgbin::multiarch, conffile::name, pkgset::name, fsys_namenode::name, tar_entry::name, fsys_namenode_list::namenode, namenodetouse(), tarcontext::newfiles_queue, conffile::next, ohshit(), ohshite(), path_remove_tree(), tarcontext::pkg, PKG_ISTOBE_REMOVE, PKG_MULTIARCH_SAME, pkg_name(), PKG_STAT_CONFIGFILES, fsys_diversion::pkgset, tarcontext::pkgset_getting_in_sync, pnaw_always, pnaw_nonambig, push_cleanup(), perpackagestate::replacingfilesandsaid, pkginfo::set, setupfnamevbs(), tar_entry::stat, fsys_namenode::statoverride, pkginfo::status, fsys_namenode_queue::tail, tar_entry_update_from_system(), TAR_FILETYPE_BLOCKDEV, TAR_FILETYPE_CHARDEV, TAR_FILETYPE_DIR, TAR_FILETYPE_FIFO, TAR_FILETYPE_FILE, TAR_FILETYPE_HARDLINK, TAR_FILETYPE_SYMLINK, tar_fsys_namenode_queue_push(), trig_file_activate(), tar_entry::type, file_stat::uid, fsys_diversion::useinstead, vdew_nonambig, pkgbin::version, versiondescribe(), versiondescribe_c(), and warning().
Referenced by process_archive().
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().
struct pkg_deconf_list* deconfigure = NULL |
Referenced by clear_deconfigure_queue(), and enqueue_deconfigure().
struct varbuf_state fname_state |
Referenced by archivefiles(), and setupfnamevbs().
struct varbuf_state fnamenew_state |
Referenced by archivefiles(), and setupfnamevbs().
struct varbuf fnamenewvb |
Referenced by archivefiles(), cu_installnew(), setupfnamevbs(), tar_deferred_extract(), and tarobject().
struct varbuf_state fnametmp_state |
Referenced by archivefiles(), and setupfnamevbs().
struct varbuf fnametmpvb |
Referenced by archivefiles(), cu_installnew(), setupfnamevbs(), and tarobject().
struct varbuf fnamevb |
Referenced by archivefiles(), cu_installnew(), setupfnamevbs(), tar_deferred_extract(), and tarobject().