-- libdbpp:no-cursor
UPDATE gentoobrowse.ebuilds e SET
	slot = ?,
	license = ?,
	moddate = ?
FROM gentoobrowse.packages p, gentoobrowse.categories c
WHERE c.categoryid = p.categoryid
AND e.packageid = p.packageid
AND e.repoid = ?
AND c.name = ?
AND p.name = ?
AND e.version = ?
RETURNING ebuildid, NOT EXISTS (
		SELECT FROM gentoobrowse.ebuilds ve
		WHERE ve.packageid = e.packageid
		AND ve.versioninst > e.versioninst
	), e.packageid
