Hello community,

here is the log from the commit of package yast2-packager for openSUSE:Factory
checked in at Thu Sep 1 14:57:08 CEST 2011.



--------
--- yast2-packager/yast2-packager.changes       2011-08-15 13:22:39.000000000 
+0200
+++ /mounts/work_src_done/STABLE/yast2-packager/yast2-packager.changes  
2011-08-31 15:09:34.000000000 +0200
@@ -1,0 +2,29 @@
+Wed Aug 31 12:21:00 UTC 2011 - lsle...@suse.cz
+
+- SpaceCalculation - improved target installation size estimation,
+  consider also filesystem properties (journal size, reserved space)
+  add some (static) non-package files to disk usage, increased
+  some spare size constants (bnc#263275)
+- 2.21.12
+
+-------------------------------------------------------------------
+Wed Aug 31 14:05:48 CEST 2011 - loci...@suse.cz
+
+- Cleaner solution for adjusting repository priority and fixing
+  that now it also works in installation (bnc#714027)
+
+-------------------------------------------------------------------
+Tue Aug 30 14:03:01 UTC 2011 - lsle...@suse.cz
+
+- webpin_package_search - display popup and print error message
+  when HTTP response code is not 200, don't silently ignore errors
+  (bnc#714546)
+
+-------------------------------------------------------------------
+Mon Aug 29 16:15:53 CEST 2011 - loci...@suse.cz
+
+- Implemented possibility to set repository priority while adding
+  by add_on_products.xml (bnc#714027).
+- 2.21.11
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


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

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

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

Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.BBWdn3/_old  2011-09-01 14:55:58.000000000 +0200
+++ /var/tmp/diff_new_pack.BBWdn3/_new  2011-09-01 14:55:58.000000000 +0200
@@ -19,11 +19,11 @@
 
 
 Name:           yast2-packager
-Version:        2.21.10
+Version:        2.21.12
 Release:        1
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Source0:        yast2-packager-2.21.10.tar.bz2
+Source0:        yast2-packager-2.21.12.tar.bz2
 
 Prefix:         /usr
 
@@ -34,8 +34,8 @@
 # HTTP.ycp
 BuildRequires:  yast2-transfer
 
-# Installation summary in PackagesUI::
-BuildRequires:  yast2 >= 2.18.1
+# String::FindMountPoint()
+BuildRequires:  yast2 >= 2.21.13
 
 # Pkg::SetZConfig()
 BuildRequires:  yast2-pkg-bindings >= 2.21.8
@@ -46,8 +46,8 @@
 # Pkg::SetZConfig()
 Requires:       yast2-pkg-bindings >= 2.21.8
 
-# Installation summary in PackagesUI::
-Requires:       yast2 >= 2.18.1
+# String::FindMountPoint()
+Requires:       yast2 >= 2.21.13
 
 # unzipping license file
 Requires:       unzip
@@ -100,7 +100,7 @@
 (webpin) and installing them via OneClickInstall
 
 %prep
-%setup -n yast2-packager-2.21.10
+%setup -n yast2-packager-2.21.12
 
 %build
 %{prefix}/bin/y2tool y2autoconf

++++++ yast2-packager-2.21.10.tar.bz2 -> yast2-packager-2.21.12.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-2.21.10/VERSION 
new/yast2-packager-2.21.12/VERSION
--- old/yast2-packager-2.21.10/VERSION  2011-08-15 13:21:33.000000000 +0200
+++ new/yast2-packager-2.21.12/VERSION  2011-08-31 14:20:55.000000000 +0200
@@ -1 +1 @@
-2.21.10
+2.21.12
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-2.21.10/configure 
new/yast2-packager-2.21.12/configure
--- old/yast2-packager-2.21.10/configure        2011-08-15 13:21:37.000000000 
+0200
+++ new/yast2-packager-2.21.12/configure        2011-08-31 15:06:50.000000000 
+0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for yast2-packager 2.21.10.
+# Generated by GNU Autoconf 2.68 for yast2-packager 2.21.12.
 #
 # Report bugs to <http://bugs.opensuse.org/>.
 #
@@ -559,8 +559,8 @@
 # Identity of this package.
 PACKAGE_NAME='yast2-packager'
 PACKAGE_TARNAME='yast2-packager'
-PACKAGE_VERSION='2.21.10'
-PACKAGE_STRING='yast2-packager 2.21.10'
+PACKAGE_VERSION='2.21.12'
+PACKAGE_STRING='yast2-packager 2.21.12'
 PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
 PACKAGE_URL=''
 
@@ -1229,7 +1229,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures yast2-packager 2.21.10 to adapt to many kinds of 
systems.
+\`configure' configures yast2-packager 2.21.12 to adapt to many kinds of 
systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1300,7 +1300,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of yast2-packager 2.21.10:";;
+     short | recursive ) echo "Configuration of yast2-packager 2.21.12:";;
    esac
   cat <<\_ACEOF
 
@@ -1380,7 +1380,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-yast2-packager configure 2.21.10
+yast2-packager configure 2.21.12
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1397,7 +1397,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by yast2-packager $as_me 2.21.10, which was
+It was created by yast2-packager $as_me 2.21.12, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -2327,7 +2327,7 @@
 
 # Define the identity of the package.
  PACKAGE='yast2-packager'
- VERSION='2.21.10'
+ VERSION='2.21.12'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2449,7 +2449,7 @@
 
 
 
-VERSION="2.21.10"
+VERSION="2.21.12"
 RPMNAME="yast2-packager"
 MAINTAINER="Ladislav Slezak <lsle...@suse.cz>"
 
@@ -3379,7 +3379,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by yast2-packager $as_me 2.21.10, which was
+This file was extended by yast2-packager $as_me 2.21.12, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -3432,7 +3432,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-yast2-packager config.status 2.21.10
+yast2-packager config.status 2.21.12
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-2.21.10/configure.in 
new/yast2-packager-2.21.12/configure.in
--- old/yast2-packager-2.21.10/configure.in     2011-08-15 13:21:34.000000000 
+0200
+++ new/yast2-packager-2.21.12/configure.in     2011-08-31 15:06:48.000000000 
+0200
@@ -3,7 +3,7 @@
 dnl -- This file is generated by y2autoconf 2.18.11 - DO NOT EDIT! --
 dnl    (edit configure.in.in instead)
 
-AC_INIT(yast2-packager, 2.21.10, http://bugs.opensuse.org/, yast2-packager)
+AC_INIT(yast2-packager, 2.21.12, http://bugs.opensuse.org/, yast2-packager)
 dnl Check for presence of file 'RPMNAME'
 AC_CONFIG_SRCDIR([RPMNAME])
 
@@ -18,7 +18,7 @@
 AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
 
 dnl Important YaST2 variables
-VERSION="2.21.10"
+VERSION="2.21.12"
 RPMNAME="yast2-packager"
 MAINTAINER="Ladislav Slezak <lsle...@suse.cz>"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-2.21.10/packager.pot 
new/yast2-packager-2.21.12/packager.pot
--- old/yast2-packager-2.21.10/packager.pot     1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-packager-2.21.12/packager.pot     2008-09-10 10:47:12.000000000 
+0200
@@ -0,0 +1,99 @@
+# translation of packager.po to
+# Copyright (C) YEAR SuSE Linux Products GmbH, Nuernberg
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Andrew Spackman <kiwili...@gmail.com>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: packager\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-08-04 13:54+0200\n"
+"PO-Revision-Date: 2008-08-27 21:38+1200\n"
+"Last-Translator: Andrew Spackman <kiwili...@gmail.com>\n"
+"Language-Team:  <e...@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#: src/clients/inst_packages.ycp:76
+msgid ""
+"<p>\n"
+"\t\t This dialog allows you to define this system's tasks and what software 
to install.\n"
+"\t\t Available tasks and software for this system are shown by category in 
the left\n"
+"\t\t column.  To view a description for an item, select it in the list.\n"
+"\t\t </p>"
+msgstr ""
+"<p>\n"
+"\t\t This dialog allows you to define this system's tasks and the software 
that has to be installed.\n"
+"\t\t Available tasks and software for this system are shown by category in 
the left\n"
+"\t\t column. To view a description for an item, select it in the list.\n"
+"\t\t </p>"
+
+#. TRANSLATORS: dialog help
+#: src/clients/inst_productsources.ycp:600
+msgid ""
+"<p>Please wait while the packager is being initialized\n"
+"and the list of servers dowloaded from Web.</p>\n"
+msgstr ""
+"<p>Please wait while the packager is being initialized\n"
+"and the list of servers downloaded from the Web.</p>\n"
+
+#. help, continued
+#: src/clients/repositories.ycp:486
+msgid ""
+"<p>\n"
+"<b>Synchronize Changes with ZENworks</b> will call <tt>rug</tt>\n"
+"to also perform the changes in that package management system.</p>\n"
+msgstr ""
+"<p>\n"
+"<b>Synchronize Changes with ZENworks</b> will also call <tt>rug</tt>\n"
+"to perform the changes in that package management system.</p>\n"
+
+#: src/clients/webpin_package_search.ycp:223
+msgid ""
+"<p><big><b>Security</b></big><br>\n"
+"The software found is often not part of the distribution itself and the level 
of trust\n"
+"depends on yourself. We do not take any responsibilities for installing\n"
+"such software.</p>"
+msgstr ""
+"<p><big><b>Security</b></big><br>\n"
+"The software found is often not part of the distribution itself and the level 
of trust\n"
+"depends on yourself. We do not take any responsibility for installing\n"
+"such software.</p>"
+
+#. help text - media check 2/8
+#: src/include/checkmedia/ui.ycp:279
+msgid ""
+"<P>When you have a problem with\n"
+"the installation and are using a CD or DVD installation medium, you should 
check\n"
+"whether the medium is broken.</P>\n"
+msgstr ""
+"<P>When you have a problem with\n"
+"the installation and you are using a CD or DVD installation medium, you 
should check\n"
+"whether the medium is broken.</P>\n"
+
+#: src/include/checkmedia/ui.ycp:432
+msgid ""
+"The medium does not contain MD5 checksum.\n"
+"The content of the medium cannot be verified.\n"
+"\n"
+"Only readability of the medium will be checked."
+msgstr ""
+"The medium does not contain a MD5 checksum.\n"
+"The content of the medium cannot be verified.\n"
+"\n"
+"Only readability of the medium will be checked."
+
+#. (see bnc#178357 why these numbers)
+#. translators: help text for software proposal
+#: src/modules/Packages.ycp:302
+msgid "<P>The propsal contains total size of files which will be installed to 
the system. However, the system will contain some other files (temporary and 
working files) so the used space will be slighltly larger than the proposed 
value. Therefore it is a good idea to have at least 25% (or 300MB) free space 
before starting the installation.</P>"
+msgstr "<P>The propsal reports the total size of files which will be installed 
to the system. However, the system will contain some other files (temporary and 
working files) so the used space will be slighltly larger than the proposed 
value. Therefore it is a good idea to have at least 25% (or 300MB) free space 
before starting the installation.</P>"
+
+#. help text for software proposal
+#: src/modules/Packages.ycp:304
+msgid "<P>The total size to download is size of packages which will be 
downloaded from remote (network) repositories. This value is important when the 
connection is slow or when there is a data limit for downloading.</P>"
+msgstr ""
+"<P>The total 'size to download' is the size of the packages which will be 
downloaded from remote (network) repositories.\n"
+"  This value is important when the connection is slow or when there is a data 
limit for downloading.</P>"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-2.21.10/src/clients/webpin_package_search.ycp 
new/yast2-packager-2.21.12/src/clients/webpin_package_search.ycp
--- old/yast2-packager-2.21.10/src/clients/webpin_package_search.ycp    
2011-08-15 13:21:32.000000000 +0200
+++ new/yast2-packager-2.21.12/src/clients/webpin_package_search.ycp    
2011-08-30 16:11:32.000000000 +0200
@@ -4,7 +4,7 @@
  * Authors:    Katarina Machalkova <kmachalk...@suse.cz>
  *             Lukas Ocilka <loci...@suse.cz>
  *
- * $Id: webpin_package_search.ycp 65153 2011-08-03 08:50:57Z lslezak $
+ * $Id: webpin_package_search.ycp 65454 2011-08-30 14:11:31Z lslezak $
  *
  * This client provides UI for searching for packages
  * via Webpin XML.
@@ -344,7 +344,10 @@
                Popup::ClearFeedback();
                PopulatePackageList( search_results );
 
-               if ( search_results == $[] || search_results == nil )
+               if (search_results == nil)
+                   // error message
+                   UI::ChangeWidget(`id("description"), `Value, 
_("<p><b>Search failed</b></p>"));
+               else if (search_results == $[])
                    UI::ChangeWidget(`id("description"), `Value, _("<p><b>No 
packages matching entered criteria were found</b></p>"));
                else
                    CreatePackageDescription();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-packager-2.21.10/src/modules/AddOnProduct.ycp 
new/yast2-packager-2.21.12/src/modules/AddOnProduct.ycp
--- old/yast2-packager-2.21.10/src/modules/AddOnProduct.ycp     2011-08-15 
13:21:32.000000000 +0200
+++ new/yast2-packager-2.21.12/src/modules/AddOnProduct.ycp     2011-08-31 
14:20:55.000000000 +0200
@@ -1314,6 +1314,11 @@
  *                             default is 'false' (optional)
  *                     -->
  *                     <selected config:type="boolean">true</selected>
+ *                     <!--
+ *                             Defines priority of the newly added repository 
(optional).
+ *                             Libzypp uses its default priority if not set.
+ *                     -->
+ *                     <priority config:type="integer">20</priority>
  *             </product_item>
  *             <product_item>
  *                     ...
@@ -1355,41 +1360,56 @@
            return false;
        }
 
+       integer repo_id = -1;
+
        y2milestone ("Adding products: %1", add_products);
        foreach (map one_product, add_products, {
            string url = one_product["url"]:"";
            string pth = one_product["path"]:"";
+           integer priority = one_product["priority"]:-1;
+
+           map <string, any> new_repo = $[ "enabled" : true, "base_urls" : 
[url], "prod_dir" : pth ];
+           // BNC #714027: Possibility to adjust repository priority (usually 
higher)
+           if (priority > -1) new_repo["priority"] = priority;
 
-           y2milestone ("Adding Repository: %1 %2", url, pth);
-           integer src = Pkg::SourceCreate (url, pth);
+           y2milestone ("Adding Repository: %1", new_repo);
+           repo_id = Pkg::RepositoryAdd (new_repo);
 
-           if (src == nil || src < 0) {
+           if (repo_id == nil || repo_id < 0) {
                y2error ("Unable to add product: %1", url);
                // TRANSLATORS: error message, %1 is replaced with product URL
                Report::Error (sformat (_("Unable to add product %1."), url));
                return false;
            }
 
-           if (! AcceptedLicenseAndInfoFile (src)) {
+           // download metadata, build repo cache
+           Pkg::SourceRefreshNow (repo_id);
+           // load resolvables to zypp pool
+           Pkg::SourceLoad();
+
+           if (! AcceptedLicenseAndInfoFile (repo_id)) {
                y2warning ("License not accepted, delete the repository");
-               Pkg::SourceDelete (src);
+               Pkg::SourceDelete (repo_id);
                return false;
            }
-           Integrate (src);
+           Integrate (repo_id);
 
            // adding the product to the list of products (BNC #269625)
-           map <string, any> prod = (map <string, any>) Pkg::SourceProductData 
(src);
-           y2milestone ("Repository (%1) product data: %2", src, prod);
+           map <string, any> prod = (map <string, any>) Pkg::SourceProductData 
(repo_id);
+           y2milestone ("Repository (%1) product data: %2", repo_id, prod);
 
-           InstallProductsFromRepository (one_product["install_products"]:[], 
src);
+           InstallProductsFromRepository (one_product["install_products"]:[], 
repo_id);
 
-           AddOnProduct::add_on_products = add (AddOnProduct::add_on_products, 
$[
-               "media"                 : src,
+           map <string, any> new_add_on_product = $[
+               "media"                 : repo_id,
                "product"               : 
one_product["name"]:prod["label"]:prod["productname"]:_("Unknown Product"),
                "autoyast_product"      : 
prod["productname"]:one_product["name"]:_("Unknown Product"),
                "media_url"             : url,
                "product_dir"           : pth,
-           ]);
+           ];
+           if (priority > -1) new_add_on_product["priority"] = priority;
+
+           AddOnProduct::add_on_products = add (AddOnProduct::add_on_products, 
new_add_on_product);
        });
     });
 
@@ -1451,8 +1471,11 @@
            string pth = prod["product_dir"]:"/";
            integer src = Pkg::SourceCreate (media, pth);
            if (src != -1) {
-               if (prod["product"]:"" != "")
-                   Pkg::SourceEditSet ([$["SrcId":src, 
"name":prod["product"]:""]]);
+               if (prod["product"]:"" != "") {
+                   map <string, any> repo = $["SrcId":src, 
"name":prod["product"]:""];
+                   if (prod["priority"]:-1 > -1) repo["priority"] = 
prod["priority"]:-1;
+                   Pkg::SourceEditSet ([repo]);
+               }
                mode_config_sources = add (mode_config_sources, src);
            }
        });
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-2.21.10/src/modules/SpaceCalculation.ycp 
new/yast2-packager-2.21.12/src/modules/SpaceCalculation.ycp
--- old/yast2-packager-2.21.10/src/modules/SpaceCalculation.ycp 2011-08-15 
13:21:32.000000000 +0200
+++ new/yast2-packager-2.21.12/src/modules/SpaceCalculation.ycp 2011-08-31 
14:55:08.000000000 +0200
@@ -10,7 +10,7 @@
  *                     on Installation::sourcedir
  *
  *
- * $Id: SpaceCalculation.ycp 62829 2010-11-11 17:35:05Z lslezak $
+ * $Id: SpaceCalculation.ycp 65471 2011-08-31 12:55:07Z lslezak $
  */
 
 {
@@ -93,7 +93,7 @@
 
        list<map<string, string> > partition = [];
        // the sizes are in kB
-       integer min_spare = 1 * 1024;           // 1 MB
+       integer min_spare = 10 * 1024;          // 10 MB
        integer max_spare = 1024 * 1024;        // 1 GB
 
        string target = Installation::destdir;
@@ -221,6 +221,295 @@
        return part_input;
     };
 
+    // return default ext3/4 journal size (in B) for target partition size
+    integer DefaultExtJournalSize(map part)
+    {
+       if (part["used_fs"]:`unknown == `ext2)
+       {
+           y2milestone("No journal on ext2");
+           return 0;
+       }
+
+       integer ret = 0;
+
+       integer part_size = 1024 * part["size_k"]:0;
+       // default block size is 4k
+       integer bs = tointeger(part["fs_options","opt_blocksize", 
"option_value"]:"4096");
+       integer blocks = part_size / bs;
+
+       y2milestone("Partition %1: %2 blocks (block size: %3)", 
part["name"]:"", blocks, bs);
+
+       // values extracted from ext2fs_default_journal_size() function in 
e2fsprogs sources
+       if (blocks < 2048)
+       {
+           ret = 0;
+       }
+       else if (blocks < 32768)
+       {
+           ret = 1024;
+       }
+       else if (blocks < 256*1024)
+       {
+           ret = 4096;
+       }
+       else if (blocks < 512*1024)
+       {
+           ret = 8192;
+       }
+       else if (blocks < 1024*1024)
+       {
+           ret = 16384;
+       }
+       else
+       {
+           // maximum journal size
+           ret = 32768;
+       }
+
+       // converts blocks to bytes
+       ret = ret * bs;
+
+       y2milestone("Default journal size: %1kB", ret / 1024);
+
+
+       return ret;
+    }
+
+    integer ExtJournalSize(map part)
+    {
+       if (part["used_fs"]:`unknown == `ext2)
+       {
+           y2milestone("No journal on ext2");
+           return 0;
+       }
+
+       integer ret = 0;
+       // no journal
+       if (haskey(part["fs_options"]:$[], "no_journal"))
+       {
+           y2milestone("Partition %1 has disabled journal", part["name"]:"");
+       }
+       // default journal size for ext3/4
+       else
+       {
+           y2milestone("Using default journal size for %1", part["name"]:"");
+           ret = DefaultExtJournalSize(part);
+       }
+       // Note: custom journal size cannot be entered in the partitioner
+
+       y2milestone("Journal size for %1: %2kB", part["name"]:"", ret / 1024);
+
+       return ret;
+    }
+
+    integer XfsJournalSize(map part)
+    {
+       integer part_size = 1024 * part["size_k"]:0;
+       integer mb = 1 << 20;
+       integer gb = 1 << 30;
+
+       // the default log size to fs size ratio is 1:2048
+       // (the value is then adjusted according to many other fs parameters,
+       // we take just the simple approach here, it should be sufficient)
+       integer ret = part_size / 2048;
+
+       // check min and max limits
+       integer min_log_size = 10 * mb;
+       integer max_log_size = 2 * gb;
+
+       if (ret < min_log_size)
+       {
+           ret = min_log_size;
+       }
+       else if (ret > max_log_size)
+       {
+           ret = max_log_size;
+       }
+
+       y2milestone("Estimated journal size for XFS partition %1kB: %2kB", 
part_size / 1024, ret / 1024);
+
+       return ret;
+    }
+
+    integer ReiserJournalSize(map part)
+    {
+       // the default is 8193 of 4k blocks (max = 32749, min = 513 blocks)
+       integer ret = 8193 * 4096;
+
+       y2milestone("Default Reiser journal size: %1kB", ret / 1024); 
+
+       return ret;
+    }
+
+    integer DefaultJfsJournalSize(integer part_size)
+    {
+       // the default is 0.4% rounded to megabytes, 128MB max.
+       integer ret = part_size >> 8;   // 0.4% ~= 1/256
+       integer max = 128 * (1 << 20);  // 128 MB
+
+       ret  = ((ret + (1 << 20) - 1) >> 20) << 20;
+
+       if (ret > max)
+       {
+           ret = max;
+       }
+
+       y2milestone("Default JFS journal size: %1MB", ret >> 20);
+
+       return ret;
+    }
+
+    integer JfsJournalSize(map part)
+    {
+       // log size (in MB)
+       integer log_size = tointeger(part["fs_options","opt_log_size", 
"option_value"]:"0");
+
+       if (log_size > 0)
+       {
+           // convert to bytes
+           log_size = log_size * (1 << 20);
+       }
+       else
+       {
+           log_size = DefaultJfsJournalSize(1024 * part["size_k"]:0);
+       }
+
+       y2milestone("Jfs journal size: %1MB", log_size >> 20);
+
+       return log_size;
+    }
+
+    list<map> EstimateTargetUsage(list<map> parts)
+    {
+       y2milestone("EstimateTargetUsage(%1)", parts);
+       integer mb = 1 << 10; // sizes are in kB, 1MB is 1024 kB
+
+       // invalid or empty input
+       if (parts == nil || size(parts) == 0)
+       {
+           y2error("Invalid input: %1", parts);
+           return [];
+       }
+
+       // the numbers are from openSUSE-11.4 default KDE installation
+       map<string, integer> used_mapping = $[
+           "/var/lib/rpm"      : 42 * mb,      // RPM database
+           "/var/log"          : 14 * mb,      // system logs (YaST logs have 
~12MB)
+           "/var/adm/backup"   : 10 * mb,      // backups
+           "/var/cache/zypp"   : 38 * mb,      // zypp metadata cache after 
refresh (with OSS + update repos)
+           "/etc"              :  2 * mb,      // various /etc config files 
not belonging to any package
+           "/usr/share"        :  1 * mb,      // some files created by 
postinstall scripts
+           "/boot/initrd"      : 11 * mb       // depends on HW but better 
than nothing
+       ];
+
+       y2milestone("Adding target size mapping: %1", used_mapping);
+
+       list<string> mount_points = [];
+
+       // convert list to map indexed by mount point
+       map<string, map> mounts = listmap(map part, parts, {
+               mount_points = add(mount_points, part["name"]:"");
+               return $[ part["name"]:"" : part ];
+           }
+       );
+
+
+       foreach(string dir, integer used, used_mapping, {
+               string mounted = String::FindMountPoint(dir, mount_points);
+               y2milestone("Dir %1 is mounted on %2", dir, mounted);
+
+               map part = mounts[mounted]:$[];
+
+               if (part != $[])
+               {
+                   integer curr_used = part["used"]:0;
+                   y2milestone("Adding %1kB to %2kB currently used", used, 
curr_used);
+                   curr_used = curr_used + used;
+
+                   part["used"] = curr_used;
+                   part["free"] = part["free"]:0 - used;
+
+                   mounts[mounted] = part;
+               }
+               else
+               {
+                   y2warning("Cannot find partition for mount point %1, 
ignoring it", mounted);
+               }
+           }
+       );
+
+       // convert back to list
+       list<map> ret = maplist(string dir, map part, mounts, {return part;});
+
+       y2milestone("EstimateTargetUsage() result: %1", ret);
+
+       return ret;
+    }
+
+    // is the filesystem one of Ext2/3/4?
+    boolean ExtFs(symbol fs)
+    {
+       return fs == `ext2 || fs == `ext3 || fs == `ext4;
+    }
+
+    // return estimated fs overhead
+    // (the difference between partition size and reported fs blocks)
+    integer EstimateFsOverhead(map part)
+    {
+       integer fs_size = 1024 * part["size_k"]:0;
+       symbol fs = part["used_fs"]:`unknown;
+
+       integer ret = 0;
+
+       if (ExtFs(fs))
+       {
+           // ext2/3/4 overhead is about 1.6% according to my test (8GB 
partition)
+           ret = fs_size * 16 / 1000;
+           y2milestone("Estimated Ext2/3/4 overhead: %1kB", ret);
+       }
+       else if (fs == `xfs)
+       {
+           // xfs overhead is about 0.1%
+           ret = fs_size / 1000;
+           y2milestone("Estimated XFS overhead: %1kB", ret);
+       }
+       else if (fs == `jfs)
+       {
+           // jfs overhead is about 0.3%
+           ret = fs_size * 3 / 1000;
+           y2milestone("Estimated JFS overhead: %1kB", ret);
+       }
+       // reiser and btrfs have negligible overhead, just ignore it
+
+       return ret;
+    }
+
+    // return reserved space for root user (in bytes)
+    integer ReservedSpace(map part)
+    {
+       // read the percentage
+       string option = part["fs_options", "opt_reserved_blocks", 
"option_value"]:"";
+       integer ret = 0;
+
+       if (option != nil && option != "")
+       {
+           float percent = tofloat(option);
+
+           if (percent > 0.0)
+           {
+               // convert to absolute value
+               integer fs_size = part["size_k"]:0;
+               ret = tointeger(fs_size / 100 * percent);
+           }
+       }
+
+       if (ret > 0)
+       {
+           y2milestone("Partition %1: reserved space: %2%% (%3kB)", 
part["name"]:"", option, ret);
+       }
+
+       return ret * 1024;
+    }
 
     /*
      * Define a macro that transforms information about all partitions ( from
@@ -286,7 +575,7 @@
        }
 
        list<map> target_partitions = [];
-       integer min_spare       = 5 * 1024 * 1024; // minimum free space ( 5 MB 
)
+       integer min_spare       = 20 * 1024 * 1024; // minimum free space ( 20 
MB )
 
        foreach( string disk, map diskinfo, targets,
                 ``{
@@ -376,6 +665,56 @@
                                    continue;
                                }
                            }
+                           else
+                           // for formatted partitions estimate free system 
size
+                           {
+                               // compute fs overhead
+                               used = EstimateFsOverhead(part);
+
+                               if (used > 0)
+                               {
+                                   y2milestone("Partition %1: assuming fs 
overhead: %2kB", part["device"]:"", used / 1024);
+                               }
+
+                               // journal size
+                               integer js = 0;
+
+                               if (ExtFs(used_fs))
+                               {
+                                   js = ExtJournalSize(part);
+                                   integer reserved = ReservedSpace(part);
+
+                                   if (reserved > 0)
+                                   {
+                                       used = used + reserved;
+                                   }
+                               }
+                               else if (used_fs == `xfs)
+                               {
+                                   js = XfsJournalSize(part);
+                               }
+                               else if (used_fs == `reiser)
+                               {
+                                   js = ReiserJournalSize(part);
+                               }
+                               else if (used_fs == `jfs)
+                               {
+                                   js = JfsJournalSize(part);
+                               }
+                               else
+                               {
+                                   y2warning("Unknown journal size for 
filesystem: %1", used_fs);
+                               }
+
+                               if (js > 0)
+                               {
+                                   y2milestone("Partition %1: assuming journal 
size: %2kB", part["device"]:"", js / 1024);
+                                   used = used + js;
+                               }
+
+                               // decrease free size
+                               free_size = free_size - used;
+                           }
 
                            // convert into kB for TargetInitDU
                            free_size = free_size / 1024;
@@ -409,6 +748,9 @@
            } ); // foreach (`part)
        } ); // foreach (`disk)
 
