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@suse.cz
+
+- 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
%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@suse.cz
+- 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@suse.cz
- 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 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 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 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