]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cdrom.cc
always run 'dpkg --configure -a' at the end of our dpkg callings
[apt.git] / apt-pkg / cdrom.cc
index b97f7b0365d527d880ace99145ea54314f4b02f3..aaa7b82e0f3e392e682ce846cd449317893982cd 100644 (file)
@@ -822,8 +822,11 @@ bool pkgCdrom::Add(pkgCdromStatus *log)                                    /*{{{*/
    // 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)
+   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());