Skip to content
Snippets Groups Projects
Commit 76e3a302 authored by Colin Watson's avatar Colin Watson
Browse files

When creating a new template and finding that it already exists in the...

When creating a new template and finding that it already exists in the database, ensure that a question of the same name exists too (closes: #518322, #779920).
parent 91118939
No related branches found
No related tags found
No related merge requests found
...@@ -76,10 +76,15 @@ sub new { ...@@ -76,10 +76,15 @@ sub new {
if ($Debconf::Db::templates->exists($template) and if ($Debconf::Db::templates->exists($template) and
$Debconf::Db::templates->owners($template)) { $Debconf::Db::templates->owners($template)) {
# If a question matching this template already exists in # If a question matching this template already exists in
# the db, add the owner to it. This handles shared owner # the db, add the owner to it; otherwise, create one. This
# questions. # handles shared owner questions.
my $q=Debconf::Question->get($template); if ($Debconf::Db::config->exists($template)) {
$q->addowner($owner, $type) if $q; my $q=Debconf::Question->get($template);
$q->addowner($owner, $type) if $q;
} else {
my $q=Debconf::Question->new($template, $owner, $type);
$q->template($template);
}
# See if the template claims to own any questions that # See if the template claims to own any questions that
# cannot be found. If so, the db is corrupted; attempt to # cannot be found. If so, the db is corrupted; attempt to
......
...@@ -6,6 +6,9 @@ debconf (1.5.57) UNRELEASED; urgency=medium ...@@ -6,6 +6,9 @@ debconf (1.5.57) UNRELEASED; urgency=medium
supported gdialog for about three weeks in 1999 anyway. supported gdialog for about three weeks in 1999 anyway.
* Escape braces in regexes to avoid deprecation warning with Perl 5.22 * Escape braces in regexes to avoid deprecation warning with Perl 5.22
(closes: #786705). (closes: #786705).
* When creating a new template and finding that it already exists in the
database, ensure that a question of the same name exists too (closes:
#518322, #779920).
[ Jérémy Bobbio ] [ Jérémy Bobbio ]
* Use UTC when running xgettext for build reproducibility. Closes: #783255 * Use UTC when running xgettext for build reproducibility. Closes: #783255
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment