object is unpacked to '.dpkg.new' then the original is hardlinked to
'.dpkg.tmp' and finally the new object is renamed to overwrite the old
one. From an external perspective the file never ceased to exist.
- After the archive has been sucessfully unpacked the .dpkg.tmp files
+ After the archive has been successfully unpacked the .dpkg.tmp files
are erased. A failure causes all the .dpkg.tmp files to be restored.
Decisions about unpacking go like this:
[Note, this is reduced to only check if a file was expected to be
there]
- If the existing link/file is not a directory then it is replaced
- irregardless
+ regardless
- If the existing link/directory is being replaced by a directory then
absolutely nothing happens.
- If the existing link/directory is being replaced by a link then
/* This performs the setup for the extraction.. */
bool pkgExtract::DoItem(Item &Itm,int &Fd)
{
- char Temp[sizeof(FileName)];
-
/* Strip any leading/trailing /s from the filename, then copy it to the
temp buffer and re-apply the leading / We use a class variable
to store the new filename for use by the three extraction funcs */
// See if we can recover the backup file
if (Nde.end() == false)
{
+ char Temp[sizeof(FileName)];
snprintf(Temp,sizeof(Temp),"%s.%s",Itm.Name,TempExt);
if (rename(Temp,Itm.Name) != 0 && errno != ENOENT)
return _error->Errno("rename",_("Failed to rename %s to %s"),