Mailinglist Archive: yast-commit (459 mails)

< Previous Next >
[yast-commit] r60752 - in /branches/SuSE-Code-11-SP1-Branch/registration: VERSION package/yast2-registration.changes src/modules/Register.ycp
  • From: jdsn@xxxxxxxxxxxxxxxx
  • Date: Mon, 08 Feb 2010 17:45:08 -0000
  • Message-id: <E1NeXfY-0002Jy-8b@xxxxxxxxxxxxxxxx>
Author: jdsn
Date: Mon Feb 8 18:45:07 2010
New Revision: 60752

URL: http://svn.opensuse.org/viewcvs/yast?rev=60752&view=rev
Log:
fix repos_to_en/disable flags (bnc#576532)
force reload of SourceManager (bnc#576532)
2.17.30

Modified:
branches/SuSE-Code-11-SP1-Branch/registration/VERSION

branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes
branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp

Modified: branches/SuSE-Code-11-SP1-Branch/registration/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/registration/VERSION?rev=60752&r1=60751&r2=60752&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/registration/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/registration/VERSION Mon Feb 8 18:45:07
2010
@@ -1 +1 @@
-2.17.29
+2.17.30

Modified:
branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes?rev=60752&r1=60751&r2=60752&view=diff
==============================================================================
---
branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes
(original)
+++
branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes
Mon Feb 8 18:45:07 2010
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Feb 8 18:43:30 CET 2010 - jdsn@xxxxxxx
+
+- fix repos_to_en/disable flags (bnc#576532)
+- force reload of SourceManager (bnc#576532)
+- 2.17.30
+
+-------------------------------------------------------------------
Wed Jan 13 18:26:17 CET 2010 - jdsn@xxxxxxx

- port changes from Code11 to Code11 SP1 (2.17.26-28)

Modified: branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp?rev=60752&r1=60751&r2=60752&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp
(original)
+++ branches/SuSE-Code-11-SP1-Branch/registration/src/modules/Register.ycp Mon
Feb 8 18:45:07 2010
@@ -915,17 +915,8 @@
// Note: repeated calls to TargetInitialize with the same rootdir are
ok, see libzypp/zypp/zypp_detail/ZYppImpl.cc:95
y2debug("The Target currently is initialized - but due to bug
bnc#468449 Pkg::TargetFinish will not be called.");

- // Keeping the former code block commented out as a reference
-// y2milestone("Package target was initialized. Now finishing target
usage.");
-// if ( Pkg::TargetFinish() )
-// {
-// y2milestone("Successfully finished the target usage of the
package system.");
-// isInitializedTarget = false;
-// }
-// else
-// {
-// y2error("Could not finish the target usage of the package
system.");
-// }
+ // keep it initialized but enforce a re-initialization if a workflow
returns back to registration (bnc#576532)
+ isInitializedTarget = false;
}
}

@@ -1013,8 +1004,37 @@

map<string, any> serviceDetails = $[];
serviceDetails = (map<string, any>) Pkg::ServiceGet(service);
- serviceDetails["repos_to_enable"] =
union(serviceDetails["repos_to_enable"]:[], catalogToEnable);
- serviceDetails["repos_to_disable"] =
union(serviceDetails["repos_to_disable"]:[], catalogToDisable);
+
+ // intelligently merge the repos_to_* flags (bnc#576532)
+ list<string> currentToEnable = (list<string>)
serviceDetails["repos_to_enable"]:[];
+ list<string> currentToDisable = (list<string>)
serviceDetails["repos_to_disable"]:[];
+ // remove duplicates
+ currentToEnable = toset(currentToEnable);
+ currentToDisable = toset(currentToDisable);
+ catalogToEnable = toset(catalogToEnable);
+ catalogToDisable = toset(catalogToDisable);
+ y2debug("Current repos_to_enable : %1", currentToEnable);
+ y2debug("Current repos_to_disable: %1", currentToDisable);
+ y2debug("Requested repos_to_enable : %1", catalogToEnable);
+ y2debug("Requested repos_to_disable: %1", catalogToDisable);
+
+ list<string> newToEnable = [];
+ list<string> newToDisable = [];
+
+ // filter out "repos_to_enable" that are requested to be disabled
(bnc#576532)
+ newToEnable = filter(string oneCatalog, (list<string>)
union(currentToEnable, catalogToEnable), {
+ return ! contains(catalogToDisable, oneCatalog);
+ });
+
+ // filter out "repos_to_disable" that are requested to be enabled
(bnc#576532)
+ newToDisable = filter(string oneCatalog, (list<string>)
union(currentToDisable, catalogToDisable), {
+ return ! contains(catalogToEnable, oneCatalog);
+ });
+
+ y2debug("Resulting repos_to_enable : %1", newToEnable);
+ y2debug("Resulting repos_to_disable: %1", newToDisable);
+ serviceDetails["repos_to_enable"] = newToEnable;
+ serviceDetails["repos_to_disable"] = newToDisable;

// enabled flag must not be present - otherwise all catalogs will be
activated
serviceDetails = remove(serviceDetails, "enabled");
@@ -1416,17 +1436,13 @@
if ( registration_data != $[] )
{
// append sensitive data to the context map
-// foreach (string key, string val, registration_data, {
-// key = String::CutRegexMatch(key, "[^A-Za-z0-9_-]+", true );
-// contextData[key] = sformat("%1", String::Quote(val));
-// });
contextData["args"] = registration_data;
// do not log sensitive data to the log (#195624)
y2milestone ("Added sensitive registration data to suse_register call
- this data is not logged");
}


- if ( ! isInitializedSR || ! isInitializedTarget || contextData !=
contextDataSR )
+ if ( ! isInitializedSR || ! isInitializedTarget || contextData !=
contextDataSR )
{
// initialize target
if ( ! isInitializedTarget )
@@ -1439,43 +1455,38 @@
}
y2milestone("Successfully initialized the target.");
isInitializedTarget = true;
+ }

- if ( Pkg::SourceStartManager(true) )
- {
- y2milestone("Successfully started source manager.");
- }
- else
- {
- y2error("Failed to start source manager");
- return 199;
- }
-
-// y2debug("Setting Pkg::CallbackAuthentication to a dummy
function");
-//
Pkg::CallbackAuthentication("Register::callbackAuthenticationOnRefresh");
-
- y2milestone("Initially refreshing services.");
- // refresh all services _once_ before interacting with SuseRegister
- allCurrentServices = Pkg::ServiceAliases();
-
- foreach ( string serviceAlias, allCurrentServices, {
- y2milestone("Refreshing service with Alias: %1", serviceAlias);
- Pkg::ServiceRefresh(serviceAlias);
- });
-
- y2milestone("Initially refreshing sources.");
- // refresh all sources _once_ before interacting with SuseRegister
- allCurrentSources = Pkg::SourceGetCurrent(true);
-
- foreach ( integer srcID, allCurrentSources, {
- y2milestone("Refreshing source with ID: %1", srcID);
- // no "forced" refresh needed - default is sufficient
(bnc#476429)
- Pkg::SourceRefreshNow(srcID);
- });
- y2milestone("Initial refreshing ended.");
-
-// y2debug("Resetting Pkg::CallbackAuthentication to default.");
-// Pkg::CallbackAuthentication(nil);
+ // always restart the source manager (bnc#576532)
+ if ( Pkg::SourceStartManager(true) )
+ {
+ y2milestone("Successfully started source manager.");
}
+ else
+ {
+ y2error("Failed to start source manager");
+ return 199;
+ }
+
+ y2milestone("Initially refreshing services.");
+ // refresh all services _once_ before interacting with SuseRegister
+ allCurrentServices = Pkg::ServiceAliases();
+
+ foreach ( string serviceAlias, allCurrentServices, {
+ y2milestone("Refreshing service with Alias: %1", serviceAlias);
+ Pkg::ServiceRefresh(serviceAlias);
+ });
+
+ y2milestone("Initially refreshing sources.");
+ // refresh all sources _once_ before interacting with SuseRegister
+ allCurrentSources = Pkg::SourceGetCurrent(true);
+
+ foreach ( integer srcID, allCurrentSources, {
+ y2milestone("Refreshing source with ID: %1", srcID);
+ // no "forced" refresh needed - default is sufficient (bnc#476429)
+ Pkg::SourceRefreshNow(srcID);
+ });
+ y2milestone("Initial refreshing ended.");

// setting the proxy must happen before init_ctx is called (bnc#468480)
// setting up proxy for SuseRegister

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

< Previous Next >
This Thread
  • No further messages