Skip to content

Commit

Permalink
A bit more flexible code
Browse files Browse the repository at this point in the history
  • Loading branch information
kobliha committed Dec 10, 2014
1 parent fc7f3d8 commit a51347b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
3 changes: 3 additions & 0 deletions package/yast2-dns-server.changes
Expand Up @@ -14,6 +14,9 @@ Tue Dec 9 16:35:24 CET 2014 - locilka@suse.com
- Flushing /etc/named.conf cache 'after' writing zones (instead
of 'before')
- Using "" as the default NETCONFIG_DNS_POLICY (instead of 0)
- Do not write system zones to LDAP (bnc#746401)
- If systems zones are marked as modified, they are written to
named configuration (if LDAP is not in use)
- 3.1.7.2

-------------------------------------------------------------------
Expand Down
24 changes: 16 additions & 8 deletions src/modules/DnsServer.pm
Expand Up @@ -123,7 +123,7 @@ sub is_system_zone {
$zone_name eq "0.0.127.in-addr.arpa" ||
$zone_name =~ /^(0\.)+ip6.arpa$/ ||
$zone_name eq "."
)
);
}

##------------------------------------
Expand Down Expand Up @@ -1302,14 +1302,22 @@ sub check_and_install_package {
my $self = shift;
return 1 if (PackageSystem->Installed("bind"));

# Package cannot be installed in some modes, changing the mode temporarily
my $previous_mode = Mode->mode();
Mode->SetMode("normal");
my $installed = PackageSystem->CheckAndInstallPackagesInteractive(["bind"]);
my $installed = 0;

# Try to install the required package
if (Mode->autoinst()) {
# Non-interactively, as we can't ask user in this case
$installed = PackageSystem->CheckAndInstallPackages(["bind"]);
} else {
# Package cannot be installed in some modes, changing the mode temporarily
my $previous_mode = Mode->mode();
Mode->SetMode("normal");
$installed = PackageSystem->CheckAndInstallPackagesInteractive(["bind"]);

# Reread the configuration stat if it has changed
$configuration_timestamp = $self->GetConfigurationStat() if $installed;
Mode->SetMode($previous_mode);
# Reread the configuration stat if it has changed
$configuration_timestamp = $self->GetConfigurationStat() if $installed;
Mode->SetMode($previous_mode);
}

return 1 if $installed;

Expand Down

0 comments on commit a51347b

Please sign in to comment.