Mailinglist Archive: opensuse-commit (1301 mails)

< Previous Next >
commit yast2-packager
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Fri, 13 Jul 2007 19:30:36 +0200
  • Message-id: <20070713173036.F03A567817A@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package yast2-packager
checked in at Fri Jul 13 19:30:36 CEST 2007.

--------
--- yast2-packager/yast2-packager.changes       2007-07-10 10:04:27.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-packager/yast2-packager.changes  2007-07-12 13:42:46.000000000 +0200
@@ -1,0 +2,11 @@
+Thu Jul 12 13:02:41 CEST 2007 - locilka@xxxxxxx
+
+- Client inst_productsources moved here from yast2-installation.
+- Adjusted Requires: tag to match inst_productsources' needs.
+- Added productsources.desktop to the Software in Control Center.
+- Client inst_productsources changed to use OneClickInstallStandard
+  YaST module (and its XML format).
+- Added helps into the inst_productsources.
+- 2.15.45
+
+-------------------------------------------------------------------

Old:
----
  yast2-packager-2.15.44.tar.bz2

New:
----
  yast2-packager-2.15.45.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.vX2640/_old  2007-07-13 19:30:06.000000000 +0200
+++ /var/tmp/diff_new_pack.vX2640/_new  2007-07-13 19:30:06.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package yast2-packager (Version 2.15.44)
+# spec file for package yast2-packager (Version 2.15.45)
 #
 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
 # norootforbuild
 
 Name:           yast2-packager
-Version:        2.15.44
+Version:        2.15.45
 Release:        1
 License:        GPL v2 or later
 Group:          System/YaST
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Source0:        yast2-packager-2.15.44.tar.bz2
+Source0:        yast2-packager-2.15.45.tar.bz2
 prefix:                /usr
 BuildRequires:  docbook-xsl-stylesheets doxygen gcc-c++ libxcrypt-devel libxslt perl-XML-Simple perl-XML-Writer sgml-skel update-desktop-files yast2-country yast2-devtools yast2-perl-bindings yast2-slp yast2-testsuite yast2-xml
 BuildRequires:  yast2 >= 2.15.38
@@ -30,6 +30,10 @@
 Requires:       yast2 >= 2.15.38
 # unzipping license file
 Requires:       unzip
+# HTTP, FTP, HTTPS modules (inst_productsources.ycp)
+Requires:       yast2-transfer
+# XML module (inst_productsources.ycp)
+Requires:       yast2-xml
 Provides:       yast2-config-package-manager
 Obsoletes:      yast2-config-package-manager
 Provides:       y2t_spkg y2t_inst-packages y2pkginf y2c_spkg
@@ -51,7 +55,7 @@
     Arvin Schnell <arvin@xxxxxxx>
 
 %prep
-%setup -n yast2-packager-2.15.44
+%setup -n yast2-packager-2.15.45
 
 %build
 %{prefix}/bin/y2tool y2autoconf
@@ -90,6 +94,14 @@
 %doc %{prefix}/share/doc/packages/yast2-packager
 
 %changelog
+* Thu Jul 12 2007 - locilka@xxxxxxx
+- Client inst_productsources moved here from yast2-installation.
+- Adjusted Requires: tag to match inst_productsources' needs.
+- Added productsources.desktop to the Software in Control Center.
+- Client inst_productsources changed to use OneClickInstallStandard
+  YaST module (and its XML format).
+- Added helps into the inst_productsources.
+- 2.15.45
 * Mon Jul 09 2007 - locilka@xxxxxxx
 - Added new OneClickInstallStandard module written in Perl to
   support XML format specified by One Click Install Standard

