dpkg 1.22.7-3-g89f48
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
db-fsys.h File Reference

(5cdc783e5)

#include <sys/stat.h>
#include <stdio.h>
#include <dpkg/file.h>
#include <dpkg/fsys.h>
Include dependency graph for db-fsys.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dpkg_db
 

Macros

#define LISTFILE   "list"
 
#define HASHFILE   "md5sums"
 

Enumerations

enum  dpkg_db_error { DPKG_DB_LOAD = 0 , DPKG_DB_NONE = -1 , DPKG_DB_SAME = -2 }
 
enum  statdb_parse_flags { STATDB_PARSE_NORMAL = 0 , STATDB_PARSE_LAX = 1 }
 

Functions

enum dpkg_db_error dpkg_db_reopen (struct dpkg_db *db)
 
void ensure_diversions (void)
 
uid_t statdb_parse_uid (const char *str)
 
gid_t statdb_parse_gid (const char *str)
 
mode_t statdb_parse_mode (const char *str)
 
void ensure_statoverrides (enum statdb_parse_flags flags)
 
void ensure_packagefiles_available (struct pkginfo *pkg)
 Load the list of files in this package into memory, or update the list if it is there but stale.
 
void ensure_allinstfiles_available (void)
 
void ensure_allinstfiles_available_quiet (void)
 
void note_must_reread_files_inpackage (struct pkginfo *pkg)
 
void parse_filehash (struct pkginfo *pkg, struct pkgbin *pkgbin)
 
void write_filelist_except (struct pkginfo *pkg, struct pkgbin *pkgbin, struct fsys_namenode_list *list, enum fsys_namenode_flags mask)
 
void write_filehash_except (struct pkginfo *pkg, struct pkgbin *pkgbin, struct fsys_namenode_list *list, enum fsys_namenode_flags mask)
 

Macro Definition Documentation

◆ HASHFILE

#define HASHFILE   "md5sums"

◆ LISTFILE

#define LISTFILE   "list"

Enumeration Type Documentation

◆ dpkg_db_error

Enumerator
DPKG_DB_LOAD 

The database is new or has changed, should be loaded.

DPKG_DB_NONE 

No database file found.

DPKG_DB_SAME 

The database is already loaded and has not changed.

◆ statdb_parse_flags

Enumerator
STATDB_PARSE_NORMAL 
STATDB_PARSE_LAX 

Function Documentation

◆ dpkg_db_reopen()

enum dpkg_db_error dpkg_db_reopen ( struct dpkg_db db)

References _, dbg_general, debug(), dpkg_db_get_path(), DPKG_DB_LOAD, DPKG_DB_NONE, DPKG_DB_SAME, dpkg_db::file, dpkg_db::name, ohshite(), onerr_abort, dpkg_db::pathname, setcloexec(), and dpkg_db::st.

Referenced by ensure_diversions(), and ensure_statoverrides().

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

◆ ensure_allinstfiles_available()

void ensure_allinstfiles_available ( void  )

References _, ensure_packagefiles_available(), fsys_hash_entries(), max, pkg_array::n_pkgs, P_, pkg_array_destroy(), pkg_array_init_from_hash(), PKG_FILESDB_LOAD_DONE, PKG_FILESDB_LOAD_INPROGRESS, pkg_hash_count_pkg(), pkg_array::pkgs, progress_done(), progress_init(), and progress_step().

Referenced by deferred_remove(), ensure_allinstfiles_available_quiet(), and process_archive().

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

◆ ensure_allinstfiles_available_quiet()

void ensure_allinstfiles_available_quiet ( void  )

References ensure_allinstfiles_available(), and PKG_FILESDB_LOAD_DONE.

Here is the call graph for this function:

◆ ensure_diversions()

void ensure_diversions ( void  )

References _, fsys_diversion::camefrom, DIVERSIONSFILE, fsys_namenode::divert, DPKG_DB_NONE, dpkg_db_reopen(), DPKG_DB_SAME, fgets_checked(), fgets_must(), FHFF_NONE, dpkg_db::file, fsys_hash_find_node(), MAXDIVERTFILENAME, dpkg_db::name, fsys_namenode::name, fsys_diversion::next, nfmalloc(), ohshit(), onerr_abort, dpkg_db::pathname, pkg_hash_find_set(), fsys_diversion::pkgset, and fsys_diversion::useinstead.

