Browse files

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

…/var/lib/apt"

This reverts commit 12a3aed.
  • Loading branch information...
1 parent 563d372 commit 937eda5529de0fe473652f99fbfb708aacf9d22e @ktf committed May 21, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 apt-pkg/init.cc
View
8 apt-pkg/init.cc
@@ -52,10 +52,12 @@ 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(Cnf.FindDir("Dir::State").c_str(),&St) != 0)
- return _error->Error(_("State directory %s doesn't exist."),
- Cnf.FindDir("Dir::State").c_str());
+ if (stat("/var/lib/apt/.",&St) != 0 &&
+ stat("/var/state/apt/.",&St) == 0)
+ Cnf.Set("Dir::State","var/state/apt/");
Cnf.Set("Dir::State::lists","lists/");
Cnf.Set("Dir::State::cdroms","cdroms.list");

0 comments on commit 937eda5

Please sign in to comment.