Hello community,

here is the log from the commit of package yast2-pkg-bindings for 
openSUSE:Factory checked in at 2012-04-12 09:58:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-pkg-bindings (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-pkg-bindings.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-pkg-bindings", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-pkg-bindings/yast2-pkg-bindings.changes    
2012-01-24 12:24:34.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-pkg-bindings.new/yast2-pkg-bindings.changes   
    2012-04-12 10:00:01.000000000 +0200
@@ -1,0 +2,37 @@
+Wed Apr 11 14:45:19 UTC 2012 - [email protected]
+
+- 2.22.2
+
+-------------------------------------------------------------------
+Wed Apr 11 15:53:52 CEST 2012 - [email protected]
+
+- license update: GPL-2.0
+  Numerous GPL-2.0 files in the package (see e.g. src/Arch.cc)
+
+-------------------------------------------------------------------
+Tue Mar 27 16:56:58 UTC 2012 - [email protected]
+
+- removed libxcrypt-devel from buildrequires (aschnell)
+- dropped build support for openSUSE-11.x
+- 2.22.1
+
+-------------------------------------------------------------------
+Thu Mar  8 08:16:23 UTC 2012 - [email protected]
+
+- added Pkg::ResolvableUpdate() to avoid downgrading resolvables
+  (bnc#751147)
+
+-------------------------------------------------------------------
+Tue Jan  3 16:58:42 UTC 2012 - [email protected]
+
+- check if downloading optional file really succeeded (bnc#736693)
+  (fixes HA add-on installation)
+
+-------------------------------------------------------------------
+Fri Dec  9 12:54:54 UTC 2011 - [email protected]
+
+- fixed downloading optional files - pass the optional flag to
+  libzypp to skip media change callback for optional files
+  (bnc#735340)
+
+-------------------------------------------------------------------

Old:
----
  openSUSE-11.3.diff
  openSUSE-11.4.diff
  yast2-pkg-bindings-2.22.0.tar.bz2

New:
----
  yast2-pkg-bindings-2.22.2.tar.bz2

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

Other differences:
------------------
++++++ yast2-pkg-bindings-devel-doc.spec ++++++
--- /var/tmp/diff_new_pack.S9fj9y/_old  2012-04-12 10:00:02.000000000 +0200
+++ /var/tmp/diff_new_pack.S9fj9y/_new  2012-04-12 10:00:02.000000000 +0200
@@ -18,10 +18,10 @@
 
 Name:           yast2-pkg-bindings-devel-doc
 
-Version:        2.22.0
+Version:        2.22.2
 Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Source0:        yast2-pkg-bindings-2.22.0.tar.bz2
+Source0:        yast2-pkg-bindings-2.22.2.tar.bz2
 Prefix:         %_prefix
 
 # same as in the main package (because we use the same configure.in.in)
@@ -31,7 +31,6 @@
 BuildRequires:  gcc-c++
 BuildRequires:  libgcrypt-devel
 BuildRequires:  libtool
-BuildRequires:  libxcrypt-devel
 BuildRequires:  libxslt
 BuildRequires:  libzypp-devel
 BuildRequires:  perl-XML-Writer

++++++ yast2-pkg-bindings.spec ++++++
--- /var/tmp/diff_new_pack.S9fj9y/_old  2012-04-12 10:00:02.000000000 +0200
+++ /var/tmp/diff_new_pack.S9fj9y/_new  2012-04-12 10:00:02.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-pkg-bindings
-Version:        2.22.0
+Version:        2.22.2
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -29,7 +29,6 @@
 BuildRequires:  gcc-c++
 BuildRequires:  libgcrypt-devel
 BuildRequires:  libtool
-BuildRequires:  libxcrypt-devel
 BuildRequires:  libxslt
 BuildRequires:  libzypp-devel >= 6.10.0
 BuildRequires:  perl-XML-Writer
@@ -44,14 +43,6 @@
 License:        GPL-2.0
 Group:          System/YaST
 
-%if 0%{?suse_version} == 1130
-Patch113:       openSUSE-11.3.diff
-%endif
-
-%if 0%{?suse_version} == 1140
-Patch114:       openSUSE-11.4.diff
-%endif
-
 %description
 This package contains a name space for accessing the package manager
 library in YaST2.
@@ -61,13 +52,6 @@
 # build only the library, ignore documentation (it is in devel-doc package)
 echo "src" > SUBDIRS
 
-%if 0%{?suse_version} == 1130
-%patch113 -p0
-%endif
-%if 0%{?suse_version} == 1140
-%patch114 -p0
-%endif
-
 %build
 %{_prefix}/bin/y2tool y2autoconf
 %{_prefix}/bin/y2tool y2automake

++++++ yast2-pkg-bindings-2.22.0.tar.bz2 -> yast2-pkg-bindings-2.22.2.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-pkg-bindings-2.22.0/VERSION 
new/yast2-pkg-bindings-2.22.2/VERSION
--- old/yast2-pkg-bindings-2.22.0/VERSION       2011-12-06 16:25:32.000000000 
+0100
+++ new/yast2-pkg-bindings-2.22.2/VERSION       2012-04-11 16:45:10.000000000 
+0200
@@ -1 +1 @@
-2.22.0
+2.22.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-pkg-bindings-2.22.0/src/PkgFunctions.h 
new/yast2-pkg-bindings-2.22.2/src/PkgFunctions.h
--- old/yast2-pkg-bindings-2.22.0/src/PkgFunctions.h    2011-09-23 
16:28:20.000000000 +0200
+++ new/yast2-pkg-bindings-2.22.2/src/PkgFunctions.h    2012-03-21 
17:06:22.000000000 +0100
@@ -19,7 +19,7 @@
  */
 
 /*
-   File:       $Id: PkgFunctions.h 66007 2011-09-23 14:28:19Z lslezak $
+   File:       $Id: PkgFunctions.h 67611 2012-03-08 17:32:50Z lslezak $
    Author:     Ladislav Slezák <[email protected]>
    Summary:     Handles Pkg::function (list_of_arguments) calls
    Namespace:   Pkg
@@ -234,6 +234,17 @@
 
       // a helper function to add or remove an upgrade repository
       YCPValue AddRemoveUpgradeRepo(const YCPInteger &repo, bool add);
+      
+      // action for a resolvable
+      enum ResolvableAction
+      {
+        Install,
+        Remove,
+        Update
+      };
+
+      // helper for installing/removing/upgrading a resolvable
+      bool ResolvableUpdateInstallOrDelete(const YCPString& name_r, const 
YCPSymbol& kind_r, ResolvableAction action);
 
     public:
        // general
@@ -694,6 +705,8 @@
        /* TYPEINFO: boolean(string,symbol,integer)*/
        YCPValue ResolvableInstallRepo( const YCPString& name_r, const 
YCPSymbol& kind_r, const YCPInteger& repo_r );
        /* TYPEINFO: boolean(string,symbol)*/
+        YCPValue ResolvableUpdate( const YCPString& name_r, const YCPSymbol& 
kind_r );
+       /* TYPEINFO: boolean(string,symbol)*/
         YCPValue ResolvableRemove( const YCPString& name_r, const YCPSymbol& 
kind_r );
        /* TYPEINFO: boolean(string,symbol,boolean)*/
         YCPValue ResolvableNeutral( const YCPString& name_r, const YCPSymbol& 
kind_r, const YCPBoolean& force_r );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-pkg-bindings-2.22.0/src/Resolvable_Install.cc 
new/yast2-pkg-bindings-2.22.2/src/Resolvable_Install.cc
--- old/yast2-pkg-bindings-2.22.0/src/Resolvable_Install.cc     2011-09-22 
15:13:43.000000000 +0200
+++ new/yast2-pkg-bindings-2.22.2/src/Resolvable_Install.cc     2012-03-21 
17:06:22.000000000 +0100
@@ -19,7 +19,7 @@
  */
 
 /*
-   File:       $Id: Resolvable_Install.cc 57028 2009-04-29 10:58:09Z lslezak $
+   File:       $Id: Resolvable_Install.cc 67611 2012-03-08 17:32:50Z lslezak $
    Author:     Ladislav Slezák <[email protected]>
    Summary:     Install or remove resolvables
    Namespace:   Pkg
@@ -236,7 +236,7 @@
     return YCPBoolean(ret);
 }
 
-bool ResolvableInstallOrDelete(const YCPString& name_r, const YCPSymbol& 
kind_r, bool install)
+bool PkgFunctions::ResolvableUpdateInstallOrDelete(const YCPString& name_r, 
const YCPSymbol& kind_r, ResolvableAction action)
 {
     zypp::Resolvable::Kind kind;
     
@@ -275,9 +275,68 @@
 
     if (s)
     {
-       y2milestone("%s: %s:%s ", install ? "Installing" : "Removing", 
req_kind.c_str(), name.c_str());
-       return install ? s->setToInstall(zypp::ResStatus::APPL_HIGH):
-           s->setToDelete(zypp::ResStatus::APPL_HIGH);
+        if (action == Install)
+        {
+            y2milestone("Installing %s %s ", req_kind.c_str(), name.c_str());
+            return s->setToInstall(zypp::ResStatus::APPL_HIGH);
+        }
+        else if (action == Remove)
+        {
+            y2milestone("Removing %s %s ", req_kind.c_str(), name.c_str());
+           return s->setToDelete(zypp::ResStatus::APPL_HIGH);
+        }
+        else if (action == Update)
+        {
+            y2milestone("Updating %s %s ", req_kind.c_str(), name.c_str());
+            
+            // update candidate
+            zypp::PoolItem update = s->updateCandidateObj();
+            
+            // installed version
+            zypp::PoolItem installed;
+            if (zypp::traits::isPseudoInstalled(s->kind()))
+            {
+                for_(it, s->availableBegin(), s->availableEnd())
+                  // this is OK also for patches - isSatisfied() excludes 
!isRelevant()
+                  if (it->status().isSatisfied()
+                      && (!installed || installed->edition() < 
(*it)->edition()))
+                    installed = *it;
+            }
+            else
+            {
+                installed = s->installedObj();
+            }
+            
+            if (!installed)
+            {
+                y2milestone("%s is not installed, nothing to update", 
name.c_str());
+                return false;
+            }
+            
+            if (!update)
+            {
+                y2milestone("Update for %s is not available, no change", 
name.c_str());
+                return false;
+            }
+            
+            if (update->edition() > installed->edition())
+            {
+                y2milestone("Updating %s from %s.%s to %s.%s", name.c_str(), 
installed->edition().asString().c_str(),
+                    installed->arch().asString().c_str(), 
update->edition().asString().c_str(), update->arch().asString().c_str());
+                return update.status().setToBeInstalled(whoWantsIt);
+            }
+            else
+            {
+                y2milestone("%s %s: installed version (%s) is higher than 
available update (%s), no change",
+                    req_kind.c_str(), name.c_str(), 
installed->edition().asString().c_str(), update->edition().asString().c_str());
+                return false;
+            }
+        }
+        else
+        {
+            y2internal("Unknown resolvable action");
+            return false;
+        }
     }
     else
     {
@@ -298,12 +357,27 @@
 YCPValue
 PkgFunctions::ResolvableInstall( const YCPString& name_r, const YCPSymbol& 
kind_r )
 {
-    // true = install
-    return YCPBoolean(ResolvableInstallOrDelete(name_r, kind_r, true));
+    return YCPBoolean(ResolvableUpdateInstallOrDelete(name_r, kind_r, 
Install));
 }
 
 // ------------------------
 /**
+   @builtin ResolvableUpgrade
+   @short Install all resolvables with selected name and kind
+   @param name_r name of the resolvable 
+   @param kind_r kind of resolvable, can be `product, `patch, `package, 
`srcpackage or `pattern
+   @return boolean true if upgrade candidate was selected, false if the 
highest version is already installed or if there is no upgrade candidate
+ * 
+*/
+YCPValue
+PkgFunctions::ResolvableUpdate( const YCPString& name_r, const YCPSymbol& 
kind_r )
+{
+    return YCPBoolean(ResolvableUpdateInstallOrDelete(name_r, kind_r, Update));
+}
+
+
+// ------------------------
+/**
    @builtin ResolvableRemove
    @short Removes all resolvables with selected name and kind
    @param name_r name of the resolvable
@@ -314,7 +388,7 @@
 PkgFunctions::ResolvableRemove ( const YCPString& name_r, const YCPSymbol& 
kind_r )
 {
     // false = remove
-    return YCPBoolean(ResolvableInstallOrDelete(name_r, kind_r, false));
+    return YCPBoolean(ResolvableUpdateInstallOrDelete(name_r, kind_r, Remove));
 }
 
 // ------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-pkg-bindings-2.22.0/src/Source_Download.cc 
new/yast2-pkg-bindings-2.22.2/src/Source_Download.cc
--- old/yast2-pkg-bindings-2.22.0/src/Source_Download.cc        2011-09-23 
14:49:51.000000000 +0200
+++ new/yast2-pkg-bindings-2.22.2/src/Source_Download.cc        2012-01-03 
18:29:09.000000000 +0100
@@ -19,7 +19,7 @@
  */
 
 /*
-   File:       $Id: Source_Download.cc 65991 2011-09-23 12:49:50Z lslezak $
+   File:       $Id: Source_Download.cc 67090 2012-01-03 17:29:07Z lslezak $
    Author:     Ladislav Slezák <[email protected]>
    Summary:     Functions for downloading files from a repository
    Namespace:   Pkg
@@ -96,8 +96,7 @@
                }
 
                zypp::OnMediaLocation mloc(media_path, mid->value());
-               // the file is never optional for zypp (it cannot tell whether 
an optional file failed)
-               mloc.setOptional(false);
+               mloc.setOptional(optional);
 
                // create the tmpdir in <_download_area>/var/tmp
                zypp::filesystem::TmpDir tmpdir(_download_area / 
zypp::filesystem::TmpDir::defaultLocation());
@@ -144,6 +143,26 @@
 
     if (found)
     {
+       // check if the file really exists
+       struct stat buf;
+       int status = ::stat(path.asString().c_str(), &buf);
+
+       y2debug("File: %s, status: %d", path.asString().c_str(), status);
+
+       if (status != 0)
+       {
+           if (errno == ENOENT)
+           {
+               y2milestone("File not found: %s, download failed", 
path.asString().c_str());
+           }
+           else
+           {
+               y2error("Cannot check status of the downloaded file: %s", 
strerror(errno));
+           }
+
+           return YCPVoid();
+       }
+
        return YCPString(path.asString());
     }
     else

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to