summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-09-05 14:47:22 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-09-05 14:47:22 +0200
commit30b683f4f3021cd191ffef04bfaf2deb65820a52 (patch)
treeb58771461581111f7bbbfd8d3e8eba012dc776ff /cmdline/apt-get.cc
parente6e893903869635ab7ee3200f654129b08717ded (diff)
parent8c782efd93342c6119e8ba2ff6989b7a164b7f3d (diff)
Merge remote-tracking branch 'upstream/debian/experimental' into feature/acq-trans
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc33
1 files changed, 17 insertions, 16 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index cdbfa4708..d6cd94f72 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -955,18 +955,19 @@ static bool DoSource(CommandLine &CmdL)
else
{
// Call dpkg-source
- char S[500];
- snprintf(S,sizeof(S),"%s -x %s",
+ std::string const sourceopts = _config->Find("DPkg::Source-Options", "-x");
+ std::string S;
+ strprintf(S, "%s %s %s",
_config->Find("Dir::Bin::dpkg-source","dpkg-source").c_str(),
- Dsc[I].Dsc.c_str());
- if (system(S) != 0)
+ sourceopts.c_str(), Dsc[I].Dsc.c_str());
+ if (system(S.c_str()) != 0)
{
- fprintf(stderr,_("Unpack command '%s' failed.\n"),S);
- fprintf(stderr,_("Check if the 'dpkg-dev' package is installed.\n"));
+ fprintf(stderr, _("Unpack command '%s' failed.\n"), S.c_str());
+ fprintf(stderr, _("Check if the 'dpkg-dev' package is installed.\n"));
_exit(1);
- }
+ }
}
-
+
// Try to compile it with dpkg-buildpackage
if (_config->FindB("APT::Get::Compile",false) == true)
{
@@ -982,20 +983,20 @@ static bool DoSource(CommandLine &CmdL)
buildopts.append(_config->Find("DPkg::Build-Options","-b -uc"));
// Call dpkg-buildpackage
- char S[500];
- snprintf(S,sizeof(S),"cd %s && %s %s",
+ std::string S;
+ strprintf(S, "cd %s && %s %s",
Dir.c_str(),
_config->Find("Dir::Bin::dpkg-buildpackage","dpkg-buildpackage").c_str(),
buildopts.c_str());
-
- if (system(S) != 0)
+
+ if (system(S.c_str()) != 0)
{
- fprintf(stderr,_("Build command '%s' failed.\n"),S);
+ fprintf(stderr, _("Build command '%s' failed.\n"), S.c_str());
_exit(1);
- }
- }
+ }
+ }
}
-
+
_exit(0);
}