From: Michael Vogt Date: Tue, 19 Sep 2006 16:28:47 +0000 (+0200) Subject: * merged from apt--tasks X-Git-Tag: 0.7.24ubuntu1~227 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/c64eacb78ffcdcd26602e9598b953f801724968c * merged from apt--tasks --- c64eacb78ffcdcd26602e9598b953f801724968c diff --cc cmdline/apt-get.cc index 0c2e15d7e,09bf572a5..6ea0d3727 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@@ -1572,116 -1473,106 +1563,130 @@@ bool DoInstall(CommandLine &CmdL bool DefRemove = false; if (strcasecmp(CmdL.FileList[0],"remove") == 0) DefRemove = true; + - for (const char **I = CmdL.FileList + 1; *I != 0; I++) + else if (strcasecmp(CmdL.FileList[0], "autoremove") == 0) { - // Duplicate the string - unsigned int Length = strlen(*I); - char S[300]; - if (Length >= sizeof(S)) - continue; - strcpy(S,*I); - - // See if we are removing and special indicators.. - 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; - } + _config->Set("APT::Get::AutomaticRemove", "true"); + DefRemove = true; + } - while (Cache->FindPkg(S).end() == true) + // new scope for the ActionGroup + { + pkgDepCache::ActionGroup group(Cache); + for (const char **I = CmdL.FileList + 1; *I != 0; I++) { - // Handle an optional end tag indicating what to do - if (Length >= 1 && S[Length - 1] == '-') - { - Remove = true; - S[--Length] = 0; + // Duplicate the string + unsigned int Length = strlen(*I); + char S[300]; + if (Length >= sizeof(S)) continue; - } - - if (Length >= 1 && S[Length - 1] == '+') + strcpy(S,*I); + + // See if we are removing and special indicators.. + bool Remove = DefRemove; + char *VerTag = 0; + bool VerIsRel = false; ++ ++ // this is a task! ++ if (Length >= 1 && S[Length - 1] == '^') + { - Remove = false; + S[--Length] = 0; ++ // tasks must always be confirmed ++ ExpectedInst += 1000; ++ // see if we can install it ++ TryInstallTask(Cache, Fix, BrokenFix, ExpectedInst, S); + continue; + } + - char *Slash = strchr(S,'='); - if (Slash != 0) + while (Cache->FindPkg(S).end() == true) { - VerIsRel = false; - *Slash = 0; - VerTag = Slash + 1; - } + // Handle an optional end tag indicating what to do + if (Length >= 1 && S[Length - 1] == '-') + { + Remove = true; + S[--Length] = 0; + continue; + } - Slash = strchr(S,'/'); - if (Slash != 0) - { - VerIsRel = true; - *Slash = 0; - VerTag = Slash + 1; - } + if (Length >= 1 && S[Length - 1] == '+') + { + Remove = false; + S[--Length] = 0; + continue; + } - break; - } + char *Slash = strchr(S,'='); + if (Slash != 0) + { + VerIsRel = false; + *Slash = 0; + VerTag = Slash + 1; + } + + Slash = strchr(S,'/'); + if (Slash != 0) + { + VerIsRel = true; + *Slash = 0; + VerTag = Slash + 1; + } + + break; + } - // Locate the package - pkgCache::PkgIterator Pkg = Cache->FindPkg(S); - Packages++; - if (Pkg.end() == true) - { - // Check if the name is a regex - const char *I; - for (I = S; *I != 0; I++) - if (*I == '?' || *I == '*' || *I == '|' || - *I == '[' || *I == '^' || *I == '$') - break; - if (*I == 0) - return _error->Error(_("Couldn't find package %s"),S); + // Locate the package + pkgCache::PkgIterator Pkg = Cache->FindPkg(S); + Packages++; + if (Pkg.end() == true) + { + // Check if the name is a regex + const char *I; + for (I = S; *I != 0; I++) + if (*I == '?' || *I == '*' || *I == '|' || + *I == '[' || *I == '^' || *I == '$') + break; + if (*I == 0) + return _error->Error(_("Couldn't find package %s"),S); - // Regexs must always be confirmed - ExpectedInst += 1000; + // Regexs must always be confirmed + ExpectedInst += 1000; - // Compile the regex pattern - regex_t Pattern; - int Res; - if ((Res = regcomp(&Pattern,S,REG_EXTENDED | REG_ICASE | - REG_NOSUB)) != 0) - { - char Error[300]; - regerror(Res,&Pattern,Error,sizeof(Error)); - return _error->Error(_("Regex compilation error - %s"),Error); - } + // Compile the regex pattern + regex_t Pattern; + int Res; + if ((Res = regcomp(&Pattern,S,REG_EXTENDED | REG_ICASE | + REG_NOSUB)) != 0) + { + char Error[300]; + regerror(Res,&Pattern,Error,sizeof(Error)); + return _error->Error(_("Regex compilation error - %s"),Error); + } - // Run over the matches - bool Hit = false; - for (Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++) - { - if (regexec(&Pattern,Pkg.Name(),0,0,0) != 0) - continue; + // Run over the matches + bool Hit = false; + for (Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++) + { + if (regexec(&Pattern,Pkg.Name(),0,0,0) != 0) + continue; + + ioprintf(c1out,_("Note, selecting %s for regex '%s'\n"), + Pkg.Name(),S); - ioprintf(c1out,_("Note, selecting %s for regex '%s'\n"), - Pkg.Name(),S); + if (VerTag != 0) + if (TryToChangeVer(Pkg,Cache,VerTag,VerIsRel) == false) + return false; + Hit |= TryToInstall(Pkg,Cache,Fix,Remove,BrokenFix, + ExpectedInst,false); + } + regfree(&Pattern); + + if (Hit == false) + return _error->Error(_("Couldn't find package %s"),S); + } + else + { ++ if (VerTag != 0) if (TryToChangeVer(Pkg,Cache,VerTag,VerIsRel) == false) return false; @@@ -2707,9 -2603,7 +2712,8 @@@ int main(int argc,const char *argv[] CommandLine::Dispatch Cmds[] = {{"update",&DoUpdate}, {"upgrade",&DoUpgrade}, {"install",&DoInstall}, - {"installtask",&DoInstallTask}, {"remove",&DoInstall}, + {"autoremove",&DoInstall}, {"dist-upgrade",&DoDistUpgrade}, {"dselect-upgrade",&DoDSelectUpgrade}, {"build-dep",&DoBuildDep}, diff --cc configure.in index 4647f4ffb,f0b0d6703..baedcad12 --- a/configure.in +++ b/configure.in @@@ -18,7 -18,7 +18,7 @@@ AC_CONFIG_AUX_DIR(buildlib AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- - AC_DEFINE_UNQUOTED(VERSION,"0.6.45ubuntu10") -AC_DEFINE_UNQUOTED(VERSION,"0.6.45.1") ++AC_DEFINE_UNQUOTED(VERSION,"0.6.45ubuntu11") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) diff --cc debian/changelog index 9111149c9,4c5841057..f98e02b1a --- a/debian/changelog +++ b/debian/changelog @@@ -1,5 -1,12 +1,12 @@@ -apt (0.6.45.1) unstable; urgency=low ++apt (0.6.45ubuntu11) edgy; urgency=low ++ ++ * removed "installtask" and change it so that tasknames can be given ++ with "apt-get install taskname^" ++ ++ -- ++ +apt (0.6.45ubuntu10) edgy; urgency=low - * debian/control: - - switched to libdb4.4 for building (closes: #381019) - * cmdline/apt-get.cc: - - show only the recommends/suggests for the candidate-version, not for all - versions of the package (closes: #257054) - - properly handle recommends/suggests or-groups when printing the list of - suggested/recommends packages (closes: #311619) * methods/http.cc: - check more careful for incorrect proxy settings (closes: #378868) * methods/gzip.cc: diff --cc po/apt-all.pot index a329525a6,46299c8b6..de72c430e --- a/po/apt-all.pot +++ b/po/apt-all.pot @@@ -1507,12 -1495,12 +1507,13 @@@ msgstr " msgid "File not found" msgstr "" -#: methods/copy.cc:42 methods/gpgv.cc:281 methods/gzip.cc:134 -#: methods/gzip.cc:143 +#: methods/copy.cc:42 methods/gpgv.cc:281 methods/gzip.cc:133 - #: methods/gzip.cc:142 ++#: methods/gzip.cc:142 methods/gzip.cc:134 methods/gzip.cc:143 msgid "Failed to stat" msgstr "" -#: methods/copy.cc:79 methods/gpgv.cc:278 methods/gzip.cc:140 +#: methods/copy.cc:79 methods/gpgv.cc:278 methods/gzip.cc:139 ++#: methods/gzip.cc:140 msgid "Failed to set modification time" msgstr "" @@@ -2129,26 -2117,12 +2130,26 @@@ msgstr " msgid "Dependency generation" msgstr "" -#: apt-pkg/tagfile.cc:73 +#: apt-pkg/depcache.cc:152 apt-pkg/depcache.cc:171 apt-pkg/depcache.cc:175 +msgid "Reading state information" +msgstr "" + +#: apt-pkg/depcache.cc:199 +#, c-format +msgid "Failed to open StateFile %s" +msgstr "" + +#: apt-pkg/depcache.cc:205 +#, c-format +msgid "Failed to write temporary StateFile %s" +msgstr "" + - #: apt-pkg/tagfile.cc:85 apt-pkg/tagfile.cc:92 ++#: 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 ++#: apt-pkg/tagfile.cc:186 apt-pkg/tagfile.cc:160 #, c-format msgid "Unable to parse package file %s (2)" msgstr ""