Create new Service repos in disbaled sate.
authorMichael Andres <ma@suse.de>
Fri, 12 Sep 2008 16:25:41 +0000 (16:25 +0000)
committerMichael Andres <ma@suse.de>
Fri, 12 Sep 2008 16:25:41 +0000 (16:25 +0000)
VERSION.cmake
cmake/modules/FindGettext.cmake [deleted file]
package/libzypp.changes
zypp/RepoManager.cc

index fba57dc2aa9b8ff9e3ff1fe0991781dbc8a6f9e7..5af0ed786d9de4a427167bd29bd1bd35706cb39d 100644 (file)
@@ -63,6 +63,6 @@ SET(LIBZYPP_COMPATMINOR "10")
 SET(LIBZYPP_MINOR "10")
 SET(LIBZYPP_PATCH "0")
 #
-# LAST RELEASED: 5.9.0 (8)
+# LAST RELEASED: 5.10.0 (10)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
diff --git a/cmake/modules/FindGettext.cmake b/cmake/modules/FindGettext.cmake
deleted file mode 100644 (file)
index cdbfc13..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-# - Find GNU gettext tools
-# This module looks for the GNU gettext tools. This module defines the
-# following values:
-#  GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
-#  GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
-#  GETTEXT_FOUND: True if gettext has been found.
-#
-# Additionally it provides the following macros:
-# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
-#    This will create a target "translations" which will convert the
-#    given input po files into the binary output mo file. If the
-#    ALL option is used, the translations will also be created when
-#    building the default target.
-
-FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
-
-FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
-
-MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile)
-
-   SET(_gmoFiles)
-   GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
-   GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
-
-#MESSAGE( STATUS "pot: ${_potFile} converted to ${_potBasename}")
-
-   SET(_addToAll)
-   IF(${_firstPoFile} STREQUAL "ALL")
-      SET(_addToAll "ALL")
-      SET(_firstPoFile)
-   ENDIF(${_firstPoFile} STREQUAL "ALL")
-
-   FOREACH (_currentPoFile ${ARGN})
-      GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
-      GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
-      GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
-      SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
-
-      ADD_CUSTOM_COMMAND(
-         OUTPUT ${_gmoFile}
-#COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
-         COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
-#DEPENDS ${_absPotFile} ${_absFile}
-         DEPENDS ${_absFile}
-      )
-
-      INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
-      SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
-
-   ENDFOREACH (_currentPoFile )
-
-   ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles})
-
-ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
-
-IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
-   SET(GETTEXT_FOUND TRUE)
-ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
-   SET(GETTEXT_FOUND FALSE)
-   IF (GetText_REQUIRED)
-      MESSAGE(FATAL_ERROR "GetText not found")
-   ENDIF (GetText_REQUIRED)
-ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
\ No newline at end of file
index ac9212ec5c3a65fcf20ec614bcc5c34c7035d08c..2f84791368fd8a620ff904659a86fe93314acb42 100644 (file)
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Fri Sep 12 18:24:28 CEST 2008 - ma@suse.de
+
+- Create new Service repos in disbaled sate.
+- revision 11056
+- version 5.10.0 (10)
+
 -------------------------------------------------------------------
 Fri Sep 12 16:04:54 CEST 2008 - ma@suse.de
 
@@ -10,7 +17,7 @@ Fri Sep 12 12:59:50 CEST 2008 - ma@suse.de
 
 - Add url lists query to Product interface. A generic query and 
   convenience methods to query urls for "releasenotes", "register", 
-  "updateurls", "extraurls",  "optionalurls" and "smolt"
+  "updateurls", "extraurls",  "optionalurls" and "smolt" (bnc #413444)
 - revision 11029
 
 -------------------------------------------------------------------
index 208dc111dcc4a5441ccfbfe3702593e727e53e51..d9c89fa9df3204617928053362fbc6a092c579a4 100644 (file)
@@ -62,6 +62,23 @@ using namespace zypp::repo;
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
+  namespace
+  {
+    /** Check if alias_r is present in repo/service container. */
+    template <class Iterator>
+    inline bool findAliasIn( const std::string & alias_r, Iterator begin_r, Iterator end_r )
+    {
+      for_( it, begin_r, end_r )
+        if ( it->alias() == alias_r )
+          return true;
+      return false;
+    }
+    /** \overload */
+    template <class Container>
+    inline bool findAliasIn( const std::string & alias_r, const Container & cont_r )
+    { return findAliasIn( alias_r, cont_r.begin(), cont_r.end() ); }
+ }
+
   ///////////////////////////////////////////////////////////////////
   //
   //   CLASS NAME : RepoManagerOptions
@@ -110,7 +127,7 @@ namespace zypp
     * Passing this functor as callback, you can collect
     * all results at the end, without dealing with async
     * code.
-    * 
+    *
     * If targetDistro is set, all repos with non-empty RepoInfo::targetDistribution()
     * will be skipped.
     * \todo do this through a separate filter
@@ -119,7 +136,7 @@ namespace zypp
     {
       RepoCollector()
       {}
-      
+
       RepoCollector(const string & targetDistro_)
         : targetDistro(targetDistro_)
       {}
@@ -1565,36 +1582,34 @@ namespace zypp
     getRepositoriesInService(service.alias(),
         insert_iterator<std::list<RepoInfo> > (oldRepos, oldRepos.begin()));
 
+    //! \todo fix enabled/disable with respect to ServiceInfo reposTo...
+
     // find old to remove
     for_( it, oldRepos.begin(), oldRepos.end() )
     {
-      bool found = false;
-
-      for_( it2, collector.repos.begin(), collector.repos.end() )
-        if ( it->alias() == it2->alias() )
-        {
-          found = true;
-          break;
-        }
-
-      if( !found )
+      if ( ! findAliasIn( it->alias(), collector.repos ) )
+      {
         removeRepository( *it );
+      }
     }
 
     //find new to add
     for_( it, collector.repos.begin(), collector.repos.end() )
     {
-      bool found = false;
+      if ( ! findAliasIn( it->alias(), oldRepos ) )
+      {
+#warning check whether a repo with the same alias exists
+        // At that point check whether a repo with the same alias
+        // exists outside this service. Maybe forcefully re-alias
+        // the existing repo?
 
-      for_( it2, oldRepos.begin(), oldRepos.end() )
-        if( it->alias() == it2->alias() )
-        {
-          found = true;
-          break;
-        }
+        // make sure the service is created in disabled
+        // autorefresh true.
+        it->setEnabled( false );
+        it->setAutorefresh( true );
 
-      if (!found)
         addRepository( *it );
+      }
     }
   }
 
@@ -1648,7 +1663,7 @@ namespace zypp
     }
 
     //! \todo changed enabled status
-    if ( oldService.enabled() != service.enabled())
+    if ( oldService.enabled() != service.enabled() )
     {
 
     }
@@ -1674,7 +1689,7 @@ namespace zypp
       }
     }
   }
-  
+
   repo::ServiceType RepoManager::probeService( const Url &url ) const
   {
     try