[yast-commit] r67307 - in /branches/SuSE-Code-11-SP1-Branch/pkg-bindings: VERSION package/yast2-pkg-bindings.changes src/Service.cc src/Source_Create.cc src/Source_Save.cc src/YRepo.cc src/YRepo.h
Author: lslezak Date: Thu Jan 26 15:24:26 2012 New Revision: 67307 URL: http://svn.opensuse.org/viewcvs/yast?rev=67307&view=rev Log: - fixed saving additional repositories added by registration (a regression introduced by bnc#724449 fix) (bnc#742033) - 2.17.45.5 Modified: branches/SuSE-Code-11-SP1-Branch/pkg-bindings/VERSION branches/SuSE-Code-11-SP1-Branch/pkg-bindings/package/yast2-pkg-bindings.changes branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Service.cc branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Source_Create.cc branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Source_Save.cc branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/YRepo.cc branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/YRepo.h Modified: branches/SuSE-Code-11-SP1-Branch/pkg-bindings/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/pkg-bi... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/pkg-bindings/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/pkg-bindings/VERSION Thu Jan 26 15:24:26 2012 @@ -1 +1 @@ -2.17.45.4 +2.17.45.5 Modified: branches/SuSE-Code-11-SP1-Branch/pkg-bindings/package/yast2-pkg-bindings.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/pkg-bi... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/pkg-bindings/package/yast2-pkg-bindings.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/pkg-bindings/package/yast2-pkg-bindings.changes Thu Jan 26 15:24:26 2012 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Jan 26 11:50:25 UTC 2012 - lslezak@suse.cz + +- fixed saving additional repositories added by registration + (a regression introduced by bnc#724449 fix) (bnc#742033) +- 2.17.45.5 + +------------------------------------------------------------------- Tue Dec 6 13:29:53 UTC 2011 - lslezak@suse.cz - fixed reloading of repositories which have been removed during Modified: branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Service.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/pkg-bi... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Service.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Service.cc Thu Jan 26 15:24:26 2012 @@ -394,7 +394,8 @@ { repos[idx]->repoInfo() = repomanager.getRepositoryInfo(info.alias()); } - else + // do not remove repos which have not been saved yet (freshly added) + else if (!repo->isAdded()) { y2milestone("Repository %s has been removed, unloading it", (info.alias().c_str())); RemoveResolvablesFrom(info.alias()); Modified: branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Source_Create.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/pkg-bi... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Source_Create.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Source_Create.cc Thu Jan 26 15:24:26 2012 @@ -314,7 +314,11 @@ prg.toMax(); } - repos.push_back(new YRepo(repo)); + + YRepo_Ptr new_repo = new YRepo(repo); + new_repo->setAdded(); + + repos.push_back(new_repo); y2milestone("Added source '%s': '%s', enabled: %s, autorefresh: %s", repo.alias().c_str(), @@ -511,7 +515,10 @@ repo.setPackagesPath(repomanager.packagesPath(repo)); - repos.push_back(new YRepo(repo)); + YRepo_Ptr new_repo = new YRepo(repo); + new_repo->setAdded(); + + repos.push_back(new_repo); // the new source is at the end of the list return YCPInteger(repos.size() - 1); Modified: branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Source_Save.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/pkg-bi... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Source_Save.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/Source_Save.cc Thu Jan 26 15:24:26 2012 @@ -220,6 +220,12 @@ y2milestone("Adding repository '%s'", current_alias.c_str()); repomanager.addRepository((*it)->repoInfo()); } + + if (!(*it)->isAdded()) + { + y2milestone("Resetting added flag for repository %s", current_alias.c_str()); + (*it)->resetAdded(); + } } catch (zypp::Exception & excpt) { Modified: branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/YRepo.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/pkg-bi... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/YRepo.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/YRepo.cc Thu Jan 26 15:24:26 2012 @@ -32,7 +32,7 @@ IMPL_PTR_TYPE(YRepo); YRepo::YRepo(zypp::RepoInfo & repo) - : _repo(repo), _deleted(false) + : _repo(repo), _deleted(false), _added(false) {} YRepo::~YRepo() Modified: branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/YRepo.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/pkg-bi... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/YRepo.h (original) +++ branches/SuSE-Code-11-SP1-Branch/pkg-bindings/src/YRepo.h Thu Jan 26 15:24:26 2012 @@ -39,6 +39,7 @@ zypp::RepoInfo _repo; zypp::MediaSetAccess_Ptr _maccess; bool _deleted; + bool _added; YRepo() {} @@ -53,6 +54,10 @@ bool isDeleted() {return _deleted;} void setDeleted() {_deleted = true;} + bool isAdded() {return _added;} + void setAdded() {_added = true;} + void resetAdded() {_added = false;} + public: static const YRepo NOREPO; }; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn2.opensuse.org