diff options
author | Priit Laes <plaes@plaes.org> | 2010-07-03 07:42:04 +0300 |
---|---|---|
committer | Priit Laes <plaes@plaes.org> | 2010-07-03 07:43:04 +0300 |
commit | c556978fe195b2a6d90849c66e771fa623ccbbf0 (patch) | |
tree | ba32b492ebab80194418a08d32b2f4a6a578f711 /grumpy/models.py | |
parent | Fix invalid arguments to main (should've tested first) :P (diff) | |
download | gsoc2010-grumpy-c556978fe195b2a6d90849c66e771fa623ccbbf0.tar.gz gsoc2010-grumpy-c556978fe195b2a6d90849c66e771fa623ccbbf0.tar.bz2 gsoc2010-grumpy-c556978fe195b2a6d90849c66e771fa623ccbbf0.zip |
Move Package and Ebuild rename into models
Diffstat (limited to 'grumpy/models.py')
-rw-r--r-- | grumpy/models.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/grumpy/models.py b/grumpy/models.py index b530503..f22b42b 100644 --- a/grumpy/models.py +++ b/grumpy/models.py @@ -154,3 +154,12 @@ class Package(Base): def __repr__(self): return '<%s> - %s' % (self.__class__.__name__, self.cp) + + def rename(self, newcat, newpkg): + """Rename package and its ebuilds""" + cp = "%s/%s" % (newpkg, newcat) + self.cat = newcat + self.pkg = newpkg + self.cp = cp + for ebuild in self.ebuilds: + ebuild.cpv = "%s-%s" % (cp, ebuild.version) |