dpkg 1.21.11
Functions | Variables
cleanup.c File Reference

(affb86e43)

#include <config.h>
#include <compat.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <utime.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <dpkg/i18n.h>
#include <dpkg/dpkg.h>
#include <dpkg/dpkg-db.h>
#include <dpkg/pkg.h>
#include <dpkg/path.h>
#include <dpkg/options.h>
#include <dpkg/db-fsys.h>
#include "main.h"
#include "archives.h"
Include dependency graph for cleanup.c:

Functions

void cu_installnew (int argc, void **argv)
 Something went wrong and we're undoing. More...
 
void cu_prermupgrade (int argc, void **argv)
 
void ok_prermdeconfigure (int argc, void **argv)
 
void cu_prermdeconfigure (int argc, void **argv)
 
void cu_prerminfavour (int argc, void **argv)
 
void cu_preinstverynew (int argc, void **argv)
 
void cu_preinstnew (int argc, void **argv)
 
void cu_preinstupgrade (int argc, void **argv)
 
void cu_postrmupgrade (int argc, void **argv)
 
void cu_prermremove (int argc, void **argv)
 

Variables

int cleanup_pkg_failed =0
 
int cleanup_conflictor_failed =0
 

Function Documentation

◆ cu_installnew()

void cu_installnew ( int  argc,
void **  argv 
)

Something went wrong and we're undoing.

We have the following possible situations for non-conffiles: «pathname».dpkg-tmp exists - in this case we want to remove «pathname» if it exists and replace it with «pathname».dpkg-tmp. This undoes the backup operation. «pathname».dpkg-tmp does not exist - «pathname» may be on the disk, as a new file which didn't fail, remove it if it is.

In both cases, we also make sure we delete «pathname».dpkg-new in case that's still hanging around.

For conffiles, we simply delete «pathname».dpkg-new. For these, «pathname».dpkg-tmp shouldn't exist, as we don't make a backup at this stage. Just to be on the safe side, though, we don't look for it.

References _, varbuf::buf, cleanup_conflictor_failed, cleanup_pkg_failed, dbg_eachfile, dbg_eachfiledetail, debug(), fsys_namenode::flags, fnamenewvb, fnametmpvb, fnamevb, FNNF_NEW_CONFF, FNNF_NO_ATOMIC_OVERWRITE, FNNF_PLACED_ON_DISK, fsys_namenode::name, ohshite(), secure_remove(), and setupfnamevbs().

Here is the call graph for this function:

◆ cu_postrmupgrade()

void cu_postrmupgrade ( int  argc,
void **  argv 
)

References pkginfo::available, cleanup_pkg_failed, maintscript_installed(), PREINSTFILE, vdew_nonambig, pkgbin::version, and versiondescribe().

Here is the call graph for this function:

◆ cu_preinstnew()

void cu_preinstnew ( int  argc,
void **  argv 
)

References pkginfo::available, cleanup_pkg_failed, pkginfo::installed, maintscript_new(), modstatdb_note(), pkg_clear_eflags(), PKG_EFLAG_REINSTREQ, pkg_set_status(), PKG_STAT_CONFIGFILES, POSTRMFILE, vdew_nonambig, pkgbin::version, and versiondescribe().

Here is the call graph for this function:

◆ cu_preinstupgrade()

void cu_preinstupgrade ( int  argc,
void **  argv 
)

References pkginfo::available, cleanup_pkg_failed, pkginfo::installed, maintscript_new(), modstatdb_note(), pkg_clear_eflags(), PKG_EFLAG_REINSTREQ, pkg_set_status(), POSTRMFILE, vdew_nonambig, pkgbin::version, and versiondescribe().

Here is the call graph for this function:

◆ cu_preinstverynew()

void cu_preinstverynew ( int  argc,
void **  argv 
)

References cleanup_pkg_failed, pkginfo::installed, maintscript_new(), modstatdb_note(), pkg_clear_eflags(), PKG_EFLAG_REINSTREQ, pkg_set_status(), PKG_STAT_NOTINSTALLED, pkgbin_blank(), and POSTRMFILE.

Here is the call graph for this function:

◆ cu_prermdeconfigure()

void cu_prermdeconfigure ( int  argc,
void **  argv 
)

References pkginfo::available, pkginfo::installed, maintscript_postinst(), pkg_name(), PKG_STAT_INSTALLED, pkgbin_name(), pnaw_nonambig, post_postinst_tasks(), vdew_nonambig, pkgbin::version, and versiondescribe().

Here is the call graph for this function:

◆ cu_prerminfavour()

void cu_prerminfavour ( int  argc,
void **  argv 
)

References pkginfo::available, cleanup_conflictor_failed, maintscript_postinst(), pkg_clear_eflags(), PKG_EFLAG_REINSTREQ, PKG_STAT_INSTALLED, pkgbin_name(), pnaw_nonambig, post_postinst_tasks(), vdew_nonambig, pkgbin::version, and versiondescribe().

Here is the call graph for this function:

◆ cu_prermremove()

void cu_prermremove ( int  argc,
void **  argv 
)

References cleanup_pkg_failed, maintscript_postinst(), pkg_clear_eflags(), PKG_EFLAG_REINSTREQ, and post_postinst_tasks().

Here is the call graph for this function:

◆ cu_prermupgrade()

void cu_prermupgrade ( int  argc,
void **  argv 
)

References pkginfo::available, cleanup_pkg_failed, maintscript_postinst(), pkg_clear_eflags(), PKG_EFLAG_REINSTREQ, PKG_STAT_INSTALLED, post_postinst_tasks(), vdew_nonambig, pkgbin::version, and versiondescribe().

Here is the call graph for this function:

◆ ok_prermdeconfigure()

void ok_prermdeconfigure ( int  argc,
void **  argv 
)

References act_install, cmdinfo::arg_int, cipaction, and enqueue_package().

Here is the call graph for this function:

Variable Documentation

◆ cleanup_conflictor_failed

int cleanup_conflictor_failed =0

Referenced by cu_installnew(), and cu_prerminfavour().

◆ cleanup_pkg_failed

int cleanup_pkg_failed =0