summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-12-31 00:04:50 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2016-12-31 02:29:21 +0100
commitc8f0f5bd1effdf80c2eee80b3aa4eeb35604a2a1 (patch)
tree8f74cec7ee019ff3433c7afb59efd6775dce6ad5
parentd8617331afc39281d5925033975b6097128786f4 (diff)
gets file location via FindFile instead of manual merge
Unlikely to have any practical effect, but its more consistent to use the right methods instead of performing it slightly incorrect by hand. Gbp-Dch: Ignore
-rw-r--r--apt-pkg/deb/dpkgpm.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 2e779ca8b..81795641e 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -985,7 +985,8 @@ void pkgDPkgPM::WriteHistoryTag(string const &tag, string value)
// DPkgPM::OpenLog /*{{{*/
bool pkgDPkgPM::OpenLog()
{
- string const logdir = _config->FindDir("Dir::Log");
+ string const logfile_name = _config->FindFile("Dir::Log::Terminal");
+ string logdir = flNotFile(logfile_name);
if(CreateAPTDirectoryIfNeeded(logdir, logdir) == false)
// FIXME: use a better string after freeze
return _error->Error(_("Directory '%s' missing"), logdir.c_str());
@@ -998,8 +999,6 @@ bool pkgDPkgPM::OpenLog()
strftime(timestr, sizeof(timestr), "%F %T", tmp);
// open terminal log
- string const logfile_name = flCombine(logdir,
- _config->Find("Dir::Log::Terminal"));
if (!logfile_name.empty())
{
d->term_out = fopen(logfile_name.c_str(),"a");
@@ -1020,8 +1019,10 @@ bool pkgDPkgPM::OpenLog()
}
// write your history
- string const history_name = flCombine(logdir,
- _config->Find("Dir::Log::History"));
+ string const history_name = _config->FindFile("Dir::Log::History");
+ string logdir2 = flNotFile(logfile_name);
+ if(logdir != logdir2 && CreateAPTDirectoryIfNeeded(logdir2, logdir2) == false)
+ return _error->Error(_("Directory '%s' missing"), logdir.c_str());
if (!history_name.empty())
{
d->history_out = fopen(history_name.c_str(),"a");