* this solves the versioning.
* now we have to solve depedencies(gt,ge) issues.
This commit is contained in:
@@ -70,16 +70,19 @@ class Package:
|
||||
def version_bump(self, *args):
|
||||
for with in args:
|
||||
if with.types == CONFLICT and with.action == ADDED:
|
||||
self.pspec.add_conflicts(with.pkgs)
|
||||
self.pspec.add_conflicts(with.data)
|
||||
|
||||
if with.types == CONFLICT and with.action == REMOVED:
|
||||
self.pspec.remove_conflicts(with.pkgs)
|
||||
self.pspec.remove_conflicts(with.data)
|
||||
|
||||
if with.types == DEPENDENCY and with.action == ADDED:
|
||||
self.pspec.add_dependencies(with.pkgs)
|
||||
self.pspec.add_dependencies(with.data)
|
||||
|
||||
if with.types == DEPENDENCY and with.action == REMOVED:
|
||||
self.pspec.remove_dependencies(with.pkgs)
|
||||
self.pspec.remove_dependencies(with.data)
|
||||
|
||||
if with.types == VERSION and with.action == INIT:
|
||||
self.version = with.data
|
||||
|
||||
self.pspec.update_history(self.date, self.version)
|
||||
self.actions.name = self.name
|
||||
|
||||
@@ -33,12 +33,15 @@ def repo_added_package(package, *args):
|
||||
|
||||
for with in args:
|
||||
if with.types == CONFLICT and with.action == INIT:
|
||||
conflicts = with.pkgs
|
||||
conflicts = with.data
|
||||
|
||||
if with.types == DEPENDENCY and with.action == INIT:
|
||||
dependencies = with.pkgs
|
||||
dependencies = with.data
|
||||
|
||||
repodb[package] = Package(package, dependencies, conflicts)
|
||||
if with.types == VERSION and with.action == INIT:
|
||||
version = with.data
|
||||
|
||||
repodb[package] = Package(package, dependencies, conflicts, ver=version)
|
||||
|
||||
def repo_removed_package(package):
|
||||
if not repodb.has_key(package):
|
||||
|
||||
@@ -13,19 +13,22 @@
|
||||
# Authors: Faik Uygur <faik@pardus.org.tr>
|
||||
|
||||
ADDED, REMOVED, INIT = range(3)
|
||||
CONFLICT, DEPENDENCY = range(2)
|
||||
VERSION, CONFLICT, DEPENDENCY = range(3)
|
||||
|
||||
class with:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def with_action(types, action, pkgs):
|
||||
def with_action(types, action, data):
|
||||
w = with()
|
||||
w.types = types
|
||||
w.action = action
|
||||
w.pkgs = pkgs
|
||||
w.data = data
|
||||
return w
|
||||
|
||||
def with_version(version):
|
||||
return with_action(VERSION, INIT, version)
|
||||
|
||||
def with_conflicts(*cons):
|
||||
return with_action(CONFLICT, INIT, cons)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user