fix malformed manifests on upgrade

This fixed malformed manifests on upgrade when some files are used by more than
one package.