diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-01-30 13:13:29 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-01-30 13:13:29 +0100 |
commit | 017f9fd68258b15ac4df5ae73b19ba6653711022 (patch) | |
tree | 77abdd6251d49b1a26f4f3cdefac7618aa511381 | |
parent | 9535a4db891b629dc17354171bce0a0f41e48d4a (diff) |
* apt-pkg/contrib/configuration.cc:
- do not stop parent transversal in FindDir if the value is empty
See http://lists.debian.org/deity/2012/01/msg00053.html , too.
-rw-r--r-- | apt-pkg/contrib/configuration.cc | 10 | ||||
-rw-r--r-- | debian/changelog | 4 | ||||
-rw-r--r-- | test/libapt/configuration_test.cc | 9 |
3 files changed, 20 insertions, 3 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 0949ec223..36866a35a 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -185,8 +185,14 @@ string Configuration::FindFile(const char *Name,const char *Default) const } string val = Itm->Value; - while (Itm->Parent != 0 && Itm->Parent->Value.empty() == false) - { + while (Itm->Parent != 0) + { + if (Itm->Parent->Value.empty() == true) + { + Itm = Itm->Parent; + continue; + } + // Absolute if (val.length() >= 1 && val[0] == '/') break; diff --git a/debian/changelog b/debian/changelog index f1ccaf403..12abea47d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/depcache.cc: - if a M-A:same package is marked for reinstall, mark all it's installed silbings for reinstallation as well (LP: #859188) + * apt-pkg/contrib/configuration.cc: + - do not stop parent transversal in FindDir if the value is empty [ Steve Langasek ] * cmdline/apt-get.cc: @@ -20,7 +22,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low - use a signed int instead of short for score calculation as upgrades become so big now that it can overflow (Closes: #657732, LP: #917173) - -- David Kalnischkies <kalnischkies@gmail.com> Sun, 29 Jan 2012 15:22:50 +0100 + -- David Kalnischkies <kalnischkies@gmail.com> Mon, 30 Jan 2012 13:07:30 +0100 apt (0.8.16~exp12) experimental; urgency=low diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc index 5b23d17fb..9a3e2c118 100644 --- a/test/libapt/configuration_test.cc +++ b/test/libapt/configuration_test.cc @@ -71,6 +71,15 @@ int main(int argc,const char *argv[]) { equals(Cnf.Find("APT2::Version", "33"), "33"); equals(Cnf.FindI("APT2::Version", 33), 33); + equals(Cnf.FindFile("Dir::State"), ""); + equals(Cnf.FindFile("Dir::Aptitude::State"), ""); + Cnf.Set("Dir", "/srv/sid"); + equals(Cnf.FindFile("Dir::State"), ""); + Cnf.Set("Dir::State", "var/lib/apt"); + Cnf.Set("Dir::Aptitude::State", "var/lib/aptitude"); + equals(Cnf.FindFile("Dir::State"), "/srv/sid/var/lib/apt"); + equals(Cnf.FindFile("Dir::Aptitude::State"), "/srv/sid/var/lib/aptitude"); + //FIXME: Test for configuration file parsing; // currently only integration/ tests test them implicitly |