++++++ yast2-packager-2.15.44.tar.bz2 -> yast2-packager-2.15.45.tar.bz2 ++++++
++++ 3916 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-packager-2.15.44/src/clients/inst_productsources.ycp new/yast2-packager-2.15.45/src/clients/inst_productsources.ycp
--- old/yast2-packager-2.15.44/src/clients/inst_productsources.ycp      1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-packager-2.15.45/src/clients/inst_productsources.ycp      2007-07-12 13:42:15.000000000 +0200
@@ -0,0 +1,903 @@
+{
+    /***
+     * This is a stand-alone YaST client that allows you to add suggested
+     * installation sources (repositories) to the libzypp.
+     *
+     * How it works:
+     * - First a list of servers/links is extracted from the YaST control file
+     *   (/etc/YaST2/control.xml)
+     * - Then servers/links are asked one by one to provide the suggested sources
+     *
+     * Format of the initial list of servers:
+     * <?xml version="1.0"?>
+     * <productDefines xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns";>
+     *   <servers config:type="list">
+     *     <item>
+     *       <link>http://some.server/some_link.xml</link>
+     *     </item>
+     *     <item>
+     *       <link>ftp://some.other.server/some_link.xml</link>
+     *     </item>
+     *   </servers>
+     * </productDefines>
+     *
+     * Format of Suggested sources:
+     * <?xml version="1.0"?>
+     * <metapackage xmlns:os="http://opensuse.org/Standards/One_Click_Install" xmlns="http://opensuse.org/Standards/One_Click_Install";>
+     *   <group distversion="openSUSE Factory">
+     *     <repositories>
+     *       <repository recommended="true" format="yast">
+     *         <name>Some name</name>
+     *         <name lang="en_GB">Some name</name>
+     *         <summary>Summary...</summary>
+     *         <summary lang="en_GB">Summary...</summary>
+     *         <description>Description...</description>
+     *         <url>http://some.server/some.dir/10.3/</url>
+     *       </repository>
+     *       <repository recommended="false" format="yast">
+     *         <name>Another name</name>
+     *         <summary>Summary...</summary>
+     *         <description>Description...</description>
+     *         <url>http://another.server/another.dir/10.3/</url>
+     *       </repository>
+     *     </repositories>
+     *   </group>
+     * </metapackage>
+     */
+
+    textdomain "installation";
+    
+    import "Wizard";
+    import "Sequencer";
+
+    import "NetworkService";
+    import "Mode";
+    import "Popup";
+    import "Label";
+    import "Installation";
+    import "PackageLock";
+    import "ProductFeatures";
+    import "Directory";
+    import "Progress";
+    import "Stage";
+    import "Report";
+
+    import "FileUtils";
+    import "HTTP";
+    import "FTP";
+    import "XML";
+    import "ProductControl";
+    import "AddOnProduct";
+    import "GetInstArgs";
+    import "OneClickInstallStandard";
+
+    include "installation/misc.ycp";
+
+    string main_link = "";
+
+    map <string, map> list_of_repos = $[];
+
+    list <map> list_of_servers = [];
+
+    // List of IDs of URLs to be added
+    list <string> repos_to_be_used = [];
+
+    // Map of already used suggested repositories
+    // $[ "($url|$path)" : src_id ]
+    map <string, integer> repos_already_used = $[];
+
+    string CreateRepoId (string s_url, string s_path) {
+       return sformat ("(%1|%2)", s_url, s_path);
+    }
+
+    boolean NetworkRunning () {
+       boolean ret = false;
+
+       while (true) {
+           if (NetworkService::isNetworkRunning()) {
+               ret = true;
+               break;
+           }
+
+           // Network is not running
+           if (! Popup::AnyQuestion (
+               // TRANSLATORS: popup header
+               _("Network is not Configured"),
+               // TRANSLATORS: popup question
+               _("Additional sources defined by product require an Internet connection.
+
+Would you like to configure it?"),
+               Label::YesButton(),
+               Label::NoButton(),
+               `yes
+           )) {
+               y2milestone ("User decided not to setup the network");
+               ret = false;
+               break;
+           }
+           
+           y2milestone ("User wants to setup the network");
+           // Call network-setup client
+           WFM::call("inst_network_setup");
+       }
+
+       return ret;
+    }
+
+    /**
+     * Returns whether this URL/Path is already added as a source
+     * -1 == not added
+     * 0 or 1 or 2 ... or 'n' means 'added as source $id'
+     */
+    integer IsAddOnAlreadySelected (string s_url, string s_path) {
+       //    AddOnProduct::add_on_products, $[
+       //      "media" : src_id,
+       //      "product" : prod["label"]:prod["productname"]:prod["productversion"]:list_of_repos[url,"name"]:"",
+       //      "autoyast_product" : prod["productname"]:"",
+       //      "media_url" : url,
+       //      "product_dir" : pth,
+       //    ];
+
+       integer ret = -1;
+
+       foreach (map one_add_on, AddOnProduct::add_on_products, {
+           if (one_add_on["media_url"]:nil == s_url && one_add_on["product_dir"]:nil == s_path) {
+               ret = one_add_on["media"]:-1;
+               break;
+           }
+       });
+
+       return ret;
+    }
+
+    boolean InitializeSources () {
+//     if (Mode::installation()) {
+//         y2milestone ("Sources already initialized");
+//         return true;
+//     }
+
+       y2milestone ("Initializing...");
+       if (!PackageLock::Check()) return false;
+
+       Pkg::TargetInitialize (Installation::destdir);
+       // not necessary
+       // Pkg::TargetLoad();
+       Pkg::SourceStartManager (true);
+
+       if (! Mode::installation()) {
+           // repos_already_used
+           foreach (integer one_id, Pkg::SourceGetCurrent (true), {
+               map source_data = Pkg::SourceGeneralData (one_id);
+
+               if (IsAddOnAlreadySelected (source_data["url"]:"", source_data["product_dir"]:"") >= -1) {
+                   AddOnProduct::add_on_products = add (
+                       AddOnProduct::add_on_products,
+                       $[
+                           "media" : one_id,
+                           "media_url" : source_data["url"]:"",
+                           "product_dir" : source_data["product_dir"]:"",
+                           "product" : "",
+                           "autoyast_product" : "",
+                       ]
+                   );
+               }
+
+           });
+       }
+
+       return true;
+    }
+
+    boolean ReadControlFile () {
+       if (! Stage::initial())
+           ProductControl::ReadControlFile ("/etc/YaST2/control.xml");
+
+       map <string, any> software_features = ProductFeatures::GetSection ("software");
+       if (software_features != nil) {
+           main_link = software_features["external_sources_link"]:"";
+       } else {
+           main_link = "";
+       }
+       y2milestone ("Got link: %1", main_link);
+
+       if (main_link == nil || main_link == "") {
+           main_link = "";
+           y2warning ("No link");
+           return false;
+       }
+
+       y2milestone ("Using link: %1", main_link);
+
+       return (main_link != nil && main_link != "");
+    }
+
+    string UseDownloadFile () {
+       return sformat ("%1/inst_productsources_downloadfile", Directory::tmpdir);
+    }
+
+    boolean RemoveFileIfExists (string file) {
+       if (FileUtils::Exists (file)) {
+           y2milestone ("Removing file: %1", file);
+           return (boolean) SCR::Execute (.target.remove, file);
+       }
+       
+       return true;
+    }
+
+    boolean DownloadFile (string from, string to) {
+       RemoveFileIfExists (to);
+       map server_response = $[];
+
+       if (regexpmatch (from, "^[hH][tT][tT][pP]://")) {
+           from = regexpsub (from, "^[hH][tT][tT][pP]://(.*)", "http://\\1";);
+
+           server_response = HTTP::Get (from, to);
+
+       } else if (regexpmatch (from, "^[fF][tT][pP]://")) {
+           from = regexpsub (from, "^[fF][tT][pP]://(.*)", "ftp://\\1";);
+
+           server_response = FTP::Get (from, to);
+
+       } else {
+           y2error ("Not a supported type: %1", from);
+           return false;
+       }
+
+       y2milestone ("Server response: %1", server_response);
+
+       return true;
+    }
+
+    boolean ParseListOfServers (string download_file) {
+       if (! FileUtils::Exists (download_file)) {
+           y2error ("File %1 does not exist", download_file);
+           return false;
+       }
+
+       map xml_file_content = XML::XMLToYCPFile (download_file);
+
+       if (xml_file_content == nil) {
+           y2error ("Reading file %1 failed", download_file);
+           return false;
+       }
+
+       if (xml_file_content == $[]) {
+           y2milestone ("XML file is empty");
+           return false;
+       }
+
+       if (xml_file_content["servers"]:[] == []) {
+           y2milestone ("List of servers is empty");
+           return false;
+       }
+
+       list_of_servers = xml_file_content["servers"]:[];
+
+       return true;
+    }
+
+    boolean ParseListOfSources (string download_file, string url_from) {
+       if (! FileUtils::Exists (download_file)) {
+           y2error ("File %1 does not exist", download_file);
+           return false;
+       }
+
+       string xml_file_as_string = (string) SCR::Read (.target.string, download_file);
+       if (xml_file_as_string == nil || xml_file_as_string == "") {
+           y2error ("Cannot read file %1 or file empty", xml_file_as_string);
+           return false;
+       }
+
+       list <map <string, any> > xml_file_content =
+           OneClickInstallStandard::GetRepositoriesFromXML (xml_file_as_string);
+
+       if (xml_file_content == nil) {
+           y2error ("Parsing file %1 failed", download_file);
+           return false;
+       }
+
+       if (xml_file_content == []) {
+           y2milestone ("XML file is empty");
+           return false;
+       }
+
+       foreach (map one_repo, (list <map <string, any> >) xml_file_content, {
+           one_repo["url_from"] = url_from;
+           string repo_id = CreateRepoId (one_repo["url"]:"", one_repo["path"]:"/");
+
+           // do not redefine already added one
+           if (! haskey (list_of_repos, repo_id)) {
+               list_of_repos[repo_id] = one_repo;
+           }
+       });
+
+       return true;
+    }
+
+    boolean DownloadAndParseSources () {
+       list_of_repos = $[];
+       list_of_servers = [];
+
+       if (! DownloadFile (main_link, UseDownloadFile())) {
+           y2error ("Unable to download list of external sources");
+           return false;
+       }
+       
+       if (! ParseListOfServers (UseDownloadFile())) {
+           y2error ("Unable to parse list of servers");
+           return false;
+       }
+
+       foreach (map one_server, list_of_servers, {
+           if (one_server["link"]:"" != "") {
+               y2milestone ("Downloading list of repos from %1", one_server["link"]:"");
+
+               if (! DownloadFile (one_server["link"]:"", UseDownloadFile())) {
+                   y2error ("Unable to download list of external sources");
+                   return;
+               }
+               if (! ParseListOfSources (UseDownloadFile(), one_server["link"]:"")) {
+                   y2error ("Unable to parse list of sources");
+                   return;
+               }
+           }
+       });
+
+       return true;
+    }
+
+    symbol ReadDialog () {
+       list <string> actions_todo = [
+               // TRANSLATORS: progress step
+               _("Check network configuration"),
+               // TRANSLATORS: progress step
+               _("Download list of external installation sources"),
+               // TRANSLATORS: progress step
+       ];
+
+       list <string> actions_doing = [
+               // TRANSLATORS: progress step
+               _("Checking network configuration..."),
+               // TRANSLATORS: progress step
+               _("Downloading list of external installation sources..."),
+       ];
+
+       if (! Stage::initial()) {
+           // TRANSLATORS: progress step
+           actions_todo = add (actions_todo, _("Initialize the source manager"));
+           // TRANSLATORS: progress step
+           actions_doing = add (actions_doing, _("Initializing the source manager..."));
+       }
+
+       Progress::New (
+           // TRANSLATORS: dialog caption
+           _("Reading List of External Installation Sources"),
+           " ",
+           size (actions_todo),
+           actions_todo,
+           actions_doing,
+           // TRANSLATORS: dialog help
+           _("<p>Please wait, while packager is being initialized
+and list of servers dowloaded from web.</p>")
+       );
+       Wizard::SetTitleIcon ("yast-network");
+
+       Progress::NextStage();
+
+       if (! NetworkRunning()) {
+           y2warning ("Cannot proceed, no network configured...");
+           return `abort;
+       }
+       
+       Progress::NextStage();
+
+       if (! ReadControlFile()) {
+           y2milestone ("Feature not supported by the product");
+           return `abort;
+       }
+       
+       if (! DownloadAndParseSources()) {
+           y2error ("Cannot downoload or parse sources");
+           return `abort;
+       }
+
+       if (! Stage::initial()) {
+           Progress::NextStage();
+           InitializeSources();
+       }
+       
+       Progress::Finish();
+       sleep (600);
+       
+       return `next;
+    }
+
+    void PrintRepositoryDescription () {
+       string current_id = (string) UI::QueryWidget (`id ("addon_repos"), `CurrentItem);
+
+       // Nothing selected, no description
+       if (current_id == nil || current_id == "") {
+           UI::ChangeWidget (`id ("addon_description"), `Value, "");
+           return;
+       }
+
+       string description = sformat (
+           // TRANSLATORS: This is a complex HTML-formatted information about selecetd external repository
+           // It contains "key: value" pair, one per line, separated by <br> tags
+           // %1 is replaced with an URL of the selected repository
+           // %2 is replaced with an URL from which we've got this repository information
+           // %3 is replaced with a summary text for the selected repository
+           // %4 is replaced with a description text for the selected repository
+           _("<p>
+<b>URL:</b> %1<br>
+<b>Linked from:</b> %2<br>
+<b>Summary:</b> %3<br>
+<b>Description:</b> %4
+</p>"),
+           list_of_repos[current_id, "url"]:"",
+           list_of_repos[current_id, "url_from"]:"",
+           list_of_repos[current_id, "summary"]:list_of_repos[current_id, "name"]:"",
+           list_of_repos[current_id, "description"]:""
+       );
+
+       UI::ChangeWidget (`id ("addon_description"), `Value, description);
+    }
+
+
+
+    list <string> repos_visible_now = [];
+
+    list <string> already_selected_in_dialog = [];
+
+    boolean IsSelectedInDialog (string repo_id) {
+       return contains (already_selected_in_dialog, repo_id);
+    }
+
+    void InitRopositoriesWidget (string filter_string) {
+       list <term> items = [];
+       
+       repos_visible_now = [];
+
+       integer counter = -1;
+       foreach (string url, map one_repo, list_of_repos, {
+           // do filter
+           if (filter_string != "") {
+               // neither "url" nor "name" matching
+               if (
+                   ! regexpmatch (one_repo["url"]:"", filter_string)
+                   &&
+                   ! regexpmatch (one_repo["name"]:"", filter_string)
+               ) {
+                   return;
+               }
+           }
+
+           counter = counter + 1;
+           if (url == "") {
+               y2error ("InstSource %1 has no 'url'", one_repo);
+               return;
+           }
+
+           string repo_id = CreateRepoId (one_repo["url"]:"", one_repo["path"]:"/");
+           integer src_id = IsAddOnAlreadySelected (one_repo["url"]:"", one_repo["path"]:"/");
+           boolean already_used = false;
+
+           // source has been already initialized
+           if (src_id > -1) {
+               repos_already_used[repo_id] = src_id;
+               already_used = true;
+           // source has been already selected
+           } else if (IsSelectedInDialog (repo_id)) {
+               already_used = true;
+           }
+
+           items[counter] = `item (
+               `id (repo_id),
+               one_repo["name"]:one_repo["url"]:"",
+               already_used
+           );
+           
+           repos_visible_now[counter] = repo_id;
+       });
+
+       // FIXME: use lsort instead
+       items = sort (term one_item_a, term one_item_b, items, ``(one_item_a[1]:"" < one_item_b[1]:""));
+
+       UI::ChangeWidget (`id ("addon_repos"), `Items, items);
+
+       PrintRepositoryDescription();
+    }
+
+    void StoreSelectedInDialog () {
+       // remember already selected items before filtering
+       list <string> currently_selected = (list <string>) UI::QueryWidget (`id ("addon_repos"), `SelectedItems);
+
+       // all visible repos - just now
+       foreach (string one_repo, repos_visible_now, {
+
+           // visible repository is not selected
+           if (! contains (currently_selected, one_repo)) {
+               // was already selected
+               if (contains (already_selected_in_dialog, one_repo)) {
+                   already_selected_in_dialog = filter (string o_r, already_selected_in_dialog, {
+                       return o_r != one_repo;
+                   });
+               }
+
+           // visible repository is selected now
+           } else {
+               // wasn't selected
+               if (! contains (already_selected_in_dialog, one_repo)) {
+                   // add it
+                   already_selected_in_dialog = add (already_selected_in_dialog, one_repo);
+               }
+           }
+
+       });
+    }
+
+    boolean HandleSelectedSources () {
+       StoreSelectedInDialog();
+       repos_to_be_used = already_selected_in_dialog;
+
+       // FIXME: handle no sources selected (warning)
+
+       // FIXME: a lot of sources selected (warning)
+
+       return true;
+    }
+
+    string EscapeChars (string input) {
+       if (input == "" || input == nil) return input;
+
+       // \ must be the first character!
+       string escape = "\\(){}[]+^$|";
+       string ret = input;
+       
+       integer i = 0;
+       integer sz = size (escape);
+           
+       while (i < sz) {
+           string ch = substring (escape, i, 1);
+           y2debug ("Escaping %1", ch);
+           ret = mergestring (splitstring (ret, ch), "\\" + ch);
+           i = i + 1;
+       }
+       
+       return ret;
+    }
+
+    string casesenschars = "^[abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWXYZ]$";
+
+    // Example:
+    // <- "aBc/iop"
+    // -> "[Aa][Bb][Cc]/[Ii][Oo][Pp]"
+    string MakeCaseInsensitiveRegexp (string input) {
+       if (input == nil || input == "") return input;
+
+       list <string> characters = [];
+       integer counter = 0;
+       integer input_size = size (input);
+
+       while (counter < input_size) {
+           characters[counter] = substring (input, counter, 1);
+           counter = counter + 1;
+       }
+       input = "";
+
+       foreach (string onechar, characters, {
+           if (regexpmatch (onechar, casesenschars)) {
+               onechar = sformat ("[%1%2]", toupper (onechar), tolower (onechar));
+           }
+           input = input + onechar;
+       });
+
+       return input;
+    }
+
+    void HandleFilterButton () {
+       StoreSelectedInDialog();
+
+       string filter_string = (string) UI::QueryWidget (`id ("filter_text"), `Value);
+       filter_string = EscapeChars (filter_string);
+       filter_string = MakeCaseInsensitiveRegexp (filter_string);
+
+       InitRopositoriesWidget (filter_string);
+
+       UI::SetFocus (`id ("filter_text"));
+    }
+
+    symbol SourcesDialog () {
+       Wizard::SetContents (
+           // TRANSLATORS: dialog caption
+           _("List of External Installation Sources"),
+           `VBox (
+               `HBox (
+                   `HVSquash(`MinWidth(20, `TextEntry (`id ("filter_text"), ""))),
+                   // TRANSLATORS: push button
+                   `Bottom(`PushButton (`id ("do_filter"), `opt(`default), _("&Filter"))),
+                   `HStretch()
+               ),
+               `VSpacing (0.5),
+               `VWeight (
+                   2,
+                   `MultiSelectionBox(
+                       `id ("addon_repos"), `opt (`notify, `hstretch),
+                       // TRANSLATORS: multi-selection box
+                       _("&List of Installation Sources"), []
+                   )
+               ),
+               `VSpacing (0.5),
+               // TRANSLATORS: Rich-text widget (HTML)
+               `Left (`Label (_("Installation Source Description"))),
+               `VWeight (
+                   1,
+                   `RichText (`id ("addon_description"), "")
+               )
+           ),
+           // TRANSLATORS: dialog help 1/3
+           _("<p>Here you can see default product repositories downloaded from Internet.
+Click on the repository to see its details.</p>") +
+           (Stage::initial() ?
+               // TRANSLATORS: dialog help 2/3 (version for installation)
+               _("<p>If you want one or more additional repositories to be used,
+select those you want and click <b>Next</b></p>")
+               :
+               // TRANSLATORS: dialog help 2/3 (version for running system)
+               _("<p>If you want one or more additional repositories to be used,
+select those you want and click <b>Finish</b></p>")
+           ) +
+           // TRANSLATORS: dialog help 3/3
+           _("<p>To remove a used repository, just unselect it.</p>"),
+           (Mode::installation() ? GetInstArgs::enable_back():false),
+           (Mode::installation() ? GetInstArgs::enable_next():true)
+       );
+       Wizard::SetTitleIcon ("yast-sw_source");
+       if (! Stage::initial()) {
+           Wizard::DisableBackButton();
+           Wizard::SetNextButton (`next, Label::FinishButton());
+       }
+       
+       repos_already_used = $[];
+       InitRopositoriesWidget ("");
+
+       any dialog_ret = nil;
+
+       while (true) {
+           dialog_ret = UI::UserInput();
+
+           if (dialog_ret == `back) {
+               y2milestone ("Going back");
+               dialog_ret = `special_go_back;
+               break;
+           } else if (dialog_ret == `next) {
+               if (HandleSelectedSources()) {
+                   break;
+               } else {
+                   continue;
+               }
+           } else if (dialog_ret == `abort || dialog_ret == `cancel) {
+               dialog_ret = `abort;
+               if (Stage::initial()) {
+                   if (Popup::ConfirmAbort (`painless)) break;
+               } else {
+                   if (Popup::ContinueCancelHeadline (
+                       // TRANSLATORS: popup header
+                       _("Aborting Configuration of External Installation Source"),
+                       // TRANSLATORS: popup question
+                       _("Are you sure you want to abort the configuration?")
+                   )) break;
+               }
+           } else if (dialog_ret == "addon_repos") {
+               PrintRepositoryDescription();
+           } else if (dialog_ret == "do_filter") {
+               HandleFilterButton();
+           } else {
+               y2error ("Unknown ret: %1", dialog_ret);
+           }
+       }
+
+       Wizard::EnableBackButton();
+
+       return (symbol) dialog_ret;
+    }
+
+    boolean CreateSource (string url, string pth) {
+       integer src_id = Pkg::SourceCreate (url, pth);
+       if (src_id == nil) {
+           Report::Error (sformat (
+               // TRANSLATORS: pop-up error message
+               // %1 is replaced with an installation source name or URL
+               _("Adding source %1 failed"),
+               list_of_repos[CreateRepoId(url,pth), "name"]:url
+           ));
+           // FIXME: retry ?
+           return false;
+       }
+
+       if (! AddOnProduct::AcceptedLicenseAndInfoFile (src_id)) {
+           Pkg::SourceDelete (src_id);
+           return false;
+       }
+
+       if (Stage::initial()) {
+           AddOnProduct::Integrate (src_id);
+
+           map <string, string> prod = (map <string, string>) Pkg::SourceProductData (src_id);
+           y2milestone ("Product Data: %1", prod);
+
+           string repo_id = CreateRepoId (url, pth);
+           y2milestone ("UUU: %1", repo_id);
+           y2milestone ("%1", list_of_repos);
+
+           AddOnProduct::add_on_products = add (AddOnProduct::add_on_products, $[
+               "media" : src_id,
+               "product" : prod["label"]:prod["productname"]:prod["productversion"]:list_of_repos[repo_id,"name"]:"",
+               "autoyast_product" : prod["productname"]:"",
+               "media_url" : url,
+               "product_dir" : pth,
+           ]);
+       }
+    }
+
+    symbol WriteDialog () {
+       list <string> actions_todo = [];
+       list <string> actions_doing = [];
+       boolean at_once = nil;
+
+       list <integer> repos_to_be_deleted = [];
+
+       // repos_to_be_used
+       // repos_already_used
+
+       //y2milestone ("ToBeDeleted: %1", repos_to_be_deleted);
+       //y2milestone ("ReposAlreadyUsed: %1", repos_already_used);
+       //y2milestone ("ReposToBeUsed: %1", repos_to_be_used);
+
+       // go through all already initialized sources
+       // add unselected repository to 'repos_to_be_deleted'
+       // remove already selected repository from 'repos_to_be_used'
+
+       foreach (string id_used, integer src_id, repos_already_used, {
+           // was used, but isn't anymore
+           if (! contains (repos_to_be_used, id_used)) {
+               repos_to_be_deleted = add (repos_to_be_deleted, src_id);
+
+           // was used and remains used
+           } else {
+               y2milestone ("NotUsingAgain: %1", id_used);
+               repos_to_be_used = filter (string id_already_used, repos_to_be_used, {
+                   return (id_used != id_already_used);
+               });
+           }
+       });
+
+       //y2milestone ("WillBeDeleted: %1", repos_to_be_deleted);
+       //y2milestone ("WillBeUsed: %1", repos_to_be_used);
+
+       if (repos_to_be_deleted != []) {
+           y2milestone ("Repos to be deleted: %1", repos_to_be_deleted);
+
+           // TRANSLATORS: progress step
+           actions_todo = [_("Delete unselected external installation sources")];
+           // TRANSLATORS: progress step
+           actions_doing = [_("Deleting unselected external installation sources...")];
+       }
+
+       if (size (repos_to_be_used) > 12) {
+           at_once = true;
+           // TRANSLATORS: progress step
+           actions_todo = add (actions_todo, _("Add all selected external installation sources"));
+           // TRANSLATORS: progress step
+           actions_doing = add (actions_doing, _("Adding all selected external installation sources..."));
+       } else {
+           foreach (string repo_id, repos_to_be_used, {
+               actions_todo = add (actions_todo, sformat (
+                   // TRANSLATORS: progress step
+                   // %1 is replaced with installation source name or URL
+                   _("Add installation source: %1"),
+                   list_of_repos[repo_id, "name"]:repo_id
+               ));
+               actions_doing = add (actions_doing, sformat (
+                   // TRANSLATORS: progress step,
+                   // %1 is replaced with installation source name or URL
+                   _("Adding installation source: %1 ..."),
+                   list_of_repos[repo_id, "name"]:repo_id
+               ));
+           });
+       }
+
+       Progress::New (
+           // TRANSLATORS: dialog caption
+           _("Writing List of External Installation Sources"),
+           " ",
+           size (actions_todo),
+           actions_todo,
+           actions_doing,
+           // TRANSLATORS: dialog help
+           _("<p>Please wait, while the source manager downloads repository-details...</p>")
+       );
+       Wizard::SetTitleIcon ("yast-sw_source");
+
+       if (repos_to_be_deleted != []) {
+           Progress::NextStage();
+           foreach (integer src_id, repos_to_be_deleted, {
+               boolean success = Pkg::SourceDelete (src_id);
+               if (! success) y2error ("Couldn't delete source %1", src_id);
+
+               AddOnProduct::Disintegrate (src_id);
+               // filter it also from the list of Add-Ons
+               AddOnProduct::add_on_products = filter (map <string, any> one_addon, AddOnProduct::add_on_products, {
+                   return (one_addon["media"]:-1 != src_id);
+               });
+           });
+       }
+
+       // One progress stage for all repositories
+       if (at_once) Progress::NextStage();
+
+       foreach (string repo_id, repos_to_be_used, {
+           // If not at once, call one stage per repository
+           if (! at_once) Progress::NextStage();
+           CreateSource (list_of_repos[repo_id, "url"]:"", list_of_repos[repo_id, "path"]:"/");
+       });
+       
+       // Redraw installation wizard
+       if (Stage::initial()) {
+           UpdateWizardSteps();
+       // Store sources
+       } else {
+           Pkg::SourceFinishAll();
+       }
+
+       Progress::Finish();
+       sleep (600);
+
+       return `next;
+    }
+
+    symbol RunMain () {
+       map aliases = $[
+           "read"    : ``( ReadDialog() ),
+           "sources" : ``( SourcesDialog() ),
+           "write"   : ``( WriteDialog() ),
+       ];
+
+       map sequence = $[
+           "ws_start"        : "read",
+           "read"    : $[
+               `next   : "sources",
+               `abort  : `abort,
+           ],
+           "sources" : $[
+               `special_go_back : `back,
+               `next   : "write",
+               `abort  : `abort,
+           ],
+           "write"   : $[
+               `next   : `next,
+               `abort  : `abort,
+           ],
+       ];
+
+       any ret = Sequencer::Run (aliases, sequence);
+       y2milestone ("Sequencer::Run %1", ret);
+
+       return (symbol) ret;
+    }
+
+
+    /***********************/
+    if (Mode::normal()) {
+       Wizard::CreateDialog();
+    }
+
+    symbol client_ret = RunMain();
+
+    if (Mode::normal()) {
+       Wizard::CloseDialog();
+    }
+    /***********************/
+
+    return client_ret;
+}
\ No newline at end of file
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-packager-2.15.44/src/config/productsources.desktop new/yast2-packager-2.15.45/src/config/productsources.desktop
--- old/yast2-packager-2.15.44/src/config/productsources.desktop        1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-packager-2.15.45/src/config/productsources.desktop        2007-07-12 13:08:02.000000000 +0200
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Type=Application
+Categories=Qt;X-SuSE-YaST;X-SuSE-YaST-Software;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=inst_productsources
+
+X-SuSE-YaST-Group=Software
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=
+
+Icon=yast-sw_source
+Exec=/sbin/yast2 inst_productsources
+
+Name=Additional Product Repositories
+GenericName=Download and choose the default repositories from web
+X-KDE-SubstituteUID=true
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-packager-2.15.44/VERSION new/yast2-packager-2.15.45/VERSION
--- old/yast2-packager-2.15.44/VERSION  2007-07-10 10:04:32.000000000 +0200
+++ new/yast2-packager-2.15.45/VERSION  2007-07-12 13:04:27.000000000 +0200
@@ -1 +1 @@
-2.15.44
+2.15.45


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >