diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2013-06-09 18:58:34 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2013-06-09 19:06:12 +0200 |
commit | b2ea1a47531266377abe4f12c6f21417ea96eea0 (patch) | |
tree | 8aacdd7ad522b9126b24837fc4a2b43a3a90cc64 /apt-pkg | |
parent | 2128d3fce44da34ecb1f0d784b703807f66b20f9 (diff) |
ensure state-dir exists before coyping cdrom files
We do the same in the acquire system which handles the 'normal'
downloads, so do it here as well even though its unlikely anyone
will ever notice (beside testcases of course …)
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/cdrom.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 9a9a854bf..a5668a50a 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -829,6 +829,14 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ log->Update(msg.str()); log->Update(_("Copying package lists..."), STEP_COPY); } + + // check for existence and possibly create state directory for copying + string const listDir = _config->FindDir("Dir::State::lists"); + string const partialListDir = listDir + "partial/"; + if (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::State"), partialListDir) == false && + CreateAPTDirectoryIfNeeded(listDir, partialListDir) == false) + return _error->Errno("cdrom", _("List directory %spartial is missing."), listDir.c_str()); + // take care of the signatures and copy them if they are ok // (we do this before PackageCopy as it modifies "List" and "SourceList") SigVerify SignVerify; |