diff options
Diffstat (limited to 'utils/grumpy_sync.py')
-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') |