summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-19 16:12:02 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-19 16:12:02 +0200
commit6407057398e86db934188e7527a21f09cce4e96b (patch)
tree49e08e007d68cfa11ed5760f4315717860e46635 /cmdline
parent36afd8495a5646ccdec0153c93945a5a27606fce (diff)
parentd6df222d8edb3e38401affcee2a4e5eba605da32 (diff)
* merged from apt--tasks
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index cd43e17c7..0c2e15d7e 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1513,18 +1513,16 @@ bool DoInstallTask(CommandLine &CmdL)
pkgRecords Recs(Cache);
unsigned int ExpectedInst = 0;
- unsigned int Packages = 0;
pkgProblemResolver Fix(Cache);
char buf[64*1024];
for (const char **I = CmdL.FileList + 1; *I != 0; I++)
{
regex_t Pattern;
- int Res;
// build regexp for the task
char S[300];
- snprintf(S, sizeof(S), "^Task:.*%s.*\n", *I);
+ snprintf(S, sizeof(S), "^Task:.*[^a-z]%s[^a-z].*\n", *I);
regcomp(&Pattern,S, REG_EXTENDED | REG_NOSUB | REG_NEWLINE);
for (Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
@@ -1538,14 +1536,15 @@ bool DoInstallTask(CommandLine &CmdL)
buf[end-start] = 0x0;
if (regexec(&Pattern,buf,0,0,0) != 0)
continue;
- TryToInstall(Pkg,Cache,Fix,false,false,ExpectedInst);
+ TryToInstall(Pkg,Cache,Fix,false,true,ExpectedInst);
}
+
+ regfree(&Pattern);
}
// Call the scored problem resolver
Fix.InstallProtect();
- if (Fix.Resolve(true) == false)
- _error->Discard();
+ Fix.Resolve(true);
// prompt for install
return InstallPackages(Cache,false,true);