Author: benjimanw
Date: Wed Aug 29 16:14:34 2007
New Revision: 40588
URL: http://svn.opensuse.org/viewcvs/yast?rev=40588&view=rev
Log:
Switch to using the new 10.3 repository adding API - allows for a fix of
bug #300974. Now de-dupes repositories on alias & name against name in
YMP before adding. Also adds repositories with correct name. N.B. This
commit breaks compatability with 10.2.
Modified:
trunk/metapackage/src/OneClickInstallWorker.ycp
Modified: trunk/metapackage/src/OneClickInstallWorker.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/src/OneClickInstallWorker.ycp?rev=40588&r1=40587&r2=40588&view=diff
==============================================================================
--- trunk/metapackage/src/OneClickInstallWorker.ycp (original)
+++ trunk/metapackage/src/OneClickInstallWorker.ycp Wed Aug 29 16:14:34 2007
@@ -8,6 +8,13 @@
import "PackageCallbacks";
import "SourceManager";
import "Progress";
+
+ boolean FuzzyMatch(string one, string two)
+ {
+ string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ return (tolower(filterchars(one,chars)) == tolower(filterchars(two,chars)));
+ }
+
/**
** Check whether this repository is already subscribed
**/
@@ -15,21 +22,32 @@
{
list<integer> sources = Pkg::SourceStartCache(true);
- list<string> existingSources = [];
list<string> deduped = [];
- foreach (integer value, sources,
- {
- string url = Pkg::SourceMediaData(value)["url"]:"Error";
-
- existingSources = add(existingSources,url);
- });
- foreach(string new, url_list,
+ foreach (string new, url_list,
{
- if (!contains(existingSources,new))
+ boolean dupeFound = false;
+ foreach (integer srcid, sources,
{
+ map