Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Readding missing feature supported in control file: Packages

  required by a selected desktop in DefaultDesktop (bnc#724491).
- 2.21.20

... with testcase


svn path=/trunk/packager/; revision=66469
  • Loading branch information...
commit a26598287f94e8ab3697029e614f37e7989f55b3 1 parent e6ccaa3
@kobliha kobliha authored
View
2  VERSION
@@ -1 +1 @@
-2.21.19
+2.21.20
View
7 package/yast2-packager.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Oct 17 16:01:54 CEST 2011 - locilka@suse.cz
+
+- Readding missing feature supported in control file: Packages
+ required by a selected desktop in DefaultDesktop (bnc#724491).
+- 2.21.20
+
+-------------------------------------------------------------------
Wed Oct 12 15:09:39 CEST 2011 - jsuchome@suse.cz
- do not add initrd modules when mkintrd itself can add them
View
22 src/modules/DefaultDesktop.ycp
@@ -156,7 +156,8 @@ global void ForceReinit () {
* "label_id" : _("Desktop Name Visible in Dialog (original)"),
* "description" : _("Description text of the desktop (localized - initial localization)"),
* "description_id" : _("Description text of the desktop (originale)"),
- * "patterns" : ["list", "of", "related", "patterns"],
+ * "patterns" : ["list", "of", "required", "patterns"],
+ * "packages" : ["list", "of", "required", "packages"],
* "icon" : "some-icon", // filename from the 64x64 directory of the current theme (without .png suffix)
* ],
* ]
@@ -220,7 +221,8 @@ global string Desktop () {
return desktop;
}
-string packages_proposal_ID = "DefaultDesktop";
+string packages_proposal_ID_patterns = "DefaultDesktopPatterns";
+string packages_proposal_ID_packages = "DefaultDesktopPackages";
/**
* Set the default desktop
@@ -232,7 +234,8 @@ global void SetDesktop (string new_desktop) {
if (new_desktop == nil) {
// Reset the selected patterns
y2milestone ("Reseting DefaultDesktop");
- PackagesProposal::SetResolvables (packages_proposal_ID, `pattern, []);
+ PackagesProposal::SetResolvables (packages_proposal_ID_patterns, `pattern, []);
+ PackagesProposal::SetResolvables (packages_proposal_ID_packages, `package, []);
} else if (! haskey (all_desktops, new_desktop)) {
y2error ("Attempting to set desktop to unknown %1", new_desktop);
} else {
@@ -241,12 +244,21 @@ global void SetDesktop (string new_desktop) {
y2milestone ("New desktop has been set: %1", desktop);
if (desktop != nil && desktop != "") {
- // Require new patterns
- PackagesProposal::SetResolvables (packages_proposal_ID, `pattern, all_desktops[desktop,"patterns"]:[]);
+ // Require new patterns and packages
+ PackagesProposal::SetResolvables (packages_proposal_ID_patterns, `pattern, all_desktops[desktop,"patterns"]:[]);
+ PackagesProposal::SetResolvables (packages_proposal_ID_packages, `package, all_desktops[desktop,"packages"]:[]);
}
}
}
+global list<string> SelectedPatterns() {
+ return PackagesProposal::GetResolvables (packages_proposal_ID_patterns, `pattern);
+}
+
+global list<string> SelectedPackages() {
+ return PackagesProposal::GetResolvables (packages_proposal_ID_packages, `package);
+}
+
/**
* Get preffered window/desktop manager for the selected desktop
* @return string preffered window/desktop manager, empty if no one
View
0  testsuite/tests/DefaultDesktop.err
No changes.
View
16 testsuite/tests/DefaultDesktop.out
@@ -0,0 +1,16 @@
+Dump --- All desktops ---
+Return $["gnome":$["cursor":"DMZ", "desktop":"gnome", "icon":"pattern-gnome", "label":"GNOME Desktop", "label_id":"desktop_gnome", "logon":"gdm", "order":1, "packages":["gdm", "branding-openSUSE"], "patterns":["gnome", "x11", "base"]], "kde":$["cursor":"DMZ", "desktop":"kde4", "icon":"pattern-kde4", "label":"KDE Desktop", "label_id":"desktop_kde", "logon":"kdm", "order":1, "packages":["kdm", "branding-openSUSE"], "patterns":["kde", "x11", "base"]], "lxde":$["cursor":"DMZ", "desktop":"lxde", "icon":"pattern-lxde", "label":"LXDE Desktop", "label_id":"desktop_lxde", "logon":"lxdm", "order":5, "packages":["lxde-common", "branding-openSUSE"], "patterns":["lxde", "x11", "base"]], "min_x":$["cursor":"DMZ", "desktop":"twm", "icon":"yast-x11", "label":"Minimal X Window", "label_id":"desktop_min_x", "logon":"xdm", "order":6, "packages":["xorg-x11", "branding-openSUSE"], "patterns":["x11", "base"]], "textmode":$["cursor":"DMZ", "desktop":"twm", "icon":"yast-sshd", "label":"Minimal Server Selection (Text Mode)", "label_id":"desktop_textmode", "logon":"xdm", "order":8, "packages":["branding-openSUSE"], "patterns":["minimal_base", "minimal_base-conflicts"]], "xfce":$["cursor":"DMZ", "desktop":"xfce", "icon":"pattern-xfce", "label":"XFCE Desktop", "label_id":"desktop_xfce", "logon":"lightdm", "order":4, "packages":["lightdm", "branding-openSUSE"], "patterns":["xfce", "x11", "base"]]]
+Dump --- KDE selected by default ---
+Return kde
+Return ["kde", "x11", "base"]
+Return ["kdm", "branding-openSUSE"]
+Dump --- Selecting GNOME ---
+Return nil
+Return gnome
+Return ["gnome", "x11", "base"]
+Return ["gdm", "branding-openSUSE"]
+Dump --- Reset ---
+Return nil
+Return kde
+Return ["kde", "x11", "base"]
+Return ["kdm", "branding-openSUSE"]
View
67 testsuite/tests/DefaultDesktop.ycp
@@ -0,0 +1,67 @@
+{
+// testedfiles: DefaultDesktop
+ include "testsuite.ycp";
+
+ map READ = $[
+ "target" : $[
+ "size" : 55452,
+ "stat" : $["size" : 55452],
+ "tmpdir" : "/tmp/",
+ ],
+ "xml" : $[
+ "software":$[
+ // desktop selected by default
+ "default_desktop":"kde",
+
+ // all available desktops
+ "supported_desktops":[
+ $["cursor":"DMZ", "desktop":"gnome", "icon":"pattern-gnome", "label_id":"desktop_gnome", "logon":"gdm", "name":"gnome", "order":1, "packages":"gdm branding-openSUSE", "patterns":"gnome x11 base"],
+ $["cursor":"DMZ", "desktop":"kde4", "icon":"pattern-kde4", "label_id":"desktop_kde", "logon":"kdm", "name":"kde", "order":1, "packages":"kdm branding-openSUSE", "patterns":"kde x11 base"],
+ $["cursor":"DMZ", "desktop":"xfce", "icon":"pattern-xfce", "label_id":"desktop_xfce", "logon":"lightdm", "name":"xfce", "order":4, "packages":"lightdm branding-openSUSE", "patterns":"xfce x11 base"],
+ $["cursor":"DMZ", "desktop":"lxde", "icon":"pattern-lxde", "label_id":"desktop_lxde", "logon":"lxdm", "name":"lxde", "order":5, "packages":"lxde-common branding-openSUSE", "patterns":"lxde x11 base"],
+ $["cursor":"DMZ", "desktop":"twm", "icon":"yast-x11", "label_id":"desktop_min_x", "logon":"xdm", "name":"min_x", "order":6, "packages":"xorg-x11 branding-openSUSE", "patterns":"x11 base"],
+ $["cursor":"DMZ", "desktop":"twm", "icon":"yast-sshd", "label_id":"desktop_textmode", "logon":"xdm", "name":"textmode", "order":8, "packages":"branding-openSUSE", "patterns":"minimal_base minimal_base-conflicts"],
+ ],
+ ],
+
+ // names for desktops
+ "texts":$[
+ "desktop_gnome":$["label":"GNOME Desktop"],
+ "desktop_kde":$["label":"KDE Desktop"],
+ "desktop_lxde":$["label":"LXDE Desktop"],
+ "desktop_min_x":$["label":"Minimal X Window"],
+ "desktop_textmode":$["label":"Minimal Server Selection (Text Mode)"],
+ "desktop_xfce":$["label":"XFCE Desktop"],
+ ],
+ ],
+ ];
+ map WRITE = $[];
+ map EXEC = $[];
+
+ TESTSUITE_INIT ([READ, WRITE, EXEC], nil);
+
+ import "DefaultDesktop";
+
+ DUMP(" --- All desktops --- ");
+ TEST(``(DefaultDesktop::GetAllDesktopsMap()), [READ, $[], EXEC], nil);
+
+ // Using the default
+ DUMP(" --- KDE selected by default --- ");
+ TEST(``(DefaultDesktop::Desktop()), [READ, $[], EXEC], nil);
+ TEST(``(DefaultDesktop::SelectedPatterns()), [READ, $[], EXEC], nil);
+ TEST(``(DefaultDesktop::SelectedPackages()), [READ, $[], EXEC], nil);
+
+ // Adjusting new variable
+ DUMP(" --- Selecting GNOME --- ");
+ TEST(``(DefaultDesktop::SetDesktop("gnome")), [READ, $[], EXEC], nil);
+ TEST(``(DefaultDesktop::Desktop()), [READ, $[], EXEC], nil);
+ TEST(``(DefaultDesktop::SelectedPatterns()), [READ, $[], EXEC], nil);
+ TEST(``(DefaultDesktop::SelectedPackages()), [READ, $[], EXEC], nil);
+
+ // Back to the default
+ DUMP(" --- Reset --- ");
+ TEST(``(DefaultDesktop::ForceReinit()), [READ, $[], EXEC], nil);
+ TEST(``(DefaultDesktop::Desktop()), [READ, $[], EXEC], nil);
+ TEST(``(DefaultDesktop::SelectedPatterns()), [READ, $[], EXEC], nil);
+ TEST(``(DefaultDesktop::SelectedPackages()), [READ, $[], EXEC], nil);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.