From 6472dced435a23c25161e69c5afe301649882240 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Wed, 24 Aug 2016 12:15:13 +0100 Subject: [PATCH] Only retrieve DDTP translations from the section we're looking at In this case main/i18n/Translation-foo contrib/i18n/Translation-bar we were attempting to open main/i18n/Translation-bar, which doesn't exist. This was causing a code path to short circuit the function to load translations, meaning that some were missed. Fix that to 'continue' instead of return. Also only return translations in the suite we are asking about, not all translations. --- source/backends/debian/debpkgindex.d | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/backends/debian/debpkgindex.d b/source/backends/debian/debpkgindex.d index 4eb6f39f..ff98cd59 100644 --- a/source/backends/debian/debpkgindex.d +++ b/source/backends/debian/debpkgindex.d @@ -65,17 +65,17 @@ public: private immutable(string[]) findTranslations (const string suite, const string section) { - import std.regex : ctRegex, matchFirst; + import std.regex : matchFirst, regex; immutable inRelease = buildPath (rootDir, "dists", suite, "InRelease"); - auto regex = ctRegex!(r"Translation-(\w+)$"); + auto translationregex = r"%s/i18n/Translation-(\w+)$".format (section).regex; bool[string] ret; try { const inReleaseContents = getFileContents (inRelease); foreach (const ref entry; inReleaseContents) { - auto match = entry.matchFirst(regex); + auto match = entry.matchFirst (translationregex); if (match.empty) continue; @@ -110,8 +110,8 @@ public: try { fname = downloadIfNecessary (rootDir, tmpDir, fullPath); } catch (Exception ex) { - logDebug ("No long descriptions for %s/%s", suite, section); - return; + logDebug ("No translations for %s in %s/%s", lang, suite, section); + continue; } auto tagf = new TagFile ();