diff options
author | 2010-08-10 23:17:20 +0300 | |
---|---|---|
committer | 2010-08-10 23:17:20 +0300 | |
commit | 35a226fbbb2d366e70d333c7bdbbb2e1044e9645 (patch) | |
tree | bc2d432a74a0875f8bc7c09732ee7fdc9f2e9344 | |
parent | Implement package rename (diff) | |
download | gsoc2010-grumpy-35a226fbbb2d366e70d333c7bdbbb2e1044e9645.tar.gz gsoc2010-grumpy-35a226fbbb2d366e70d333c7bdbbb2e1044e9645.tar.bz2 gsoc2010-grumpy-35a226fbbb2d366e70d333c7bdbbb2e1044e9645.zip |
Readd Package.rename support to syncer
-rwxr-xr-x | utils/grumpy_sync.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/utils/grumpy_sync.py b/utils/grumpy_sync.py index 7457bda..6647ded 100755 --- a/utils/grumpy_sync.py +++ b/utils/grumpy_sync.py @@ -36,15 +36,11 @@ def main(path): def package_move(src, dst): """Rename package and its ebuild in database.""" - raise NotImplementedError - srccat, srcpkg = src.split('/') - dstcat, dstpkg = dst.split('/') - print "DEBUG: Handling package move: %s/%s -> %s/%s" % \ - (srccat, srcpkg, dstcat, dstpkg) - package = Package.query.filter_by(cat=srccat) \ - .filter_by(pkg=srcpkg).first() - if package: - package.rename(dstcat, dstpkg) + print "DEBUG: Renaming package: %s -> %s" % (src, dst) + package = Package.query.filter_by(key=src).first() + assert package != None + package.rename(dst) + db.session.commit() # Read package move information movedir = os.path.join(path, 'profiles', 'updates') |