Alon Bar-Lev has uploaded a new change for review.

Change subject: core: support more complex sequence relationships
......................................................................

core: support more complex sequence relationships

perform before/after multiple times to allow list to be synchronized.

Change-Id: I28ca4fdf48f657feaf72c928d61f4f8a5996bad8
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M ChangeLog
M src/otopi/context.py
2 files changed, 30 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/89/13689/1

diff --git a/ChangeLog b/ChangeLog
index 6033dbb..3052423 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
 ????-??-?? - Version 1.1.0
 
  * core: support non unicode command output.
+ * core: support more complex sequence relationships.
  * packagers: yum: do not enable if running non root.
  * packagers: yum: selinux: do not change type to rpm_t.
  * java: do not fail to set null environment.
diff --git a/src/otopi/context.py b/src/otopi/context.py
index 9aaa281..e60cf77 100644
--- a/src/otopi/context.py
+++ b/src/otopi/context.py
@@ -287,6 +287,7 @@
                 except ValueError:
                     return None
 
+            everModified = False
             for limit in range(400):    # boundary
                 modified = False
                 for index, metadata in enumerate(l):
@@ -295,20 +296,46 @@
                         candidateindex is not None and
                         compare(candidateindex, index)
                     ):
+                        if self.environment[constants.BaseEnv.DEBUG] > 0:
+                            print(
+                                'modifing method location %s' % (
+                                    metadata['method'],
+                                )
+                            )
                         l.insert(candidateindex+offset, metadata)
                         if candidateindex < index:
                             del l[index+1]
                         else:
                             del l[index]
                         modified = True
+                        everModified = True
                         break
                 if not modified:
                     break
             if modified:
                 raise RuntimeError(_('Sequence build loop detected'))
+            return everModified
 
-        _doit(tmplist, 'before', operator.lt, min, 0)
-        _doit(tmplist, 'after', operator.gt, max, 1)
+        for x in range(400):
+            modified = False
+            modified = modified or _doit(
+                tmplist,
+                'before',
+                operator.lt,
+                min,
+                0
+            )
+            modified = modified or _doit(
+                tmplist,
+                'after',
+                operator.gt,
+                max,
+                1
+            )
+            if not modified:
+                break
+        if modified:
+            raise RuntimeError(_('Sequence build loop detected'))
 
         sequence = {}
         for m in tmplist:


--
To view, visit http://gerrit.ovirt.org/13689
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28ca4fdf48f657feaf72c928d61f4f8a5996bad8
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to