Mailinglist Archive: opensuse-commit (2092 mails)

< Previous Next >
commit yast2-pkg-bindings
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Mon, 06 Aug 2007 18:30:36 +0200
  • Message-id: <20070806163036.B87B6678331@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package yast2-pkg-bindings
checked in at Mon Aug 6 18:30:36 CEST 2007.

--------
--- yast2-pkg-bindings/yast2-pkg-bindings.changes       2007-08-03 12:31:44.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-pkg-bindings/yast2-pkg-bindings.changes  2007-08-06 16:54:33.512694000 +0200
@@ -1,0 +2,10 @@
+Mon Aug  6 16:51:58 CEST 2007 - lslezak@xxxxxxx
+
+- mount repositories in readonly mode (FATE #302347)
+- fixed Pkg::RepositoryProbe() - now it accepts two arguments
+  (URL and product directory)
+- Pkg::ResolvableProperties() - returns type of product (key "TYPE"
+  in SUSEtags content file)
+- 2.15.41
+
+-------------------------------------------------------------------

Old:
----
  yast2-pkg-bindings-2.15.40.tar.bz2

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

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

Other differences:
------------------
++++++ yast2-pkg-bindings-devel-doc.spec ++++++
--- /var/tmp/diff_new_pack.ly1789/_old  2007-08-06 18:29:41.000000000 +0200
+++ /var/tmp/diff_new_pack.ly1789/_new  2007-08-06 18:29:41.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package yast2-pkg-bindings-devel-doc (Version 2.15.40)
+# spec file for package yast2-pkg-bindings-devel-doc (Version 2.15.41)
 #
 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # This file and all modifications and additions to the pristine
@@ -11,18 +11,18 @@
 # norootforbuild
 
 Name:           yast2-pkg-bindings-devel-doc
-Version:        2.15.40
+Version:        2.15.41
 Release:        1
 License:        GPL v2 or later
 Group:          Documentation/HTML
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Source0:        yast2-pkg-bindings-2.15.40.tar.bz2
+Source0:        yast2-pkg-bindings-2.15.41.tar.bz2
 prefix:                /usr
 # same as in the main package (because we use the same configure.in.in)
 BuildRequires:  blocxx-devel boost boost-devel dbus-1-devel docbook-xsl-stylesheets doxygen gcc-c++ hal-devel libgcrypt-devel libxcrypt-devel libxslt libzypp libzypp-devel perl-XML-Writer rpm-devel sgml-skel yast2-core-devel yast2-devtools
 Buildarch: noarch
 Requires:       yast2-pkg-bindings = %{version}
-Summary:        Documentation for yast2-pkg-bindings package
+Summary:        YaST2 - Documentation for yast2-pkg-bindings package
 Group:          Documentation/HTML
 
 %description
@@ -37,7 +37,7 @@
     Ladislav SlezŠk <lslezak@xxxxxxxxxx>
 
 %prep
-%setup -n yast2-pkg-bindings-2.15.40
+%setup -n yast2-pkg-bindings-2.15.41
 # build only documentation, ignore all other directories
 echo "doc" > SUBDIRS
 

++++++ yast2-pkg-bindings.spec ++++++
--- /var/tmp/diff_new_pack.ly1789/_old  2007-08-06 18:29:41.000000000 +0200
+++ /var/tmp/diff_new_pack.ly1789/_new  2007-08-06 18:29:41.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package yast2-pkg-bindings (Version 2.15.40)
+# spec file for package yast2-pkg-bindings (Version 2.15.41)
 #
 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # This file and all modifications and additions to the pristine
@@ -11,18 +11,18 @@
 # norootforbuild
 
 Name:           yast2-pkg-bindings
-Version:        2.15.40
+Version:        2.15.41
 Release:        1
 License:        GPL v2 or later
 Group:          System/YaST
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Source0:        yast2-pkg-bindings-2.15.40.tar.bz2
+Source0:        yast2-pkg-bindings-2.15.41.tar.bz2
 prefix:                /usr
 BuildRequires:  blocxx-devel boost boost-devel dbus-1-devel docbook-xsl-stylesheets doxygen gcc-c++ hal-devel libgcrypt-devel libxcrypt-devel libxslt perl-XML-Writer rpm-devel sgml-skel yast2-core-devel yast2-devtools
-BuildRequires:  libzypp-devel >= 3.11.8
-BuildRequires:  libzypp >= 3.11.8
+BuildRequires:  libzypp-devel >= 3.13.11
+BuildRequires:  libzypp >= 3.13.11
 # new API (RepoManager instead of SourceManager)
-Requires:       libzypp >= 3.11.8
+Requires:       libzypp >= 3.13.11
 Summary:        YaST2 - Package Manager Access
 
 %description
@@ -40,7 +40,7 @@
     Stanislav Visnovsky <visnov@xxxxxxx>
 
 %prep
-%setup -n yast2-pkg-bindings-2.15.40
+%setup -n yast2-pkg-bindings-2.15.41
 # build only the library, ignore documentation (it is in devel-doc package)
 echo "src" > SUBDIRS
 
@@ -73,6 +73,13 @@
 %doc %{prefix}/share/doc/packages/yast2-pkg-bindings
 
 %changelog
+* Mon Aug 06 2007 - lslezak@xxxxxxx
+- mount repositories in readonly mode (FATE #302347)
+- fixed Pkg::RepositoryProbe() - now it accepts two arguments
+  (URL and product directory)
+- Pkg::ResolvableProperties() - returns type of product (key "TYPE"
+  in SUSEtags content file)
+- 2.15.41
 * Fri Aug 03 2007 - lslezak@xxxxxxx
 - added product directory support
 - Pkg::ResolvableProperties() returns license and status if

++++++ yast2-pkg-bindings-2.15.40.tar.bz2 -> yast2-pkg-bindings-2.15.41.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.15.40/configure new/yast2-pkg-bindings-2.15.41/configure
--- old/yast2-pkg-bindings-2.15.40/configure    2007-08-03 11:37:20.000000000 +0200
+++ new/yast2-pkg-bindings-2.15.41/configure    2007-08-06 16:53:04.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for yast2-pkg-bindings 2.15.40.
+# Generated by GNU Autoconf 2.60 for yast2-pkg-bindings 2.15.41.
 #
 # Report bugs to <http://bugs.opensuse.org/>.
 #
@@ -713,8 +713,8 @@
 # Identity of this package.
 PACKAGE_NAME='yast2-pkg-bindings'
 PACKAGE_TARNAME='yast2-pkg-bindings'
-PACKAGE_VERSION='2.15.40'
-PACKAGE_STRING='yast2-pkg-bindings 2.15.40'
+PACKAGE_VERSION='2.15.41'
+PACKAGE_STRING='yast2-pkg-bindings 2.15.41'
 PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
 
 ac_unique_file="RPMNAME"
@@ -1429,7 +1429,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-pkg-bindings 2.15.40 to adapt to many kinds of systems.
+\`configure' configures yast2-pkg-bindings 2.15.41 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1500,7 +1500,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of yast2-pkg-bindings 2.15.40:";;
+     short | recursive ) echo "Configuration of yast2-pkg-bindings 2.15.41:";;
    esac
   cat <<\_ACEOF
 
@@ -1608,7 +1608,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-yast2-pkg-bindings configure 2.15.40
+yast2-pkg-bindings configure 2.15.41
 generated by GNU Autoconf 2.60
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1622,7 +1622,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-pkg-bindings $as_me 2.15.40, which was
+It was created by yast2-pkg-bindings $as_me 2.15.41, which was
 generated by GNU Autoconf 2.60.  Invocation command line was
 
   $ $0 $@
@@ -2423,7 +2423,7 @@
 
 # Define the identity of the package.
  PACKAGE='yast2-pkg-bindings'
- VERSION='2.15.40'
+ VERSION='2.15.41'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2650,7 +2650,7 @@
 
 
 
-VERSION="2.15.40"
+VERSION="2.15.41"
 RPMNAME="yast2-pkg-bindings"
 MAINTAINER="Ladislav Slez√°k <lslezak@xxxxxxx>"
 
@@ -21612,7 +21612,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by yast2-pkg-bindings $as_me 2.15.40, which was
+This file was extended by yast2-pkg-bindings $as_me 2.15.41, which was
 generated by GNU Autoconf 2.60.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21665,7 +21665,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-yast2-pkg-bindings config.status 2.15.40
+yast2-pkg-bindings config.status 2.15.41
 configured by $0, generated by GNU Autoconf 2.60,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.15.40/configure.in new/yast2-pkg-bindings-2.15.41/configure.in
--- old/yast2-pkg-bindings-2.15.40/configure.in 2007-08-03 11:37:06.000000000 +0200
+++ new/yast2-pkg-bindings-2.15.41/configure.in 2007-08-06 16:52:47.000000000 +0200
@@ -3,7 +3,7 @@
 dnl -- This file is generated by y2autoconf 2.14.0 - DO NOT EDIT! --
 dnl    (edit configure.in.in instead)
 
-AC_INIT(yast2-pkg-bindings, 2.15.40, http://bugs.opensuse.org/, yast2-pkg-bindings)
+AC_INIT(yast2-pkg-bindings, 2.15.41, http://bugs.opensuse.org/, yast2-pkg-bindings)
 dnl Check for presence of file 'RPMNAME'
 AC_CONFIG_SRCDIR([RPMNAME])
 
@@ -17,7 +17,7 @@
 AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
 
 dnl Important YaST2 variables
-VERSION="2.15.40"
+VERSION="2.15.41"
 RPMNAME="yast2-pkg-bindings"
 MAINTAINER="Ladislav Slez√°k <lslezak@xxxxxxx>"
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.15.40/src/PkgModuleFunctions.h new/yast2-pkg-bindings-2.15.41/src/PkgModuleFunctions.h
--- old/yast2-pkg-bindings-2.15.40/src/PkgModuleFunctions.h     2007-08-03 09:49:43.000000000 +0200
+++ new/yast2-pkg-bindings-2.15.41/src/PkgModuleFunctions.h     2007-08-06 13:24:32.000000000 +0200
@@ -483,8 +483,8 @@
         YCPValue SourceEditSet (const YCPList& args);
        /* TYPEINFO: list<integer>(string,string)*/
         YCPValue SourceScan (const YCPString& media, const YCPString& product_dir);
-       /* TYPEINFO: string(string)*/
-       YCPValue RepositoryProbe(const YCPString& url);
+       /* TYPEINFO: string(string,string)*/
+       YCPValue RepositoryProbe(const YCPString& url, const YCPString& prod_dir);
        /* TYPEINFO: list<list<string> >(string)*/
        YCPValue RepositoryScan(const YCPString& url);
        /* TYPEINFO: integer(map<string,any>)*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.15.40/src/Resolvable.cc new/yast2-pkg-bindings-2.15.41/src/Resolvable.cc
--- old/yast2-pkg-bindings-2.15.40/src/Resolvable.cc    2007-08-03 10:49:29.000000000 +0200
+++ new/yast2-pkg-bindings-2.15.41/src/Resolvable.cc    2007-08-06 15:39:38.000000000 +0200
@@ -437,6 +437,7 @@
                        info->add(YCPString("short_name"), YCPString(product_summary));
                    }
 
+                   info->add(YCPString("type"), YCPString(product->type()));
 
                    YCPList updateUrls;
                    std::list<zypp::Url> pupdateUrls = product->updateUrls();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.15.40/src/Source.cc new/yast2-pkg-bindings-2.15.41/src/Source.cc
--- old/yast2-pkg-bindings-2.15.40/src/Source.cc        2007-08-03 09:50:33.000000000 +0200
+++ new/yast2-pkg-bindings-2.15.41/src/Source.cc        2007-08-06 15:02:26.000000000 +0200
@@ -37,6 +37,7 @@
 #include <zypp/Product.h>
 #include <zypp/target/store/PersistentStorage.h>
 #include <zypp/media/MediaManager.h>
+#include <zypp/media/Mount.h>
 #include <zypp/Pathname.h>
 
 #include <zypp/RepoInfo.h>
@@ -1344,6 +1345,44 @@
     return ret;
 }
 
+
+/**
+ * helper - add "mountoptions=ro" for mountable URL schemes if "mountoptions" option is not empty and
+ * "rw" or "ro" option is missing
+ */
+zypp::Url addRO(const zypp::Url &url)
+{
+    zypp::Url ret(url);
+    std::string scheme = zypp::str::toLower(url.getScheme());
+
+    if (scheme == "nfs"
+       || scheme == "hd"
+       || scheme == "smb"
+       || scheme == "iso"
+       || scheme == "cd"
+       || scheme == "dvd"
+    )
+    {
+       const std::string mountoptions = "mountoptions";
+       zypp::media::Mount::Options options(url.getQueryParam(mountoptions));
+
+       y2debug("Current mountoptions: %s", options.asString().c_str());
+
+       // if mountoptions are empty lizypp uses "ro" by default
+       // don't override "rw" option from application
+       // don't add "ro" if it's already present
+       if (!options.empty() && !options.has("rw") && !options.has("ro"))
+       {
+           options["ro"];
+
+           ret.setQueryParam(mountoptions, options.asString());
+           y2milestone("Adding read only mount option: '%s' -> '%s'", url.asString().c_str(), ret.asString().c_str());
+       }
+    }
+
+    return ret;
+}
+
 /** Create a Source and immediately put it into the SourceManager.
  * \return the SourceId
  * \throws Exception if Source creation fails
@@ -1411,10 +1450,14 @@
        name = alias;
     }
 
+
     y2milestone("Name of the repository: '%s'", name.c_str());
 
     alias = UniqueAlias(alias);
 
+    // add read only mount option to the URL if needed
+    url = addRO(url);
+
     repo.setAlias(alias);
     repo.setName(name);
     repo.setType(repotype);
@@ -1533,6 +1576,9 @@
                    repo.setName(name);
                    url = url_new;
                }
+
+               // add read only mount option to the URL if needed
+               url = addRO(url);
            }
            catch(const zypp::Exception & expt)
            {
@@ -2367,9 +2413,10 @@
  *
  * @short Probe type of the repository
  * @param url specifies the path to the repository
+ * @param prod_dir product directory (if empty the url is probed directly)
  * @return string repository type ("NONE" if type could be determined, nil if an error occurred (e.g. resolving the hostname)
  **/
-YCPValue PkgModuleFunctions::RepositoryProbe(const YCPString& url)
+YCPValue PkgModuleFunctions::RepositoryProbe(const YCPString& url, const YCPString& prod_dir)
 {
     y2milestone("Probing repository type: '%s'...", url->value().c_str());
     zypp::RepoManager repomanager = CreateRepoManager();
@@ -2379,6 +2426,28 @@
     {
        zypp::Url probe_url(url->value());
 
+       // add the product directory
+       std::string prod = prod_dir->value();
+
+       if (!prod.empty())
+       {
+           // add "/" at the begining if it's missing
+           if (std::string(prod, 0, 1) != "/")
+           {
+               prod = "/" + prod;
+           }
+
+           // merge the URL path and the product path
+           std::string path = probe_url.getPathName();
+           path += prod;
+
+           y2milestone("Using probing path: %s", path.c_str());
+           probe_url.setPathName(path);
+       }
+
+       // add "ro" mount option
+       probe_url = addRO(probe_url);
+
        // autoprobe type of the repository 
        zypp::repo::RepoType repotype = ProbeWithCallbacks(probe_url);
 
@@ -2409,6 +2478,9 @@
     try
     {
        zypp::Url baseurl(url->value());
+
+       baseurl = addRO(baseurl);
+
        ScanProductsWithCallBacks(baseurl);
        products = available_products;
     }
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-pkg-bindings-2.15.40/VERSION new/yast2-pkg-bindings-2.15.41/VERSION
--- old/yast2-pkg-bindings-2.15.40/VERSION      2007-08-03 11:10:01.000000000 +0200
+++ new/yast2-pkg-bindings-2.15.41/VERSION      2007-08-06 16:51:53.000000000 +0200
@@ -1 +1 @@
-2.15.40
+2.15.41


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



Remember to have fun...

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

< Previous Next >