dpkg 1.21.11
Macros | Functions | Variables
archives.c File Reference

(73a0987a8)

#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"
Include dependency graph for archives.c:

Macros

#define obstack_chunk_alloc   m_malloc
 
#define obstack_chunk_free   free
 

Functions

struct fsys_namenode_listtar_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. More...
 
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. More...
 

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_listdeconfigure = NULL
 

Macro Definition Documentation

◆ obstack_chunk_alloc

#define obstack_chunk_alloc   m_malloc

◆ obstack_chunk_free

#define obstack_chunk_free   free

Function Documentation

◆ archivefiles()

int archivefiles ( const char *const *  argv)

References act_avail, cmdinfo::arg_int, checkpath(), cipaction, f_noact, f_recursive, FORCE_NON_ROOT, in_force(), log_message(), modstatdb_open(), msdbrw_available_write, msdbrw_needsuperuser, msdbrw_readonly, msdbrw_write, cmdinfo::olong, pkg_infodb_upgrade(), and trigproc_install_hooks().

Here is the call graph for this function:

◆ check_breaks()

void check_breaks ( struct dependency dep,
struct pkginfo pkg,
const char *  pfilename 
)

References _, pkginfo::available, pkginfo::clientdata, depisok(), ensure_package_clientdata(), f_autodeconf, internerr, perpackagestate::istobe, notice(), PKG_ISTOBE_NORMAL, pkg_name(), pkgbin_name(), pnaw_always, pnaw_nonambig, varbuf_destroy(), varbuf_end_str(), and VARBUF_INIT.

Here is the call graph for this function:

◆ check_conflict()

void check_conflict ( struct dependency dep,
struct pkginfo pkg,
const char *  pfilename 
)

References pkginfo::available, pkginfo::clientdata, depisok(), ensure_package_clientdata(), pkgbin::essential, pkginfo::installed, pkgbin::is_protected, perpackagestate::istobe, PKG_ISTOBE_INSTALLNEW, PKG_WANT_HOLD, PKG_WANT_INSTALL, dependency::up, varbuf_destroy(), VARBUF_INIT, and pkginfo::want.

Here is the call graph for this function:

◆ clear_deconfigure_queue()

void clear_deconfigure_queue ( void  )

◆ cu_cidir()

void cu_cidir ( int  argc,
void **  argv 
)

References path_remove_tree().

Here is the call graph for this function:

◆ cu_fileslist()

void cu_fileslist ( int  argc,
void **  argv 
)

◆ cu_pathname()

void cu_pathname ( int  argc,
void **  argv 
)

References path_remove_tree().

Here is the call graph for this function:

◆ enqueue_deconfigure()

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.

Here is the call graph for this function:

◆ filesavespackage()

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.

Here is the call graph for this function:

◆ setupfnamevbs()

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, varbuf_end_str(), and varbuf_rollback().

Referenced by cu_installnew(), and tarobject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tar_deferred_extract()

void tar_deferred_extract ( struct fsys_namenode_list files,
struct pkginfo pkg 
)

◆ tar_fsys_namenode_queue_push()

struct fsys_namenode_list * tar_fsys_namenode_queue_push ( struct fsys_namenode_queue queue,
struct fsys_namenode namenode 
)

Referenced by tarobject().

Here is the caller graph for this function:

◆ tarfileread()

int tarfileread ( struct tar_archive tar,
char *  buf,
int  len 
)

References _, tarcontext::backendpipe, tar_archive::ctx, fd_read(), and ohshite().

Referenced by process_archive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tarobject()

int tarobject ( struct tar_archive tar,
struct tar_entry ti 
)

◆ wanttoinstall()

bool wanttoinstall ( struct pkginfo pkg)

Decide whether we want to install a new version of the package.

Parameters
pkgThe package with the version we might want to install
Return values
trueIf the package should be skipped.
falseIf 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().

Here is the call graph for this function:

Variable Documentation

◆ deconfigure

struct pkg_deconf_list* deconfigure = NULL

◆ fname_state

struct varbuf_state fname_state

Referenced by setupfnamevbs().

◆ fnamenew_state

struct varbuf_state fnamenew_state

Referenced by setupfnamevbs().

◆ fnamenewvb

struct varbuf fnamenewvb

Referenced by cu_installnew(), and setupfnamevbs().

◆ fnametmp_state

struct varbuf_state fnametmp_state

Referenced by setupfnamevbs().

◆ fnametmpvb

struct varbuf fnametmpvb

◆ fnamevb

struct varbuf fnamevb