|
@@ -1484,6 +1484,7 @@ bool DoInstall(CommandLine &CmdL)
|
|
|
if (Cache->BrokenCount() != 0)
|
|
if (Cache->BrokenCount() != 0)
|
|
|
BrokenFix = true;
|
|
BrokenFix = true;
|
|
|
|
|
|
|
|
|
|
+ unsigned int AutoMarkChanged = 0;
|
|
|
unsigned int ExpectedInst = 0;
|
|
unsigned int ExpectedInst = 0;
|
|
|
unsigned int Packages = 0;
|
|
unsigned int Packages = 0;
|
|
|
pkgProblemResolver Fix(Cache);
|
|
pkgProblemResolver Fix(Cache);
|
|
@@ -1606,6 +1607,18 @@ bool DoInstall(CommandLine &CmdL)
|
|
|
return false;
|
|
return false;
|
|
|
if (TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix,ExpectedInst) == false)
|
|
if (TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix,ExpectedInst) == false)
|
|
|
return false;
|
|
return false;
|
|
|
|
|
+
|
|
|
|
|
+ // see if we need to fix the auto-mark flag
|
|
|
|
|
+ // e.g. apt-get install foo
|
|
|
|
|
+ // where foo is marked automatic
|
|
|
|
|
+ if(Cache[Pkg].Install() == false &&
|
|
|
|
|
+ (Cache[Pkg].Flags & pkgCache::Flag::Auto))
|
|
|
|
|
+ {
|
|
|
|
|
+ ioprintf(c1out,_("%s set to manual installed.\n"),
|
|
|
|
|
+ Pkg.Name());
|
|
|
|
|
+ Cache->MarkAuto(Pkg,false);
|
|
|
|
|
+ AutoMarkChanged++;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1768,6 +1781,14 @@ bool DoInstall(CommandLine &CmdL)
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // if nothing changed in the cache, but only the automark information
|
|
|
|
|
+ // we write the StateFile here, otherwise it will be written in
|
|
|
|
|
+ // cache.commit()
|
|
|
|
|
+ if (AutoMarkChanged > 0 &&
|
|
|
|
|
+ Cache->DelCount() == 0 && Cache->InstCount() == 0 &&
|
|
|
|
|
+ Cache->BadCount() == 0)
|
|
|
|
|
+ Cache->writeStateFile(NULL);
|
|
|
|
|
+
|
|
|
// See if we need to prompt
|
|
// See if we need to prompt
|
|
|
if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0)
|
|
if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0)
|
|
|
return InstallPackages(Cache,false,false);
|
|
return InstallPackages(Cache,false,false);
|