Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2014-09-17 21:24:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2014-09-07 11:10:06.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2014-09-17 21:24:31.000000000 +0200 @@ -1,0 +2,10 @@ +Thu Sep 11 08:09:16 UTC 2014 - an...@suse.com + +- Improved automatic selection of packages for remote + administration (VNC) and for installation with remote X11. + Fixes bnc#896185 and bnc#895070. +- Enabled access to those selections from other yast modules. + First step to fix bnc#896178. +- 3.1.47 + +------------------------------------------------------------------- Old: ---- yast2-packager-3.1.46.tar.bz2 New: ---- yast2-packager-3.1.47.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.LG2O1i/_old 2014-09-17 21:24:32.000000000 +0200 +++ /var/tmp/diff_new_pack.LG2O1i/_new 2014-09-17 21:24:32.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.1.46 +Version: 3.1.47 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-packager-3.1.46.tar.bz2 -> yast2-packager-3.1.47.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.46/package/yast2-packager.changes new/yast2-packager-3.1.47/package/yast2-packager.changes --- old/yast2-packager-3.1.46/package/yast2-packager.changes 2014-09-05 17:30:41.000000000 +0200 +++ new/yast2-packager-3.1.47/package/yast2-packager.changes 2014-09-12 11:18:10.000000000 +0200 @@ -1,4 +1,14 @@ ------------------------------------------------------------------- +Thu Sep 11 08:09:16 UTC 2014 - an...@suse.com + +- Improved automatic selection of packages for remote + administration (VNC) and for installation with remote X11. + Fixes bnc#896185 and bnc#895070. +- Enabled access to those selections from other yast modules. + First step to fix bnc#896178. +- 3.1.47 + +------------------------------------------------------------------- Fri Sep 5 14:53:10 UTC 2014 - lsle...@suse.cz - /etc/sysconfig/kernel:INITRD_MODULES has been dropped, do not diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.46/package/yast2-packager.spec new/yast2-packager-3.1.47/package/yast2-packager.spec --- old/yast2-packager-3.1.46/package/yast2-packager.spec 2014-09-05 17:30:41.000000000 +0200 +++ new/yast2-packager-3.1.47/package/yast2-packager.spec 2014-09-12 11:18:10.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.1.46 +Version: 3.1.47 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.46/src/modules/Packages.rb new/yast2-packager-3.1.47/src/modules/Packages.rb --- old/yast2-packager-3.1.46/src/modules/Packages.rb 2014-09-05 17:30:41.000000000 +0200 +++ new/yast2-packager-3.1.47/src/modules/Packages.rb 2014-09-12 11:18:11.000000000 +0200 @@ -16,6 +16,12 @@ # All known types of resolvables RESOLVABLE_TYPES = [:product, :patch, :package, :pattern, :language] + # Minimum set of packages required to enable VNC server + VNC_BASE_PACKAGES = ["xorg-x11", "xorg-x11-Xvnc", "xorg-x11-fonts", "xinetd"] + # Default window manager for VNC if none is installed + DEFAULT_WM = "icewm" + # Minimum set of packages required for installation with remote X11 server + REMOTE_X11_BASE_PACKAGES = [ "xorg-x11-server", "xorg-x11-fonts", "icewm" ] def main Yast.import "UI" @@ -922,7 +928,6 @@ "xorg-x11-server", "xorg-x11-server-glx", "libusb", - "sax2-tools", "yast2-x11" ] end @@ -938,17 +943,9 @@ def modePackages packages = [] - if Linuxrc.vnc - packages.concat [ "yast2-qt", "xorg-x11-Xvnc", - "xorg-x11-fonts", "icewm", "sax2-tools", "yast2-x11", "xinetd" ] - end - + packages.concat(vnc_packages) if Linuxrc.vnc #this means we have a remote X server - if Linuxrc.display_ip - packages.concat [ "yast2-qt", "xorg-x11-server", "xorg-x11-fonts", - "icewm", "sax2-tools", "yast2-x11" ] - end - + packages.concat(remote_x11_packages) if Linuxrc.display_ip packages << "sbl" if Linuxrc.braille packages << "openssh" if Linuxrc.usessh @@ -2549,6 +2546,29 @@ nil end + # List of packages expected to be installed in order to enable + # remote administration (VNC) + # + # @return Array<String> + def vnc_packages + packages = VNC_BASE_PACKAGES.dup + # At least one windowmanager must be installed (#427044) + # If none is there, use a fallback + packages << DEFAULT_WM unless has_window_manager? + packages << "yast2-x11" if Mode.autoinst + packages + end + + # List of packages expected to be installed in order to use + # a remote X11 server + # + # @return Array<String> + def remote_x11_packages + packages = REMOTE_X11_BASE_PACKAGES.dup + packages << "yast2-x11" if Mode.autoinst + packages + end + private # Reads product feature defined by parameters, logs what it gets @@ -2640,6 +2660,8 @@ publish :function => :SelectKernelPackages, :type => "void ()" publish :function => :default_patterns, :type => "list <string> ()" publish :function => :log_software_selection, :type => "void ()" + publish :function => :vnc_packages, :type => "list <string> ()" + publish :function => :remote_x11_packages, :type => "list <string> ()" private @@ -2677,6 +2699,13 @@ def kept_products(products) products.select { |product| product["status"] == :installed } end + + # Checks if a window manager is installed or selected for installation + # + # @return [Boolean] true if there is a window manager + def has_window_manager? + Pkg.IsSelected("windowmanager") || Pkg.IsProvided("windowmanager") + end end Packages = PackagesClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.46/test/packages_test.rb new/yast2-packager-3.1.47/test/packages_test.rb --- old/yast2-packager-3.1.46/test/packages_test.rb 2014-09-05 17:30:42.000000000 +0200 +++ new/yast2-packager-3.1.47/test/packages_test.rb 2014-09-12 11:18:11.000000000 +0200 @@ -10,6 +10,8 @@ Yast.import "SCR" Yast.import "Product" Yast.import "ProductFeatures" +Yast.import "Linuxrc" +Yast.import "Pkg" SCR_STRING_PATH = Yast::Path.new(".target.string") SCR_BASH_PATH = Yast::Path.new(".target.bash") @@ -378,4 +380,152 @@ end end + describe "#vnc_packages" do + let(:packages) { Yast::Packages.vnc_packages.sort.uniq } + let(:base_packages) { ["xinetd", "xorg-x11", "xorg-x11-Xvnc", "xorg-x11-fonts"] } + let(:base_packages_and_wm) { ["icewm"] + base_packages } + + context "during installation" do + before do + allow(Yast::Pkg).to receive(:IsProvided).and_return false + allow(Yast::Mode).to receive(:mode).and_return "installation" + end + + context "with window manager already selected" do + before do + allow(Yast::Pkg).to receive(:IsSelected).and_return true + end + + it "includes xinetd and xorg" do + expect(packages).to eq(base_packages) + end + end + + context "without window manager selected" do + before do + allow(Yast::Pkg).to receive(:IsSelected).and_return false + end + + it "includes xinetd, xorg and icewm" do + expect(packages).to eq(base_packages_and_wm) + end + end + end + + context "during autoinstallation" do + before do + allow(Yast::Pkg).to receive(:IsProvided).and_return false + allow(Yast::Mode).to receive(:mode).and_return "autoinstallation" + end + + context "with window manager already selected" do + before do + allow(Yast::Pkg).to receive(:IsSelected).and_return true + end + + it "includes xinetd, xorg and yast2-x11" do + expect(packages).to eq(base_packages + ["yast2-x11"]) + end + end + + context "without window manager selected" do + before do + allow(Yast::Pkg).to receive(:IsSelected).and_return false + end + + it "includes xinetd, xorg and icewm" do + expect(packages).to eq(base_packages_and_wm + ["yast2-x11"]) + end + end + end + + context "in normal mode" do + before do + allow(Yast::Pkg).to receive(:IsSelected).and_return false + allow(Yast::Mode).to receive(:mode).and_return "normal" + end + + context "with window manager already installed" do + before do + allow(Yast::Pkg).to receive(:IsProvided).and_return true + end + + it "includes xinetd and xorg" do + expect(packages).to eq(base_packages) + end + end + + context "without window manager installed" do + before do + allow(Yast::Pkg).to receive(:IsProvided).and_return false + end + + it "includes xinetd, xorg and icewm" do + expect(packages).to eq(base_packages_and_wm) + end + end + end + end + + describe "#modePackages" do + before do + allow(Yast::Linuxrc).to receive(:vnc).and_return vnc + allow(Yast::Linuxrc).to receive(:display_ip).and_return display_ip + allow(Yast::Linuxrc).to receive(:braille).and_return braille + allow(Yast::Linuxrc).to receive(:usessh).and_return usessh + allow(Yast::Mode).to receive(:mode).and_return mode + end + let(:packages) { Yast::Packages.modePackages.sort.uniq } + + context "on a boring local regular installation" do + let(:vnc) { false } + let(:display_ip) { false } + let(:braille) { false } + let(:usessh) { false } + let(:mode) { "installation" } + + it "returns an empty array" do + expect(packages).to be_empty + end + end + + context "over ssh with a remote X server" do + let(:vnc) { false } + let(:display_ip) { true } + let(:braille) { false } + let(:usessh) { true } + let(:xorg_icewm_and_ssh) { + ["icewm", "openssh", "xorg-x11-fonts", "xorg-x11-server"] + } + + context "during installation" do + let(:mode) { "installation" } + + it "includes xorg, icewm and openssh" do + expect(packages).to eq(xorg_icewm_and_ssh) + end + end + + context "during autoinstallation" do + let(:mode) { "autoinstallation" } + + it "includes xorg, icewm, openssh and yast2-x11" do + expect(packages).to eq(xorg_icewm_and_ssh + ["yast2-x11"]) + end + end + end + + context "on vnc installation" do + let(:vnc) { true } + let(:display_ip) { false } + let(:braille) { false } + let(:usessh) { false } + let(:mode) { "installation" } + + it "relies on #vnc_packages" do + expect(Yast::Packages).to receive(:vnc_packages).and_return %w(five names) + expect(packages).to eq(%w(five names)) + end + end + end end -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org