diff options
author | 2010-07-03 07:42:04 +0300 | |
---|---|---|
committer | 2010-07-03 07:43:04 +0300 | |
commit | c556978fe195b2a6d90849c66e771fa623ccbbf0 (patch) | |
tree | ba32b492ebab80194418a08d32b2f4a6a578f711 /utils | |
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 'utils')
-rwxr-xr-x | utils/grumpy_sync.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/utils/grumpy_sync.py b/utils/grumpy_sync.py index 8c8f998..3ffdbb4 100755 --- a/utils/grumpy_sync.py +++ b/utils/grumpy_sync.py @@ -38,20 +38,12 @@ def main(path): """Rename package and its ebuild in database.""" srccat, srcpkg = src.split('/') dstcat, dstpkg = dst.split('/') - package = Package.query.filter_by(cat=srccat) \ - .filter_by(pkg=srcpkg).first() - if not package: - return - # Make renames in package and ebuild info - cp = "%s/%s" % (dstpkg, dstcat) print "DEBUG: Handling package move: %s/%s -> %s/%s" % \ (srccat, srcpkg, dstcat, dstpkg) - package.cat = dstcat - package.pkg = dstpkg - package.cp = cp - for ebuild in package.ebuilds: - ebuild.cpv = "%s-%s" % (cp, ebuild.version) - session.commit() + package = Package.query.filter_by(cat=srccat) \ + .filter_by(pkg=srcpkg).first() + if package: + package.rename(dstcat, dstpkg) # Read package move information movedir = os.path.join(path, 'profiles', 'updates') |