~ubuntu-branches/ubuntu/saucy/apt/saucy

« back to all changes in this revision

Viewing changes to cmdline/apt-get.cc

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Michael Vogt, TJ
  • Date: 2012-08-28 12:06:48 UTC
  • mfrom: (1.4.53 sid)
  • Revision ID: package-import@ubuntu.com-20120828120648-lbw0q0611jn030bx
Tags: 0.9.7.5ubuntu1
[ Michael Vogt ]
* merged latest fixes from the debian-sid branch

[ TJ ]
* apt-pkg/contrib/netrc.cc:
  - increase LOGINSIZE/PASSWORDSIZE limits and add proper error
    if the limits are reached (LP: #1008289)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1434
1434
   if (Cache[Pkg].CandidateVer == 0 && Pkg->ProvidesList != 0)
1435
1435
   {
1436
1436
      CacheSetHelperAPTGet helper(c1out);
1437
 
      helper.showErrors(AllowFail == false);
 
1437
      helper.showErrors(false);
1438
1438
      pkgCache::VerIterator Ver = helper.canNotFindNewestVer(Cache, Pkg);
1439
1439
      if (Ver.end() == false)
1440
1440
         Pkg = Ver.ParentPkg();
2895
2895
            if (StripMultiArch == false && D->Type != pkgSrcRecords::Parser::BuildDependIndep)
2896
2896
            {
2897
2897
               size_t const colon = D->Package.find(":");
2898
 
               if (colon != string::npos &&
2899
 
                   (strcmp(D->Package.c_str() + colon, ":any") == 0 || strcmp(D->Package.c_str() + colon, ":native") == 0))
2900
 
                  Pkg = Cache->FindPkg(D->Package.substr(0,colon));
 
2898
               if (colon != string::npos)
 
2899
               {
 
2900
                  if (strcmp(D->Package.c_str() + colon, ":any") == 0 || strcmp(D->Package.c_str() + colon, ":native") == 0)
 
2901
                     Pkg = Cache->FindPkg(D->Package.substr(0,colon));
 
2902
                  else
 
2903
                     Pkg = Cache->FindPkg(D->Package);
 
2904
               }
2901
2905
               else
2902
 
                  Pkg = Cache->FindPkg(D->Package);
 
2906
                  Pkg = Cache->FindPkg(D->Package, hostArch);
2903
2907
 
2904
2908
               // a bad version either is invalid or doesn't satify dependency
2905
2909
               #define BADVER(Ver) (Ver.end() == true || \
2918
2922
               }
2919
2923
               if (verlist.empty() == true)
2920
2924
               {
2921
 
                  pkgCache::PkgIterator HostPkg = Cache->FindPkg(D->Package, hostArch);
2922
 
                  if (HostPkg.end() == false)
 
2925
                  pkgCache::PkgIterator BuildPkg = Cache->FindPkg(D->Package, "native");
 
2926
                  if (BuildPkg.end() == false && Pkg != BuildPkg)
2923
2927
                  {
2924
 
                     pkgCache::VerIterator Ver = (*Cache)[HostPkg].InstVerIter(*Cache);
 
2928
                     pkgCache::VerIterator Ver = (*Cache)[BuildPkg].InstVerIter(*Cache);
2925
2929
                     if (BADVER(Ver) == false)
2926
2930
                        verlist.insert(Ver);
2927
 
                     Ver = (*Cache)[HostPkg].CandidateVerIter(*Cache);
 
2931
                     Ver = (*Cache)[BuildPkg].CandidateVerIter(*Cache);
2928
2932
                     if (BADVER(Ver) == false)
2929
2933
                        verlist.insert(Ver);
2930
2934
                  }
2943
2947
                        Pkg = Ver.ParentPkg().Group().FindPkg(hostArch);
2944
2948
                     else if (strcmp(D->Package.c_str() + colon, ":any") == 0)
2945
2949
                        forbidden = "Multi-Arch: none";
 
2950
                     else if (strcmp(D->Package.c_str() + colon, ":native") == 0)
 
2951
                        Pkg = Ver.ParentPkg().Group().FindPkg("native");
2946
2952
                  }
2947
2953
                  else if (Ver->MultiArch == pkgCache::Version::Same)
2948
2954
                  {
2950
2956
                        Pkg = Ver.ParentPkg().Group().FindPkg(hostArch);
2951
2957
                     else if (strcmp(D->Package.c_str() + colon, ":any") == 0)
2952
2958
                        forbidden = "Multi-Arch: same";
2953
 
                     // :native gets the buildArch
 
2959
                     else if (strcmp(D->Package.c_str() + colon, ":native") == 0)
 
2960
                        Pkg = Ver.ParentPkg().Group().FindPkg("native");
2954
2961
                  }
2955
2962
                  else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign || Ver->MultiArch == pkgCache::Version::All)
2956
2963
                  {
2957
 
                     if (colon != string::npos)
 
2964
                     if (colon == string::npos)
 
2965
                        Pkg = Ver.ParentPkg().Group().FindPkg("native");
 
2966
                     else if (strcmp(D->Package.c_str() + colon, ":any") == 0 ||
 
2967
                              strcmp(D->Package.c_str() + colon, ":native") == 0)
2958
2968
                        forbidden = "Multi-Arch: foreign";
2959
2969
                  }
2960
2970
                  else if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed)
2972
2982
                        if (Pkg.end() == true)
2973
2983
                           Pkg = Grp.FindPreferredPkg(true);
2974
2984
                     }
2975
 
                     // native gets buildArch
 
2985
                     else if (strcmp(D->Package.c_str() + colon, ":native") == 0)
 
2986
                        Pkg = Ver.ParentPkg().Group().FindPkg("native");
2976
2987
                  }
2977
2988
 
2978
2989
                  if (forbidden.empty() == false)
3004
3015
            else
3005
3016
               Pkg = Cache->FindPkg(D->Package);
3006
3017
 
3007
 
            if (Pkg.end() == true)
 
3018
            if (Pkg.end() == true || (Pkg->VersionList == 0 && Pkg->ProvidesList == 0))
3008
3019
            {
3009
3020
               if (_config->FindB("Debug::BuildDeps",false) == true)
3010
3021
                    cout << " (not found)" << (*D).Package << endl;
3087
3098
               }
3088
3099
            }
3089
3100
 
3090
 
            if (TryToInstallBuildDep(Pkg,Cache,Fix,false,false) == true)
 
3101
            if (TryToInstallBuildDep(Pkg,Cache,Fix,false,false,false) == true)
3091
3102
            {
3092
3103
               // We successfully installed something; skip remaining alternatives
3093
3104
               skipAlternatives = hasAlternatives;