Permalink
Browse files

Don't fall back to ancient /var/state/apt directory if "new" /var/lib…

…/apt

doesn't exist, instead explicitly complain and bail out.
  • Loading branch information...
1 parent d8aa24c commit 12a3aed5ce59324e8080851170a8ca9936922946 Panu Matilainen committed Jan 4, 2008
Showing with 3 additions and 5 deletions.
  1. +3 −5 apt-pkg/init.cc
View
@@ -52,12 +52,10 @@ bool pkgInitConfig(Configuration &Cnf)
// State
Cnf.Set("Dir::State","var/lib/apt/");
- /* Just in case something goes horribly wrong, we can fall back to the
- old /var/state paths.. */
struct stat St;
- if (stat("/var/lib/apt/.",&St) != 0 &&
- stat("/var/state/apt/.",&St) == 0)
- Cnf.Set("Dir::State","var/state/apt/");
+ if (stat(Cnf.FindDir("Dir::State").c_str(),&St) != 0)
+ return _error->Error(_("State directory %s doesn't exist."),
+ Cnf.FindDir("Dir::State").c_str());
Cnf.Set("Dir::State::lists","lists/");
Cnf.Set("Dir::State::cdroms","cdroms.list");

0 comments on commit 12a3aed

Please sign in to comment.