summaryrefslogtreecommitdiffstats
path: root/pactest
diff options
context:
space:
mode:
Diffstat (limited to 'pactest')
-rwxr-xr-xpactest/pmdb.py4
-rwxr-xr-xpactest/pmpkg.py3
-rwxr-xr-xpactest/pmrule.py3
-rwxr-xr-xpactest/util.py2
4 files changed, 12 insertions, 0 deletions
diff --git a/pactest/pmdb.py b/pactest/pmdb.py
index 5d5104fb..ebde324f 100755
--- a/pactest/pmdb.py
+++ b/pactest/pmdb.py
@@ -187,6 +187,8 @@ class pmdb:
line = line.strip("\n")
if line == "%DEPENDS%":
pkg.depends = _getsection(fd)
+ elif line == "%OPTDEPENDS%":
+ pkg.optdepends = _getsection(fd)
elif line == "%REQUIREDBY%":
pkg.requiredby = _getsection(fd)
elif line == "%CONFLICTS%":
@@ -291,6 +293,8 @@ class pmdb:
data = []
if pkg.depends:
data.append(_mksection("DEPENDS", pkg.depends))
+ if pkg.optdepends:
+ data.append(_mksection("OPTDEPENDS", pkg.optdepends))
if self.treename == "local":
if pkg.requiredby:
data.append(_mksection("REQUIREDBY", pkg.requiredby))
diff --git a/pactest/pmpkg.py b/pactest/pmpkg.py
index c6859e8f..410423da 100755
--- a/pactest/pmpkg.py
+++ b/pactest/pmpkg.py
@@ -53,6 +53,7 @@ class pmpkg:
self.force = 0 # sync only (will be moved to depends)
# depends
self.depends = []
+ self.optdepends = []
self.requiredby = [] # local only
self.conflicts = []
self.provides = []
@@ -146,6 +147,8 @@ class pmpkg:
data.append("group = %s" % i)
for i in self.depends:
data.append("depend = %s" % i)
+ for i in self.optdepends:
+ data.append("optdepend = %s" % i)
for i in self.conflicts:
data.append("conflict = %s" % i)
for i in self.provides:
diff --git a/pactest/pmrule.py b/pactest/pmrule.py
index d5d0f561..c5682dc1 100755
--- a/pactest/pmrule.py
+++ b/pactest/pmrule.py
@@ -83,6 +83,9 @@ class pmrule:
elif case == "DEPENDS":
if not value in newpkg.depends:
success = 0
+ elif case == "OPTDEPENDS":
+ if not value in newpkg.optdepends:
+ success = 0
elif case == "REQUIREDBY":
if not value in newpkg.requiredby:
success = 0
diff --git a/pactest/util.py b/pactest/util.py
index d3203428..ae203747 100755
--- a/pactest/util.py
+++ b/pactest/util.py
@@ -149,6 +149,8 @@ def mkdescfile(filename, pkg):
data.append("replaces = %s" % i)
for i in pkg.depends:
data.append("depend = %s" % i)
+ for i in pkg.optdepends:
+ data.append("optdepend = %s" % i)
for i in pkg.conflicts:
data.append("conflict = %s" % i)
for i in pkg.provides: