- if(log) {
- msg.str("");
- ioprintf(msg, _("This disc is called: \n'%s'\n"), Name.c_str());
- log->Update(msg.str());
+ if(log != NULL)
+ {
+ string msg;
+ strprintf(msg, _("This disc is called: \n'%s'\n"), Name.c_str());
+ log->Update(msg);
+ 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/";
+ mode_t const mode = umask(S_IWGRP | S_IWOTH);
+ bool const creation_fail = (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::State"), partialListDir) == false &&
+ CreateAPTDirectoryIfNeeded(listDir, partialListDir) == false);
+ umask(mode);
+ if (creation_fail == true)
+ {
+ UnmountCDROM(CDROM, NULL);
+ return _error->Errno("cdrom", _("List directory %spartial is missing."), listDir.c_str());