g_sorcery/package_db: fix a stupid bug in sync function