+       // add estimated size occupied by non-package files
+       target_partitions = EstimateTargetUsage(target_partitions);
+
        y2milestone( "get_partition_info: part %1", target_partitions );
        Pkg::TargetInitDU (target_partitions);
 
@@ -440,7 +782,7 @@
        }
        else if ( Mode::update () )
        {
-           partition = EvaluateFreeSpace ( 5 ); // 5% free spare for 
update/upgrade
+           partition = EvaluateFreeSpace ( 15 ); // 15% free spare for 
update/upgrade
        }
        else if ( Mode::normal () )
        {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-2.21.10/src/modules/WebpinPackageSearch.ycp 
new/yast2-packager-2.21.12/src/modules/WebpinPackageSearch.ycp
--- old/yast2-packager-2.21.10/src/modules/WebpinPackageSearch.ycp      
2011-08-15 13:21:32.000000000 +0200
+++ new/yast2-packager-2.21.12/src/modules/WebpinPackageSearch.ycp      
2011-08-30 15:59:41.000000000 +0200
@@ -25,6 +25,7 @@
 import "URL";
 import "XML";
 import "Arch";
+import "Report";
 
 string temporary_file = Directory::tmpdir + "/package_search_webpin.xml";
 
@@ -359,6 +360,8 @@
     // is full of error messages - we should not let anyxml agent parse those
     if ( response["code"]:0 != 200 ) {
        y2error ("Cannot retrieve search results from the server");
+       // %1 is HTTP error code like 404 or 503
+       Report::Error(sformat(_("Search failed.\nRemote server returned error 
code %1"), response["code"]:0));
        return nil;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-2.21.10/testsuite/tests/SpaceCalculation.out 
new/yast2-packager-2.21.12/testsuite/tests/SpaceCalculation.out
--- old/yast2-packager-2.21.10/testsuite/tests/SpaceCalculation.out     
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-packager-2.21.12/testsuite/tests/SpaceCalculation.out     
2011-08-31 14:44:52.000000000 +0200
@@ -0,0 +1,42 @@
+Read   .target.tmpdir "/tmp"
+Dump    ----- Journal size tests ----- 
+Dump   Ext2/3/4 journal size tests
+Return 0
+Return 134217728
+Return 134217728
+Return 0
+Return 67108864
+Return 33554432
+Return 0
+Dump   ReiserFS journal size tests
+Return 33558528
+Dump   XFS journal size tests
+Return 10485760
+Return 26214400
+Return 2147483648
+Dump   JFS journal size tests
+Return 20971520
+Return 22020096
+Return 134217728
+Return 10485760
+Dump    ----- Extfs reserved space tests ----- 
+Return 0
+Return 0
+Return 2684354560
+Return 6710886400
+Dump    ----- Fs overhead tests ----- 
+Return 85899345
+Return 85899345
+Return 85899345
+Return 5368709
+Return 16106127
+Return 0
+Return 0
+Dump    ----- Target usage tests ----- 
+Log    Invalid input: nil
+Return []
+Log    Invalid input: []
+Return []
+Return [$["free":9879168, "name":"/", "used":120832]]
+Return [$["free":9879168, "name":"/", "used":120832], $["free":1000000, 
"name":"/home", "used":0]]
+Return [$["free":9891456, "name":"/", "used":108544], $["free":988736, 
"name":"/boot", "used":11264], $["free":998976, "name":"/usr", "used":1024]]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-packager-2.21.10/testsuite/tests/SpaceCalculation.ycp 
new/yast2-packager-2.21.12/testsuite/tests/SpaceCalculation.ycp
--- old/yast2-packager-2.21.10/testsuite/tests/SpaceCalculation.ycp     
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-packager-2.21.12/testsuite/tests/SpaceCalculation.ycp     
2011-08-31 14:45:38.000000000 +0200
@@ -0,0 +1,178 @@
+/**
+ * Testsuite for SpaceCalculation.ycp module
+ *
+ */
+
+{
+
+include "testsuite.ycp";
+map READ = $[
+  "target" : $[
+    "tmpdir" : "/tmp"
+  ]
+];
+TESTSUITE_INIT ([READ], nil);
+
+import "SpaceCalculation";
+
+// size units - multiplies of kB blocks
+integer mb = 1 << 10;
+integer gb = 1 << 20;
+integer tb = 1 << 30;
+
+map part = $[
+    // 5GB
+    "size_k"   : 5 * gb,
+    "used_fs" : `ext2,
+    "name" : "sda1"
+];
+
+DUMP(" ----- Journal size tests ----- ");
+DUMP("Ext2/3/4 journal size tests");
+
+// ext2 => no journal => 0
+TEST(``(SpaceCalculation::ExtJournalSize(part)), [], nil);
+
+// 128MB
+part["used_fs"] = `ext3;
+TEST(``(SpaceCalculation::ExtJournalSize(part)), [], nil);
+
+// 128MB
+part["used_fs"] = `ext4;
+TEST(``(SpaceCalculation::ExtJournalSize(part)), [], nil);
+
+// 2 MB is too small => 0
+part["size_k"] = 2 * mb;
+TEST(``(SpaceCalculation::ExtJournalSize(part)), [], nil);
+
+// 2GB => 64MB
+part["size_k"] = 2 * gb;
+TEST(``(SpaceCalculation::ExtJournalSize(part)), [], nil);
+
+// 2GB but 1k blocks => 32MB
+part["fs_options"] = $["opt_blocksize" : $[ "option_value" : "1024" ]];
+TEST(``(SpaceCalculation::ExtJournalSize(part)), [], nil);
+
+// no journal option => 0
+part["fs_options"] = $["no_journal" : $[ "option_value" : true ]];
+TEST(``(SpaceCalculation::ExtJournalSize(part)), [], nil);
+
+
+DUMP("ReiserFS journal size tests");
+
+part["fs_options"] = $[];
+part["used_fs"] = `reiser;
+
+// the default is 32MB + 4kB regardeless fs size
+TEST(``(SpaceCalculation::ReiserJournalSize(part)), [], nil);
+
+
+DUMP("XFS journal size tests");
+
+part["used_fs"] = `xfs;
+
+// too small => 10 MB min size
+TEST(``(SpaceCalculation::XfsJournalSize(part)), [], nil);
+
+// medium size => 26MB
+part["size_k"] = 50 * gb;
+TEST(``(SpaceCalculation::XfsJournalSize(part)), [], nil);
+
+// too large => 2GB max size
+part["size_k"] = 5 * tb;
+TEST(``(SpaceCalculation::XfsJournalSize(part)), [], nil);
+
+
+
+DUMP("JFS journal size tests");
+
+part["used_fs"] = `jfs;
+
+// medium size
+part["size_k"] = 5 * gb;
+TEST(``(SpaceCalculation::JfsJournalSize(part)), [], nil);
+
+// medium size, add few kB more so it's rounded one MB up
+part["size_k"] = (5 * gb) + 5;
+TEST(``(SpaceCalculation::JfsJournalSize(part)), [], nil);
+
+// too large => 128MB max size
+part["size_k"] = 50 * gb;
+TEST(``(SpaceCalculation::JfsJournalSize(part)), [], nil);
+
+// user defined size (in MB)
+part["fs_options"] = $["opt_log_size" : $[ "option_value" : "10" ]];
+TEST(``(SpaceCalculation::JfsJournalSize(part)), [], nil);
+part["fs_options"] = $[];
+
+DUMP(" ----- Extfs reserved space tests ----- ");
+
+// no reserved space
+TEST(``(SpaceCalculation::ReservedSpace(part)), [], nil);
+
+// 0%
+part["fs_options"] = $["opt_reserved_blocks" : $[ "option_value" : "0.0" ]];
+TEST(``(SpaceCalculation::ReservedSpace(part)), [], nil);
+
+// 5% of 50GB => 2.5GB
+part["fs_options"] = $["opt_reserved_blocks" : $[ "option_value" : "5.0" ]];
+TEST(``(SpaceCalculation::ReservedSpace(part)), [], nil);
+
+// 12.50% of 50GB => 6.25GB
+part["fs_options"] = $["opt_reserved_blocks" : $[ "option_value" : "12.50" ]];
+TEST(``(SpaceCalculation::ReservedSpace(part)), [], nil);
+
+DUMP(" ----- Fs overhead tests ----- ");
+
+// 5GB partition
+part["size_k"] = 5 * gb;
+
+// ext2
+part["used_fs"] = `ext2;
+TEST(``(SpaceCalculation::EstimateFsOverhead(part)), [], nil);
+
+// ext3
+part["used_fs"] = `ext3;
+TEST(``(SpaceCalculation::EstimateFsOverhead(part)), [], nil);
+
+// ext4
+part["used_fs"] = `ext4;
+TEST(``(SpaceCalculation::EstimateFsOverhead(part)), [], nil);
+
+// xfs
+part["used_fs"] = `xfs;
+TEST(``(SpaceCalculation::EstimateFsOverhead(part)), [], nil);
+
+// jfs
+part["used_fs"] = `jfs;
+TEST(``(SpaceCalculation::EstimateFsOverhead(part)), [], nil);
+
+// reiser
+part["used_fs"] = `reiser;
+TEST(``(SpaceCalculation::EstimateFsOverhead(part)), [], nil);
+
+// btrfs
+part["used_fs"] = `btrfs;
+TEST(``(SpaceCalculation::EstimateFsOverhead(part)), [], nil);
+
+
+
+DUMP(" ----- Target usage tests ----- ");
+
+// test invalid input
+TEST(``(SpaceCalculation::EstimateTargetUsage(nil)), [], nil);
+TEST(``(SpaceCalculation::EstimateTargetUsage([])), [], nil);
+
+// single partition
+TEST(``(SpaceCalculation::EstimateTargetUsage([$["name":"/", "used":0, 
"free":10000000]])), [], nil);
+
+// multiple partitions, separate /home (nothing to install)
+TEST(``(SpaceCalculation::EstimateTargetUsage([$["name":"/", "used":0, 
"free":10000000],
+    $["name":"/home", "used":0, "free":1000000]])), [], nil);
+
+// multiple partitions
+TEST(``(SpaceCalculation::EstimateTargetUsage([$["name":"/", "used":0, 
"free":10000000],
+    $["name":"/boot", "used":0, "free":1000000],
+    $["name":"/usr", "used":0, "free":1000000]])), [], nil);
+
+}


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



Remember to have fun...

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to