~ubuntu-branches/ubuntu/utopic/apt/utopic

« back to all changes in this revision

Viewing changes to cmdline/apt-get.cc

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-09-10 09:00:29 UTC
  • mfrom: (1.4.95 sid)
  • Revision ID: package-import@ubuntu.com-20140910090029-t5qgf8p0q73a2t3g
Tags: 1.0.8ubuntu1
merged fixes from debian/sid

Show diffs side-by-side

added added

removed removed

Lines of Context:
953
953
         else
954
954
         {
955
955
            // Call dpkg-source
956
 
            char S[500];
957
 
            snprintf(S,sizeof(S),"%s -x %s",
 
956
            std::string const sourceopts = _config->Find("DPkg::Source-Options", "-x");
 
957
            std::string S;
 
958
            strprintf(S, "%s %s %s",
958
959
                     _config->Find("Dir::Bin::dpkg-source","dpkg-source").c_str(),
959
 
                     Dsc[I].Dsc.c_str());
960
 
            if (system(S) != 0)
 
960
                     sourceopts.c_str(), Dsc[I].Dsc.c_str());
 
961
            if (system(S.c_str()) != 0)
961
962
            {
962
 
               fprintf(stderr,_("Unpack command '%s' failed.\n"),S);
963
 
               fprintf(stderr,_("Check if the 'dpkg-dev' package is installed.\n"));
 
963
               fprintf(stderr, _("Unpack command '%s' failed.\n"), S.c_str());
 
964
               fprintf(stderr, _("Check if the 'dpkg-dev' package is installed.\n"));
964
965
               _exit(1);
965
 
            }       
 
966
            }
966
967
         }
967
 
         
 
968
 
968
969
         // Try to compile it with dpkg-buildpackage
969
970
         if (_config->FindB("APT::Get::Compile",false) == true)
970
971
         {
980
981
            buildopts.append(_config->Find("DPkg::Build-Options","-b -uc"));
981
982
 
982
983
            // Call dpkg-buildpackage
983
 
            char S[500];
984
 
            snprintf(S,sizeof(S),"cd %s && %s %s",
 
984
            std::string S;
 
985
            strprintf(S, "cd %s && %s %s",
985
986
                     Dir.c_str(),
986
987
                     _config->Find("Dir::Bin::dpkg-buildpackage","dpkg-buildpackage").c_str(),
987
988
                     buildopts.c_str());
988
 
            
989
 
            if (system(S) != 0)
 
989
 
 
990
            if (system(S.c_str()) != 0)
990
991
            {
991
 
               fprintf(stderr,_("Build command '%s' failed.\n"),S);
 
992
               fprintf(stderr, _("Build command '%s' failed.\n"), S.c_str());
992
993
               _exit(1);
993
 
            }       
994
 
         }      
 
994
            }
 
995
         }
995
996
      }
996
 
      
 
997
 
997
998
      _exit(0);
998
999
   }
999
1000