diff options
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index aa54677be..c9ec481aa 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -918,7 +918,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, pkgAcquire::UriIterator I = Fetcher.UriBegin(); for (; I != Fetcher.UriEnd(); I++) cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << - I->Owner->FileSize << ' ' << I->Owner->MD5Sum() << endl; + I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl; return true; } @@ -1359,7 +1359,7 @@ bool DoUpdate(CommandLine &CmdL) pkgAcquire::UriIterator I = Fetcher.UriBegin(); for (; I != Fetcher.UriEnd(); I++) cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << - I->Owner->FileSize << ' ' << I->Owner->MD5Sum() << endl; + I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl; return true; } @@ -1507,7 +1507,8 @@ bool DoUpgrade(CommandLine &CmdL) bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, bool BrokenFix, unsigned int& ExpectedInst, - const char *taskname) + const char *taskname, + bool Remove) { const char *start, *end; pkgCache::PkgIterator Pkg; @@ -1519,9 +1520,9 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, // build regexp for the task char S[300]; - // better: "^Task:.*[^a-z]lamp-server([^a-z]|\n)" ? - snprintf(S, sizeof(S), "^Task:.*[^a-z]%s[^a-z].*$", taskname); - regcomp(&Pattern,S, REG_EXTENDED | REG_NOSUB | REG_NEWLINE); + snprintf(S, sizeof(S), "^Task:.*[, ]%s([, ]|$)", taskname); + if(regcomp(&Pattern,S, REG_EXTENDED | REG_NOSUB | REG_NEWLINE) != 0) + return _error->Error("Failed to compile task regexp"); bool found = false; bool res = true; @@ -1536,7 +1537,7 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, buf[end-start] = 0x0; if (regexec(&Pattern,buf,0,0,0) != 0) continue; - res &= TryToInstall(Pkg,Cache,Fix,false,true,ExpectedInst); + res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst); found = true; } @@ -1604,7 +1605,7 @@ bool DoInstall(CommandLine &CmdL) // tasks must always be confirmed ExpectedInst += 1000; // see if we can install it - TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S); + TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S, Remove); continue; } @@ -2210,7 +2211,7 @@ bool DoSource(CommandLine &CmdL) pkgAcquire::UriIterator I = Fetcher.UriBegin(); for (; I != Fetcher.UriEnd(); I++) cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << - I->Owner->FileSize << ' ' << I->Owner->MD5Sum() << endl; + I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl; return true; } @@ -2581,8 +2582,8 @@ bool DoMoo(CommandLine &CmdL) /* */ bool ShowHelp(CommandLine &CmdL) { - ioprintf(cout,_("%s %s for %s %s compiled on %s %s\n"),PACKAGE,VERSION, - COMMON_OS,COMMON_CPU,__DATE__,__TIME__); + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) { |