From d405eacadc62de0a82abbc4f67f1c0b753057a8b Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Fri, 12 Sep 2008 16:25:41 +0000 Subject: [PATCH] Create new Service repos in disbaled sate. --- VERSION.cmake | 2 +- cmake/modules/FindGettext.cmake | 63 --------------------------------- package/libzypp.changes | 9 ++++- zypp/RepoManager.cc | 59 ++++++++++++++++++------------ 4 files changed, 46 insertions(+), 87 deletions(-) delete mode 100644 cmake/modules/FindGettext.cmake diff --git a/VERSION.cmake b/VERSION.cmake index fba57dc2a..5af0ed786 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -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 index cdbfc13c2..000000000 --- a/cmake/modules/FindGettext.cmake +++ /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 diff --git a/package/libzypp.changes b/package/libzypp.changes index ac9212ec5..2f8479136 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -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 ------------------------------------------------------------------- diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index 208dc111d..d9c89fa9d 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -62,6 +62,23 @@ using namespace zypp::repo; namespace zypp { ///////////////////////////////////////////////////////////////// + namespace + { + /** Check if alias_r is present in repo/service container. */ + template + 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 + 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 > (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 -- 2.34.1