Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] r57911 - in /branches/SuSE-SLE-10-SP2-Branch/pkg-bindings: VERSION package/yast2-pkg-bindings.changes src/Resolvable.cc src/Source.cc
  • From: lslezak@xxxxxxxxxxxxxxxx
  • Date: Tue, 07 Jul 2009 13:52:18 -0000
  • Message-id: <E1MOB5m-0002Ri-2U@xxxxxxxxxxxxxxxx>
Author: lslezak
Date: Tue Jul 7 15:52:17 2009
New Revision: 57911

URL: http://svn.opensuse.org/viewcvs/yast?rev=57911&view=rev
Log:
- Fixed Pkg::ResolvableProperties() - return `removed status for
items selected to delete (bnc#481101)
- Fixed Pkg::SourceCreate() - make the new alias unique - timestamp
alias uses 1 second granularity which might not be sufficient
in AutoYast (bnc#406720)
- 2.13.124

Modified:
branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/VERSION

branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/package/yast2-pkg-bindings.changes
branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Resolvable.cc
branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Source.cc

Modified: branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/VERSION?rev=57911&r1=57910&r2=57911&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/VERSION (original)
+++ branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/VERSION Tue Jul 7 15:52:17
2009
@@ -1 +1 @@
-2.13.123
+2.13.124

Modified:
branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/package/yast2-pkg-bindings.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/package/yast2-pkg-bindings.changes?rev=57911&r1=57910&r2=57911&view=diff
==============================================================================
---
branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/package/yast2-pkg-bindings.changes
(original)
+++
branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/package/yast2-pkg-bindings.changes
Tue Jul 7 15:52:17 2009
@@ -1,4 +1,18 @@
-------------------------------------------------------------------
+Fri Mar 27 13:57:53 CET 2009 - lslezak@xxxxxxx
+
+- Fixed Pkg::SourceCreate() - make the new alias unique - timestamp
+ alias uses 1 second granularity which might not be sufficient
+ in AutoYast (bnc#406720)
+- 2.13.124
+
+-------------------------------------------------------------------
+Wed Mar 25 13:41:30 CET 2009 - lslezak@xxxxxxx
+
+- Fixed Pkg::ResolvableProperties() - return `removed status for
+ items selected to delete (bnc#481101)
+
+-------------------------------------------------------------------
Mon Mar 10 14:45:08 CET 2008 - lslezak@xxxxxxx

- check whether the alias of a new source is already in use, if yes

Modified: branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Resolvable.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Resolvable.cc?rev=57911&r1=57910&r2=57911&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Resolvable.cc (original)
+++ branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Resolvable.cc Tue Jul 7
15:52:17 2009
@@ -389,13 +389,13 @@
// status
std::string stat;

- if (it->status().isInstalled())
+ if (it->status().isToBeInstalled())
{
- stat = "installed";
+ stat = "selected";
}
- else if (it->status().isToBeInstalled())
+ else if (it->status().isInstalled() ||
it->status().isSatisfied())
{
- stat = "selected";
+ stat = it->status().isToBeUninstalled() ? "removed" :
"installed";
}
else
{

Modified: branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Source.cc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Source.cc?rev=57911&r1=57910&r2=57911&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Source.cc (original)
+++ branches/SuSE-SLE-10-SP2-Branch/pkg-bindings/src/Source.cc Tue Jul 7
15:52:17 2009
@@ -25,6 +25,9 @@
//#include <sys/statvfs.h>

#include <iostream>
+#include <sstream>
+#include <algorithm>
+
#include <ycp/y2log.h>

#include <ycpTools.h>
@@ -1037,11 +1040,15 @@
bool alias_found = false;
std::list<zypp::SourceManager::SourceId> ids =
zypp::SourceManager::sourceManager()->allSources();

+ // remember the existing aliases
+ std::list<std::string> aliases;
+
for( std::list<zypp::SourceManager::SourceId>::iterator it = ids.begin(); it
!= ids.end(); ++it)
{
try
{
zypp::Source_Ref src =
zypp::SourceManager::sourceManager()->findSource(*it);
+ aliases.push_back(src.alias());

if (src.alias() == newsrc.alias())
{
@@ -1085,7 +1092,28 @@

alias += timestamp ();

+ // does the alias already exist?
+ if (std::find_if(aliases.begin(), aliases.end(),
std::bind2nd(std::equal_to<std::string>(), alias)) != aliases.end())
+ {
+ // yes, make the alias unique (see bnc #406720)
+ int uniq_suffix = 0;
+ std::string new_alias;
+
+ do
+ {
+ std::ostringstream os;
+ os << alias << '_' << uniq_suffix;
+ new_alias = os.str();
+ uniq_suffix++;
+ }
+ while (std::find_if(aliases.begin(), aliases.end(),
std::bind2nd(std::equal_to<std::string>(), new_alias)) != aliases.end());
+
+ y2milestone("Make the new alias unique: '%s' -> '%s'", alias.c_str(),
new_alias.c_str());
+ alias = new_alias;
+ }
+
newsrc.setAlias( alias );
+
y2milestone("Using time stamp '%s' as the alias", alias.c_str());
}


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

< Previous Next >
This Thread
  • No further messages