Mailinglist Archive: yast-commit (396 mails)

< Previous Next >
[yast-commit] r65468 - in /trunk/packager: VERSION package/yast2-packager.changes src/modules/AddOnProduct.ycp
Author: locilka
Date: Wed Aug 31 14:14:43 2011
New Revision: 65468

URL: http://svn.opensuse.org/viewcvs/yast?rev=65468&view=rev
Log:
- Cleaner solution for adjusting repository priority and fixing
that now it also works in installation (bnc#714027)
- 2.21.12


Modified:
trunk/packager/VERSION
trunk/packager/package/yast2-packager.changes
trunk/packager/src/modules/AddOnProduct.ycp

Modified: trunk/packager/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=65468&r1=65467&r2=65468&view=diff
==============================================================================
--- trunk/packager/VERSION (original)
+++ trunk/packager/VERSION Wed Aug 31 14:14:43 2011
@@ -1 +1 @@
-2.21.11
+2.21.12

Modified: trunk/packager/package/yast2-packager.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=65468&r1=65467&r2=65468&view=diff
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Wed Aug 31 14:14:43 2011
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Wed Aug 31 14:05:48 CEST 2011 - locilka@xxxxxxx
+
+- Cleaner solution for adjusting repository priority and fixing
+ that now it also works in installation (bnc#714027)
+- 2.21.12
+
+-------------------------------------------------------------------
Tue Aug 30 14:03:01 UTC 2011 - lslezak@xxxxxxx

- webpin_package_search - display popup and print error message

Modified: trunk/packager/src/modules/AddOnProduct.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/AddOnProduct.ycp?rev=65468&r1=65467&r2=65468&view=diff
==============================================================================
--- trunk/packager/src/modules/AddOnProduct.ycp (original)
+++ trunk/packager/src/modules/AddOnProduct.ycp Wed Aug 31 14:14:43 2011
@@ -1272,38 +1272,6 @@
}

/**
- * Adjusts priority of a given repository id
- *
- * @param integer repository id
- * @param integer priority
- * @returns boolean if successful
- */
-boolean RepositorySetPriority (integer repo_id, integer priority) {
- list <map <string, any> > repos = Pkg::SourceEditGet();
-
- map <string, any> edit_repo = $[];
-
- integer counter = -1;
- foreach (map <string, any> repo, repos, {
- counter = counter + 1;
- if (repo["SrcId"]:-1 == repo_id) {
- edit_repo = repo;
- break;
- }
- });
-
- if (edit_repo == $[]) {
- y2error ("Cannot find repository ID: %1", repo_id);
- return false;
- }
-
- edit_repo["priority"] = priority;
- repos[counter] = edit_repo;
-
- return Pkg::SourceEditSet (repos);
-}
-
-/**
* Auto-integrate add-on products in specified file (usually add_on_products or
* add_on_products.xml file)
*
@@ -1400,8 +1368,12 @@
string pth = one_product["path"]:"";
integer priority = one_product["priority"]:-1;

- y2milestone ("Adding Repository: %1 %2", url, pth);
- repo_id = Pkg::SourceCreate (url, pth);
+ map <string, any> new_repo = $[ "enabled" : true, "base_urls" :
[url], "prod_dir" : pth ];
+ // BNC #714027: Possibility to adjust repository priority (usually
higher)
+ if (priority > -1) new_repo["priority"] = priority;
+
+ y2milestone ("Adding Repository: %1", new_repo);
+ repo_id = Pkg::RepositoryAdd (new_repo);

if (repo_id == nil || repo_id < 0) {
y2error ("Unable to add product: %1", url);
@@ -1410,8 +1382,10 @@
return false;
}

- // BNC #714027: Possibility to adjust repository priority (usually
higher)
- if (priority > -1) RepositorySetPriority (repo_id, priority);
+ // download metadata, build repo cache
+ Pkg::SourceRefreshNow (repo_id);
+ // load resolvables to zypp pool
+ Pkg::SourceLoad();

if (! AcceptedLicenseAndInfoFile (repo_id)) {
y2warning ("License not accepted, delete the repository");

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

< Previous Next >
This Thread
  • No further messages