Skip to content

Commit

Permalink
Merge pull request #48 from noelpower/factory-bsc#1031613+bsc#102467
Browse files Browse the repository at this point in the history
Factory bsc#1031613+bsc#102467
  • Loading branch information
noelpower committed Apr 4, 2017
2 parents 438458e + da476f5 commit 3ef75f6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
8 changes: 8 additions & 0 deletions package/yast2-samba-server.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Apr 3 18:42:42 UTC 2017 - nopower@suse.com

- fix duplicated key warnings (bsc#1031613).
- Don't require install of cups for yast samba-server
(bsc#1024670).
- 3.2.1

-------------------------------------------------------------------
Thu Mar 16 15:51:19 UTC 2017 - kanderssen@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-samba-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-samba-server
Version: 3.2.0
Version: 3.2.1
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
1 change: 0 additions & 1 deletion src/include/samba-server/samba-options-global.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def initialize_samba_server_samba_options_global(include_target)
"table" => { "unique" => true },
"popup" => { "widget" => :checkbox }
},
"" => { "table" => { "unique" => true } },
"client lanman auth" => {
"table" => { "unique" => true },
"popup" => { "widget" => :checkbox }
Expand Down
1 change: 0 additions & 1 deletion src/include/samba-server/samba-options-local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ def initialize_samba_server_samba_options_local(include_target)
"table" => { "unique" => true },
"popup" => { "widget" => :checkbox }
},
"" => { "table" => { "unique" => true } },
"copy" => { "table" => { "unique" => true } },
"include" => { "table" => { "unique" => true } },
"exec" => { "table" => { "unique" => true } },
Expand Down
24 changes: 16 additions & 8 deletions src/modules/SambaServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ YaST::YCP::Import("SambaNmbLookup");
YaST::YCP::Import("SambaTrustDom");
YaST::YCP::Import("SambaAccounts");
YaST::YCP::Import("Samba");
YaST::YCP::Import ("Popup");

}

use constant {
Expand Down Expand Up @@ -111,19 +113,17 @@ sub CheckAndInstallBasePackages {
}

BEGIN{ $TYPEINFO{GetModified} = ["function", "boolean"] }
sub CheckAndInstallCupsPackages {
sub CheckNeedToInstallCupsPackages {
my $printing = SambaConfig->GlobalGetStr("printing", "cups");

unless ((lc $printing eq "cups") and SambaConfig->ShareExists("printers")) {
# not sharing cups printers, package not needed
return 1;
unless ((lc $printing eq "cups") and SambaConfig->ShareExists("printers") and SambaConfig->ShareEnabled("printers")) {
return 0;
}

if (PackageSystem->InstalledAll($CupsPackages)) {
return 1;
return 0;
}

return PackageSystem->CheckAndInstallPackagesInteractive($CupsPackages);
return 1;
}

# Read all samba-server settings
Expand Down Expand Up @@ -182,7 +182,15 @@ sub Read {
}
SambaConfig->Read();
unless (Mode->test()) {
CheckAndInstallCupsPackages() or return 0;
if (CheckNeedToInstallCupsPackages()) {
my $answer = Popup->YesNo(__("Cups is required by samba for printing to \nwork correctly. Do you wish to disable printing?\nNote: To reenable printing you will need to \nmanually enable the \"printers\" share and install cups."));
if ($answer) {
SambaConfig->ShareDisable("printers");
SambaConfig->ShareSetModified("printers");
} else {
PackageSystem->CheckAndInstallPackagesInteractive($CupsPackages) or return 0
}
}
}
Samba->ReadSharesSetting();

Expand Down

0 comments on commit 3ef75f6

Please sign in to comment.