Referenced by archivefiles(), maintscript_postinst(), packages(), and verify().

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

◆ ensure_packagefiles_available()

void ensure_packagefiles_available ( struct pkginfo pkg)

Load the list of files in this package into memory, or update the list if it is there but stale.

References _, varbuf::buf, pkginfo::configversion, DPKG_ERROR_INIT, dpkg_error_print(), dpkg_version_is_informative(), file_slurp(), pkginfo::files, pkginfo::files_list_valid, pkginfo::installed, LISTFILE, onerr_abort, pkg_files_blank(), pkg_infodb_get_file(), pkg_name(), PKG_STAT_CONFIGFILES, PKG_STAT_NOTINSTALLED, pnaw_nonambig, pkginfo::status, dpkg_error::syserrno, dpkg_error::type, varbuf::used, varbuf_destroy(), VARBUF_INIT, and warning().

Referenced by ensure_allinstfiles_available().

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

◆ ensure_statoverrides()

void ensure_statoverrides ( enum statdb_parse_flags  flags)

References _, DPKG_DB_NONE, dpkg_db_reopen(), DPKG_DB_SAME, DPKGSTAT, fd_read(), FHFF_NONE, dpkg_db::file, fsys_hash_find_node(), fsys_hash_iter_free(), fsys_hash_iter_new(), fsys_hash_iter_next(), file_stat::gid, file_stat::gname, m_malloc(), file_stat::mode, dpkg_db::name, nfmalloc(), nfstrsave(), ohshit(), ohshite(), onerr_abort, dpkg_db::pathname, dpkg_db::st, statdb_parse_gid(), STATDB_PARSE_LAX, statdb_parse_mode(), statdb_parse_uid(), fsys_namenode::statoverride, STATOVERRIDEFILE, file_stat::uid, and file_stat::uname.

Referenced by archivefiles().

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

◆ note_must_reread_files_inpackage()

void note_must_reread_files_inpackage ( struct pkginfo pkg)

References pkginfo::files_list_valid.

Referenced by write_filelist_except().

Here is the caller graph for this function:

◆ parse_filehash()

void parse_filehash ( struct pkginfo pkg,
struct pkgbin pkgbin 
)

References _, varbuf::buf, DPKG_ERROR_INIT, dpkg_error_print(), file_slurp(), HASHFILE, pkg_infodb_get_file(), pkg_name(), pnaw_nonambig, dpkg_error::syserrno, dpkg_error::type, varbuf::used, varbuf_destroy(), and VARBUF_INIT.

Here is the call graph for this function:

◆ statdb_parse_gid()

gid_t statdb_parse_gid ( const char *  str)

References _, and ohshit().

Referenced by ensure_statoverrides().

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

◆ statdb_parse_mode()

mode_t statdb_parse_mode ( const char *  str)

References _, and ohshit().

Referenced by ensure_statoverrides().

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

◆ statdb_parse_uid()

uid_t statdb_parse_uid ( const char *  str)

References _, and ohshit().

Referenced by ensure_statoverrides().

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

◆ write_filehash_except()

void write_filehash_except ( struct pkginfo pkg,
struct pkgbin pkgbin,
struct fsys_namenode_list list,
enum fsys_namenode_flags  mask 
)

References atomic_file_close(), atomic_file_commit(), atomic_file_free(), atomic_file_new(), atomic_file_open(), atomic_file_sync(), pkginfo::available, dbg_general, debug(), dir_sync_path(), fsys_namenode::flags, HASHFILE, fsys_namenode::name, fsys_namenode_list::namenode, fsys_namenode::newhash, fsys_namenode_list::next, pkg_infodb_get_dir(), pkg_infodb_get_file(), and pkg_infodb_has_file().

Referenced by process_archive().

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

◆ write_filelist_except()

void write_filelist_except ( struct pkginfo pkg,
struct pkgbin pkgbin,
struct fsys_namenode_list list,
enum fsys_namenode_flags  mask 
)

References atomic_file_close(), atomic_file_commit(), atomic_file_free(), atomic_file_new(), atomic_file_open(), atomic_file_sync(), dir_sync_path(), fsys_namenode::flags, LISTFILE, fsys_namenode::name, fsys_namenode_list::namenode, fsys_namenode_list::next, note_must_reread_files_inpackage(), pkg_infodb_get_dir(), and pkg_infodb_get_file().

Referenced by process_archive().

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