Don't query for full details of a package. It is sufficient to output the name and version. This also simplifies parsing the output.