projects
/
apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge patch from Daniel Hartwig to Show a error message if {,dist-}upgrade is used...
[apt.git]
/
cmdline
/
apt-get.cc
diff --git
a/cmdline/apt-get.cc
b/cmdline/apt-get.cc
index e3c74a0994dd5a720eae1570bfc121699f418db8..cce80ccfeac3200e9b1eacb557f16baa634a83b0 100644
(file)
--- a/
cmdline/apt-get.cc
+++ b/
cmdline/apt-get.cc
@@
-1845,6
+1845,9
@@
bool DoAutomaticRemove(CacheFile &Cache)
packages */
bool DoUpgrade(CommandLine &CmdL)
{
packages */
bool DoUpgrade(CommandLine &CmdL)
{
+ if (CmdL.FileSize() != 1)
+ return _error->Error(_("The upgrade command takes no arguments"));
+
CacheFile Cache;
if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
return false;
CacheFile Cache;
if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
return false;
@@
-1912,7
+1915,6
@@
bool DoInstall(CommandLine &CmdL)
return false;
}
return false;
}
- unsigned short const order[] = { MOD_REMOVE, MOD_INSTALL, 0 };
TryToInstall InstallAction(Cache, Fix, BrokenFix);
TryToRemove RemoveAction(Cache, Fix);
TryToInstall InstallAction(Cache, Fix, BrokenFix);
TryToRemove RemoveAction(Cache, Fix);
@@
-1920,6
+1922,7
@@
bool DoInstall(CommandLine &CmdL)
// new scope for the ActionGroup
{
pkgDepCache::ActionGroup group(Cache);
// new scope for the ActionGroup
{
pkgDepCache::ActionGroup group(Cache);
+ unsigned short const order[] = { MOD_REMOVE, MOD_INSTALL, 0 };
for (unsigned short i = 0; order[i] != 0; ++i)
{
for (unsigned short i = 0; order[i] != 0; ++i)
{
@@
-2023,7
+2026,7
@@
bool DoInstall(CommandLine &CmdL)
/* Print out a list of suggested and recommended packages */
{
/* Print out a list of suggested and recommended packages */
{
- string SuggestsList, RecommendsList
, List
;
+ string SuggestsList, RecommendsList;
string SuggestsVersions, RecommendsVersions;
for (unsigned J = 0; J < Cache->Head().PackageCount; J++)
{
string SuggestsVersions, RecommendsVersions;
for (unsigned J = 0; J < Cache->Head().PackageCount; J++)
{
@@
-2178,6
+2181,9
@@
bool DoMarkAuto(CommandLine &CmdL)
/* Intelligent upgrader that will install and remove packages at will */
bool DoDistUpgrade(CommandLine &CmdL)
{
/* Intelligent upgrader that will install and remove packages at will */
bool DoDistUpgrade(CommandLine &CmdL)
{
+ if (CmdL.FileSize() != 1)
+ return _error->Error(_("The dist-upgrade command takes no arguments"));
+
CacheFile Cache;
if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
return false;
CacheFile Cache;
if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
return false;
@@
-2555,15
+2561,12
@@
bool DoSource(CommandLine &CmdL)
if(queued.find(Last->Index().ArchiveURI(I->Path)) != queued.end())
continue;
queued.insert(Last->Index().ArchiveURI(I->Path));
if(queued.find(Last->Index().ArchiveURI(I->Path)) != queued.end())
continue;
queued.insert(Last->Index().ArchiveURI(I->Path));
-
+
// check if we have a file with that md5 sum already localy
// check if we have a file with that md5 sum already localy
- if(!I->
MD5
Hash.empty() && FileExists(flNotDir(I->Path)))
+ if(!I->Hash.empty() && FileExists(flNotDir(I->Path)))
{
{
- FileFd Fd(flNotDir(I->Path), FileFd::ReadOnly);
- MD5Summation sum;
- sum.AddFD(Fd.Fd(), Fd.Size());
- Fd.Close();
- if((string)sum.Result() == I->MD5Hash)
+ HashString hash_string = HashString(I->Hash);
+ if(hash_string.VerifyFile(flNotDir(I->Path)))
{
ioprintf(c1out,_("Skipping already downloaded file '%s'\n"),
flNotDir(I->Path).c_str());
{
ioprintf(c1out,_("Skipping already downloaded file '%s'\n"),
flNotDir(I->Path).c_str());
@@
-2572,7
+2575,7
@@
bool DoSource(CommandLine &CmdL)
}
new pkgAcqFile(&Fetcher,Last->Index().ArchiveURI(I->Path),
}
new pkgAcqFile(&Fetcher,Last->Index().ArchiveURI(I->Path),
- I->
MD5
Hash,I->Size,
+ I->Hash,I->Size,
Last->Index().SourceInfo(*Last,*I),Src);
}
}
Last->Index().SourceInfo(*Last,*I),Src);
}
}
@@
-2714,7
+2717,7
@@
bool DoSource(CommandLine &CmdL)
{
string buildopts = _config->Find("APT::Get::Host-Architecture");
if (buildopts.empty() == false)
{
string buildopts = _config->Find("APT::Get::Host-Architecture");
if (buildopts.empty() == false)
- buildopts = "-a
" + buildopts + " ";
+ buildopts = "-a" + buildopts + " ";
buildopts.append(_config->Find("DPkg::Build-Options","-b -uc"));
// Call dpkg-buildpackage
buildopts.append(_config->Find("DPkg::Build-Options","-b -uc"));
// Call dpkg-buildpackage