diff options
author | Michael Vogt <mvo@debian.org> | 2013-12-28 00:31:01 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2013-12-28 00:31:01 +0100 |
commit | 35ac30ee373c5ed84d7c2c5a701ac2d54963504d (patch) | |
tree | 59da7e2385b396052c4f53ac187d520c00d2790c /cmdline/apt-get.cc | |
parent | e5c2b7e8a5455e1dc6993ef9e151b3845fb53c60 (diff) | |
parent | c035b6552ba4bd1c6fba5fd8f8d829c2efbefe3c (diff) |
Merge branch 'debian/sid' into bugfix/bts731738-fancy-progess
Conflicts:
apt-pkg/install-progress.cc
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6973901dc..8a0772ce2 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -322,9 +322,12 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, if (Src == "" && ArchTag != "") { - _error->Error(_("Can not find a package '%s' with version '%s' and " - "release '%s'"), Pkg.FullName().c_str(), - VerTag.c_str(), RelTag.c_str()); + if (VerTag != "") + _error->Error(_("Can not find a package '%s' with version '%s'"), + Pkg.FullName().c_str(), VerTag.c_str()); + if (RelTag != "") + _error->Error(_("Can not find a package '%s' with release '%s'"), + Pkg.FullName().c_str(), RelTag.c_str()); Src = Name; return 0; } @@ -1533,14 +1536,12 @@ bool DoChangelog(CommandLine &CmdL) bool const downOnly = _config->FindB("APT::Get::Download-Only", false); char tmpname[100]; - char* tmpdir = NULL; + const char* tmpdir = NULL; if (downOnly == false) { - const char* const tmpDir = getenv("TMPDIR"); - if (tmpDir != NULL && *tmpDir != '\0') - snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", tmpDir); - else - strncpy(tmpname, "/tmp/apt-changelog-XXXXXX", sizeof(tmpname)); + std::string systemTemp = GetTempDir(); + snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", + systemTemp.c_str()); tmpdir = mkdtemp(tmpname); if (tmpdir == NULL) return _error->Errno("mkdtemp", "mkdtemp failed"); |