summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2006-10-02 01:03:40 +0200
committerMichael Vogt <egon@bottom>2006-10-02 01:03:40 +0200
commitdd09a217ac0d331f4a0324cf42559da5d35edc9a (patch)
treef525d71757612671df3d5538b306cbf5eea14677
parente6549dfd43ccf76b6adbe0149b1aa42ea61cb962 (diff)
parent39cc1bbdd0faa13dcb150b573f56cd2dd64fa460 (diff)
* merged the "apt--install-task" branch
-rw-r--r--cmdline/apt-get.cc59
-rw-r--r--debian/changelog1
-rw-r--r--po/apt-all.pot103
3 files changed, 113 insertions, 50 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 4dfb3325c..cb0690bdf 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1469,6 +1469,51 @@ bool DoUpgrade(CommandLine &CmdL)
return InstallPackages(Cache,true);
}
/*}}}*/
+// DoInstallTask - Install task from the command line /*{{{*/
+// ---------------------------------------------------------------------
+/* Install named task */
+bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix,
+ bool BrokenFix,
+ unsigned int& ExpectedInst,
+ const char *taskname)
+{
+ const char *start, *end;
+ pkgCache::PkgIterator Pkg;
+ char buf[64*1024];
+ regex_t Pattern;
+
+ // get the records
+ pkgRecords Recs(Cache);
+
+ // build regexp for the task
+ char S[300];
+ snprintf(S, sizeof(S), "^Task:.*[^a-z]%s[^a-z].*\n", taskname);
+ regcomp(&Pattern,S, REG_EXTENDED | REG_NOSUB | REG_NEWLINE);
+
+ bool found = false;
+ bool res = true;
+ for (Pkg = Cache.PkgBegin(); Pkg.end() == false; Pkg++)
+ {
+ pkgCache::VerIterator ver = Cache[Pkg].CandidateVerIter(Cache);
+ if(ver.end())
+ continue;
+ pkgRecords::Parser &parser = Recs.Lookup(ver.FileList());
+ parser.GetRec(start,end);
+ strncpy(buf, start, end-start);
+ buf[end-start] = 0x0;
+ if (regexec(&Pattern,buf,0,0,0) != 0)
+ continue;
+ res &= TryToInstall(Pkg,Cache,Fix,false,BrokenFix,ExpectedInst);
+ found = true;
+ }
+
+ if(!found)
+ _error->Error(_("Couldn't find task %s"),taskname);
+
+ regfree(&Pattern);
+ return res;
+}
+
// DoInstall - Install packages from the command line /*{{{*/
// ---------------------------------------------------------------------
/* Install named packages */
@@ -1510,6 +1555,18 @@ bool DoInstall(CommandLine &CmdL)
bool Remove = DefRemove;
char *VerTag = 0;
bool VerIsRel = false;
+
+ // this is a task!
+ if (Length >= 1 && S[Length - 1] == '^')
+ {
+ S[--Length] = 0;
+ // tasks must always be confirmed
+ ExpectedInst += 1000;
+ // see if we can install it
+ TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S);
+ continue;
+ }
+
while (Cache->FindPkg(S).end() == true)
{
// Handle an optional end tag indicating what to do
@@ -1526,7 +1583,7 @@ bool DoInstall(CommandLine &CmdL)
S[--Length] = 0;
continue;
}
-
+
char *Slash = strchr(S,'=');
if (Slash != 0)
{
diff --git a/debian/changelog b/debian/changelog
index 94dba2813..7768234f5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ apt (0.6.46.1exp1) experimental; urgency=low
see what not-installed recommends are on the system)
- fix of recommended packages display (only show CandidateVersion
fix or-group handling)
+ * merged "install-task" branch (use with "apt-get install taskname^")
* methods/gzip.cc:
- deal with empty files
* Applied patch from Daniel Schepler to make apt bin-NMU able.
diff --git a/po/apt-all.pot b/po/apt-all.pot
index 352f2f5a6..46299c8b6 100644
--- a/po/apt-all.pot
+++ b/po/apt-all.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2006-09-12 11:18+0200\n"
+"POT-Creation-Date: 2006-09-19 17:21+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -148,7 +148,7 @@ msgstr ""
#: cmdline/apt-cache.cc:1652 cmdline/apt-cdrom.cc:138 cmdline/apt-config.cc:70
#: cmdline/apt-extracttemplates.cc:225 ftparchive/apt-ftparchive.cc:550
-#: cmdline/apt-get.cc:2387 cmdline/apt-sortpkgs.cc:144
+#: cmdline/apt-get.cc:2444 cmdline/apt-sortpkgs.cc:144
#, c-format
msgid "%s %s for %s %s compiled on %s %s\n"
msgstr ""
@@ -546,7 +546,7 @@ msgstr ""
msgid "Y"
msgstr ""
-#: cmdline/apt-get.cc:142 cmdline/apt-get.cc:1506
+#: cmdline/apt-get.cc:142 cmdline/apt-get.cc:1563
#, c-format
msgid "Regex compilation error - %s"
msgstr ""
@@ -705,11 +705,11 @@ msgstr ""
msgid "Internal error, Ordering didn't finish"
msgstr ""
-#: cmdline/apt-get.cc:791 cmdline/apt-get.cc:1818 cmdline/apt-get.cc:1851
+#: cmdline/apt-get.cc:791 cmdline/apt-get.cc:1875 cmdline/apt-get.cc:1908
msgid "Unable to lock the download directory"
msgstr ""
-#: cmdline/apt-get.cc:801 cmdline/apt-get.cc:1899 cmdline/apt-get.cc:2135
+#: cmdline/apt-get.cc:801 cmdline/apt-get.cc:1956 cmdline/apt-get.cc:2192
#: apt-pkg/cachefile.cc:67
msgid "The list of sources could not be read."
msgstr ""
@@ -738,7 +738,7 @@ msgstr ""
msgid "After unpacking %sB disk space will be freed.\n"
msgstr ""
-#: cmdline/apt-get.cc:846 cmdline/apt-get.cc:1989
+#: cmdline/apt-get.cc:846 cmdline/apt-get.cc:2046
#, c-format
msgid "Couldn't determine free space in %s"
msgstr ""
@@ -772,7 +772,7 @@ msgstr ""
msgid "Do you want to continue [Y/n]? "
msgstr ""
-#: cmdline/apt-get.cc:961 cmdline/apt-get.cc:1365 cmdline/apt-get.cc:2032
+#: cmdline/apt-get.cc:961 cmdline/apt-get.cc:1365 cmdline/apt-get.cc:2089
#, c-format
msgid "Failed to fetch %s %s\n"
msgstr ""
@@ -781,7 +781,7 @@ msgstr ""
msgid "Some files failed to download"
msgstr ""
-#: cmdline/apt-get.cc:980 cmdline/apt-get.cc:2041
+#: cmdline/apt-get.cc:980 cmdline/apt-get.cc:2098
msgid "Download complete and in download only mode"
msgstr ""
@@ -891,27 +891,32 @@ msgstr ""
msgid "Internal error, AllUpgrade broke stuff"
msgstr ""
-#: cmdline/apt-get.cc:1493 cmdline/apt-get.cc:1529
+#: cmdline/apt-get.cc:1448
+#, c-format
+msgid "Couldn't find task %s"
+msgstr ""
+
+#: cmdline/apt-get.cc:1550 cmdline/apt-get.cc:1586
#, c-format
msgid "Couldn't find package %s"
msgstr ""
-#: cmdline/apt-get.cc:1516
+#: cmdline/apt-get.cc:1573
#, c-format
msgid "Note, selecting %s for regex '%s'\n"
msgstr ""
-#: cmdline/apt-get.cc:1546
+#: cmdline/apt-get.cc:1603
msgid "You might want to run `apt-get -f install' to correct these:"
msgstr ""
-#: cmdline/apt-get.cc:1549
+#: cmdline/apt-get.cc:1606
msgid ""
"Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a "
"solution)."
msgstr ""
-#: cmdline/apt-get.cc:1561
+#: cmdline/apt-get.cc:1618
msgid ""
"Some packages could not be installed. This may mean that you have\n"
"requested an impossible situation or if you are using the unstable\n"
@@ -919,163 +924,163 @@ msgid ""
"or been moved out of Incoming."
msgstr ""
-#: cmdline/apt-get.cc:1569
+#: cmdline/apt-get.cc:1626
msgid ""
"Since you only requested a single operation it is extremely likely that\n"
"the package is simply not installable and a bug report against\n"
"that package should be filed."
msgstr ""
-#: cmdline/apt-get.cc:1574
+#: cmdline/apt-get.cc:1631
msgid "The following information may help to resolve the situation:"
msgstr ""
-#: cmdline/apt-get.cc:1577
+#: cmdline/apt-get.cc:1634
msgid "Broken packages"
msgstr ""
-#: cmdline/apt-get.cc:1603
+#: cmdline/apt-get.cc:1660
msgid "The following extra packages will be installed:"
msgstr ""
-#: cmdline/apt-get.cc:1692
+#: cmdline/apt-get.cc:1749
msgid "Suggested packages:"
msgstr ""
-#: cmdline/apt-get.cc:1693
+#: cmdline/apt-get.cc:1750
msgid "Recommended packages:"
msgstr ""
-#: cmdline/apt-get.cc:1713
+#: cmdline/apt-get.cc:1770
msgid "Calculating upgrade... "
msgstr ""
-#: cmdline/apt-get.cc:1716 methods/ftp.cc:702 methods/connect.cc:101
+#: cmdline/apt-get.cc:1773 methods/ftp.cc:702 methods/connect.cc:101
msgid "Failed"
msgstr ""
-#: cmdline/apt-get.cc:1721
+#: cmdline/apt-get.cc:1778
msgid "Done"
msgstr ""
-#: cmdline/apt-get.cc:1786 cmdline/apt-get.cc:1794
+#: cmdline/apt-get.cc:1843 cmdline/apt-get.cc:1851
msgid "Internal error, problem resolver broke stuff"
msgstr ""
-#: cmdline/apt-get.cc:1894
+#: cmdline/apt-get.cc:1951
msgid "Must specify at least one package to fetch source for"
msgstr ""
-#: cmdline/apt-get.cc:1924 cmdline/apt-get.cc:2153
+#: cmdline/apt-get.cc:1981 cmdline/apt-get.cc:2210
#, c-format
msgid "Unable to find a source package for %s"
msgstr ""
-#: cmdline/apt-get.cc:1968
+#: cmdline/apt-get.cc:2025
#, c-format
msgid "Skipping already downloaded file '%s'\n"
msgstr ""
-#: cmdline/apt-get.cc:1992
+#: cmdline/apt-get.cc:2049
#, c-format
msgid "You don't have enough free space in %s"
msgstr ""
-#: cmdline/apt-get.cc:1997
+#: cmdline/apt-get.cc:2054
#, c-format
msgid "Need to get %sB/%sB of source archives.\n"
msgstr ""
-#: cmdline/apt-get.cc:2000
+#: cmdline/apt-get.cc:2057
#, c-format
msgid "Need to get %sB of source archives.\n"
msgstr ""
-#: cmdline/apt-get.cc:2006
+#: cmdline/apt-get.cc:2063
#, c-format
msgid "Fetch source %s\n"
msgstr ""
-#: cmdline/apt-get.cc:2037
+#: cmdline/apt-get.cc:2094
msgid "Failed to fetch some archives."
msgstr ""
-#: cmdline/apt-get.cc:2065
+#: cmdline/apt-get.cc:2122
#, c-format
msgid "Skipping unpack of already unpacked source in %s\n"
msgstr ""
-#: cmdline/apt-get.cc:2077
+#: cmdline/apt-get.cc:2134
#, c-format
msgid "Unpack command '%s' failed.\n"
msgstr ""
-#: cmdline/apt-get.cc:2078
+#: cmdline/apt-get.cc:2135
#, c-format
msgid "Check if the 'dpkg-dev' package is installed.\n"
msgstr ""
-#: cmdline/apt-get.cc:2095
+#: cmdline/apt-get.cc:2152
#, c-format
msgid "Build command '%s' failed.\n"
msgstr ""
-#: cmdline/apt-get.cc:2114
+#: cmdline/apt-get.cc:2171
msgid "Child process failed"
msgstr ""
-#: cmdline/apt-get.cc:2130
+#: cmdline/apt-get.cc:2187
msgid "Must specify at least one package to check builddeps for"
msgstr ""
-#: cmdline/apt-get.cc:2158
+#: cmdline/apt-get.cc:2215
#, c-format
msgid "Unable to get build-dependency information for %s"
msgstr ""
-#: cmdline/apt-get.cc:2178
+#: cmdline/apt-get.cc:2235
#, c-format
msgid "%s has no build depends.\n"
msgstr ""
-#: cmdline/apt-get.cc:2230
+#: cmdline/apt-get.cc:2287
#, c-format
msgid ""
"%s dependency for %s cannot be satisfied because the package %s cannot be "
"found"
msgstr ""
-#: cmdline/apt-get.cc:2282
+#: cmdline/apt-get.cc:2339
#, c-format
msgid ""
"%s dependency for %s cannot be satisfied because no available versions of "
"package %s can satisfy version requirements"
msgstr ""
-#: cmdline/apt-get.cc:2317
+#: cmdline/apt-get.cc:2374
#, c-format
msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new"
msgstr ""
-#: cmdline/apt-get.cc:2342
+#: cmdline/apt-get.cc:2399
#, c-format
msgid "Failed to satisfy %s dependency for %s: %s"
msgstr ""
-#: cmdline/apt-get.cc:2356
+#: cmdline/apt-get.cc:2413
#, c-format
msgid "Build-dependencies for %s could not be satisfied."
msgstr ""
-#: cmdline/apt-get.cc:2360
+#: cmdline/apt-get.cc:2417
msgid "Failed to process build dependencies"
msgstr ""
-#: cmdline/apt-get.cc:2392
+#: cmdline/apt-get.cc:2449
msgid "Supported modules:"
msgstr ""
-#: cmdline/apt-get.cc:2433
+#: cmdline/apt-get.cc:2490
msgid ""
"Usage: apt-get [options] command\n"
" apt-get [options] install|remove pkg1 [pkg2 ...]\n"
@@ -2112,12 +2117,12 @@ msgstr ""
msgid "Dependency generation"
msgstr ""
-#: apt-pkg/tagfile.cc:85 apt-pkg/tagfile.cc:92
+#: apt-pkg/tagfile.cc:73
#, c-format
msgid "Unable to parse package file %s (1)"
msgstr ""
-#: apt-pkg/tagfile.cc:186
+#: apt-pkg/tagfile.cc:160
#, c-format
msgid "Unable to parse package file %s (2)"
msgstr ""