]> git.saurik.com Git - apt.git/commitdiff
* merged from apt--tasks
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 19 Sep 2006 16:28:47 +0000 (18:28 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 19 Sep 2006 16:28:47 +0000 (18:28 +0200)
1  2 
cmdline/apt-get.cc
configure.in
debian/changelog
po/apt-all.pot

index 0c2e15d7e793ae1c57fc66d20d26bd635e8d0eee,09bf572a5d6a2a9a88c01469e82172298052d3ce..6ea0d372796bb0e25cb3078fd71532cfad292b07
@@@ -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 4647f4ffb0ad51614ee1f5fcad3ccdd02841769e,f0b0d6703af0f057455389e7258eefc6230852fd..baedcad129cd4bceb8ff135c3fe0ba17affd042d
@@@ -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)
index 9111149c9cb73d2d2d24829deed4d4a248a76d5e,4c5841057ef254ee048af1fe08ca0ef1ab48a94f..f98e02b1adfd2c293b61e5cd11deedd1dd8ebb78
@@@ -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 a329525a6cc6df4b96d02e7c310202c11a901f01,46299c8b627a3ffd0bf4d353bdd519150d37f2e5..de72c430eb5ec7945a4ac07549d429d6aeb1baed
@@@ -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 ""