* 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):
|
def version_bump(self, *args):
|
||||||
for with in args:
|
for with in args:
|
||||||
if with.types == CONFLICT and with.action == ADDED:
|
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:
|
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:
|
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:
|
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.pspec.update_history(self.date, self.version)
|
||||||
self.actions.name = self.name
|
self.actions.name = self.name
|
||||||
|
|||||||
@@ -33,12 +33,15 @@ def repo_added_package(package, *args):
|
|||||||
|
|
||||||
for with in args:
|
for with in args:
|
||||||
if with.types == CONFLICT and with.action == INIT:
|
if with.types == CONFLICT and with.action == INIT:
|
||||||
conflicts = with.pkgs
|
conflicts = with.data
|
||||||
|
|
||||||
if with.types == DEPENDENCY and with.action == INIT:
|
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):
|
def repo_removed_package(package):
|
||||||
if not repodb.has_key(package):
|
if not repodb.has_key(package):
|
||||||
|
|||||||
@@ -13,19 +13,22 @@
|
|||||||
# Authors: Faik Uygur <faik@pardus.org.tr>
|
# Authors: Faik Uygur <faik@pardus.org.tr>
|
||||||
|
|
||||||
ADDED, REMOVED, INIT = range(3)
|
ADDED, REMOVED, INIT = range(3)
|
||||||
CONFLICT, DEPENDENCY = range(2)
|
VERSION, CONFLICT, DEPENDENCY = range(3)
|
||||||
|
|
||||||
class with:
|
class with:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def with_action(types, action, pkgs):
|
def with_action(types, action, data):
|
||||||
w = with()
|
w = with()
|
||||||
w.types = types
|
w.types = types
|
||||||
w.action = action
|
w.action = action
|
||||||
w.pkgs = pkgs
|
w.data = data
|
||||||
return w
|
return w
|
||||||
|
|
||||||
|
def with_version(version):
|
||||||
|
return with_action(VERSION, INIT, version)
|
||||||
|
|
||||||
def with_conflicts(*cons):
|
def with_conflicts(*cons):
|
||||||
return with_action(CONFLICT, INIT, cons)
|
return with_action(CONFLICT, INIT, cons)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user