summaryrefslogtreecommitdiff
path: root/apt-inst
diff options
context:
space:
mode:
Diffstat (limited to 'apt-inst')
-rw-r--r--apt-inst/deb/dpkgdb.cc2
-rw-r--r--apt-inst/dirstream.cc16
2 files changed, 17 insertions, 1 deletions
diff --git a/apt-inst/deb/dpkgdb.cc b/apt-inst/deb/dpkgdb.cc
index c6a0e80e6..718e1ab98 100644
--- a/apt-inst/deb/dpkgdb.cc
+++ b/apt-inst/deb/dpkgdb.cc
@@ -383,7 +383,7 @@ bool debDpkgDB::ReadyFileList(OpProgress &Progress)
return _error->Error(_("The pkg cache must be initialized first"));
if (FList != 0)
{
- Progress.OverallProgress(1,1,1,_("Reading file list"));
+ Progress.OverallProgress(1,1,1,_("Reading file listing"));
return true;
}
diff --git a/apt-inst/dirstream.cc b/apt-inst/dirstream.cc
index 7ae93c9b0..898ede31b 100644
--- a/apt-inst/dirstream.cc
+++ b/apt-inst/dirstream.cc
@@ -61,6 +61,22 @@ bool pkgDirStream::DoItem(Item &Itm,int &Fd)
case Item::CharDevice:
case Item::BlockDevice:
case Item::Directory:
+ {
+ struct stat Buf;
+ // check if the dir is already there, if so return true
+ if (stat(Itm.Name,&Buf) == 0)
+ {
+ if(S_ISDIR(Buf.st_mode))
+ return true;
+ // something else is there already, return false
+ return false;
+ }
+ // nothing here, create the dir
+ if(mkdir(Itm.Name,Itm.Mode) < 0)
+ return false;
+ return true;
+ break;
+ }
case Item::FIFO:
break;
}