[yast-commit] r41368 - in /trunk/yast2: library/control/src/WorkflowManager.ycp package/yast2.changes
Author: locilka Date: Thu Oct 11 13:33:17 2007 New Revision: 41368 URL: http://svn.opensuse.org/viewcvs/yast?rev=41368&view=rev Log: - Merging every single workflow only once, skipping duplicate additional workflows even if provided by a different file name (#332436). Modified: trunk/yast2/library/control/src/WorkflowManager.ycp trunk/yast2/package/yast2.changes Modified: trunk/yast2/library/control/src/WorkflowManager.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/control/src/WorkflowManager.ycp?rev=41368&r1=41367&r2=41368&view=diff ============================================================================== --- trunk/yast2/library/control/src/WorkflowManager.ycp (original) +++ trunk/yast2/library/control/src/WorkflowManager.ycp Thu Oct 11 13:33:17 2007 @@ -1035,6 +1035,27 @@ } /** + * Returns file unique identification in format ${file_MD5sum}-${file_size} + * Returns 'nil' if file doesn't exist, it is not a 'file', etc. + * + * @param string file + * @return string file_ident + */ + string GenerateWorkflowIdent (string workflow_filename) { + string file_md5sum = FileUtils::MD5sum (workflow_filename); + + if (file_md5sum == nil || file_md5sum == "") + return nil; + + integer file_size = FileUtils::GetSize (workflow_filename); + + if (file_size < 0) + return nil; + + return sformat ("%1-%2", file_md5sum, file_size); + } + + /** * Function uses the Base Workflow as the initial one and merges all * added workflow into that workflow. * @@ -1049,7 +1070,20 @@ boolean ret = true; + list <string> already_merged_workflows = []; + foreach (string one_workflow, used_workflows, { + // make sure that every workflow is merged only once + // bugzilla #332436 + string workflow_ident = GenerateWorkflowIdent (one_workflow); + + if (workflow_ident != nil && contains (already_merged_workflows, workflow_ident)) { + y2milestone ("The very same workflow has been already merged, skipping..."); + return; + } else { + already_merged_workflows = add (already_merged_workflows, workflow_ident); + } + if (! IntegrateWorkflow (one_workflow)) { y2error ("Merging '%1' failed!", one_workflow); Report::Error (_("An internal error occured when integrating additional workflow.")); Modified: trunk/yast2/package/yast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=41368&r1=41367&r2=41368&view=diff ============================================================================== --- trunk/yast2/package/yast2.changes (original) +++ trunk/yast2/package/yast2.changes Thu Oct 11 13:33:17 2007 @@ -2,6 +2,9 @@ Thu Oct 11 11:52:23 CEST 2007 - locilka@suse.cz - New function FileUtils::MD5sum. +- Merging every single workflow only once, skipping duplicate + additional workflows even if provided by a different file name + (#332436). ------------------------------------------------------------------- Thu Oct 4 16:29:01 CEST 2007 - jsrain@suse.cz -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
locilka@svn.opensuse.org