1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-12 04:15:06 -05:00

Added optdepends support to pactest

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Jeff Mickey 2007-11-02 18:26:31 -04:00 committed by Dan McGee
parent ccdf29ffa8
commit bcb5465b21
4 changed files with 12 additions and 0 deletions

View File

@ -187,6 +187,8 @@ class pmdb:
line = line.strip("\n") line = line.strip("\n")
if line == "%DEPENDS%": if line == "%DEPENDS%":
pkg.depends = _getsection(fd) pkg.depends = _getsection(fd)
elif line == "%OPTDEPENDS%":
pkg.optdepends = _getsection(fd)
elif line == "%REQUIREDBY%": elif line == "%REQUIREDBY%":
pkg.requiredby = _getsection(fd) pkg.requiredby = _getsection(fd)
elif line == "%CONFLICTS%": elif line == "%CONFLICTS%":
@ -291,6 +293,8 @@ class pmdb:
data = [] data = []
if pkg.depends: if pkg.depends:
data.append(_mksection("DEPENDS", pkg.depends)) data.append(_mksection("DEPENDS", pkg.depends))
if pkg.optdepends:
data.append(_mksection("OPTDEPENDS", pkg.optdepends))
if self.treename == "local": if self.treename == "local":
if pkg.requiredby: if pkg.requiredby:
data.append(_mksection("REQUIREDBY", pkg.requiredby)) data.append(_mksection("REQUIREDBY", pkg.requiredby))

View File

@ -53,6 +53,7 @@ class pmpkg:
self.force = 0 # sync only (will be moved to depends) self.force = 0 # sync only (will be moved to depends)
# depends # depends
self.depends = [] self.depends = []
self.optdepends = []
self.requiredby = [] # local only self.requiredby = [] # local only
self.conflicts = [] self.conflicts = []
self.provides = [] self.provides = []
@ -146,6 +147,8 @@ class pmpkg:
data.append("group = %s" % i) data.append("group = %s" % i)
for i in self.depends: for i in self.depends:
data.append("depend = %s" % i) data.append("depend = %s" % i)
for i in self.optdepends:
data.append("optdepend = %s" % i)
for i in self.conflicts: for i in self.conflicts:
data.append("conflict = %s" % i) data.append("conflict = %s" % i)
for i in self.provides: for i in self.provides:

View File

@ -83,6 +83,9 @@ class pmrule:
elif case == "DEPENDS": elif case == "DEPENDS":
if not value in newpkg.depends: if not value in newpkg.depends:
success = 0 success = 0
elif case == "OPTDEPENDS":
if not value in newpkg.optdepends:
success = 0
elif case == "REQUIREDBY": elif case == "REQUIREDBY":
if not value in newpkg.requiredby: if not value in newpkg.requiredby:
success = 0 success = 0

View File

@ -149,6 +149,8 @@ def mkdescfile(filename, pkg):
data.append("replaces = %s" % i) data.append("replaces = %s" % i)
for i in pkg.depends: for i in pkg.depends:
data.append("depend = %s" % i) data.append("depend = %s" % i)
for i in pkg.optdepends:
data.append("optdepend = %s" % i)
for i in pkg.conflicts: for i in pkg.conflicts:
data.append("conflict = %s" % i) data.append("conflict = %s" % i)
for i in pkg.provides: for i in pkg.provides: