summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:55:05 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:55:05 +0000
commit83ab33fcc08192f31fc02e680b84aa8489f76c50 (patch)
treef4a232a1ae4ebe6cdb64b89f3a41664680515a66 /apt-pkg/acquire-item.cc
parent67db871e3a0a0c207d4675ca046f2d2b796cfb6d (diff)
Doc fix
Author: jgg Date: 1999-10-31 06:32:27 GMT Doc fix
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 2bae109fd..ddaf260ea 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire-item.cc,v 1.39 1999/10/17 20:58:36 jgg Exp $
+// $Id: acquire-item.cc,v 1.40 1999/10/31 06:32:27 jgg Exp $
/* ######################################################################
Acquire Item - Item to acquire
@@ -638,9 +638,18 @@ void pkgAcqFile::Done(string Message,unsigned long Size,string MD5)
return;
}
+ // Erase the file if it is a symlink so we can overwrite it
+ struct stat St;
+ if (lstat(DestFile.c_str(),&St) == 0)
+ {
+ if (S_ISLNK(St.st_mode) != 0)
+ unlink(DestFile.c_str());
+ }
+
+ // Symlink the file
if (symlink(FileName.c_str(),DestFile.c_str()) != 0)
{
- ErrorText = "Link to " + DestFile + "failure ";
+ ErrorText = "Link to " + DestFile + " failure ";
Status = StatError;
Complete = false;
}