[linux] 03/07: debian/lib/python: Add support for package relation restrictions

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Tue Nov 10 13:53:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux.

commit 3d3a4891f71dc2db03f6323a69f618d94cb11992
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Tue Nov 10 12:41:47 2015 +0000

    debian/lib/python: Add support for package relation restrictions
---
 debian/lib/python/debian_linux/debian.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/debian/lib/python/debian_linux/debian.py b/debian/lib/python/debian_linux/debian.py
index e58b782..b916463 100644
--- a/debian/lib/python/debian_linux/debian.py
+++ b/debian/lib/python/debian_linux/debian.py
@@ -284,7 +284,7 @@ class PackageRelationGroup(list):
     def _search_value(self, value):
         for i, j in zip(self, value):
             if i.name != j.name or i.operator != j.operator or \
-               i.version != j.version:
+               i.version != j.version or i.restrictions != j.restrictions:
                 return None
         return self
 
@@ -310,9 +310,9 @@ class PackageRelationGroup(list):
 
 
 class PackageRelationEntry(object):
-    __slots__ = "name", "operator", "version", "arches"
+    __slots__ = "name", "operator", "version", "arches", "restrictions"
 
-    _re = re.compile(r'^(\S+)(?: \((<<|<=|=|!=|>=|>>)\s*([^)]+)\))?(?: \[([^]]+)\])?$')
+    _re = re.compile(r'^(\S+)(?: \((<<|<=|=|!=|>=|>>)\s*([^)]+)\))?(?: \[([^]]+)\])?(?: <([^>]+)>)?$')
 
     class _operator(object):
         OP_LT = 1
@@ -371,6 +371,8 @@ class PackageRelationEntry(object):
             ret.extend((' (', str(self.operator), ' ', self.version, ')'))
         if self.arches:
             ret.extend((' [', ' '.join(self.arches), ']'))
+        if self.restrictions:
+            ret.extend((' <', ' '.join(self.restrictions), '>'))
         return ''.join(ret)
 
     def parse(self, value):
@@ -388,6 +390,10 @@ class PackageRelationEntry(object):
             self.arches = re.split('\s+', match[3])
         else:
             self.arches = []
+        if match[4] is not None:
+            self.restrictions = re.split('\s+', match[4])
+        else:
+            self.restrictions = []
 
 
 class Package(dict):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list