Ough. This code is actually taken from a puppet module I'm developing as a concept-proof (its called packagex). Will correct it.