 			}
 
 		# We'll flip a and b to make the newest versions first
-		pkgs = pkgs.sort (b,a)->
+		.sort (b,a)->
 			name_order = a.name.localeCompare(b.name)
 			if name_order is 0
 				Mandrill.util.versionCompare a.version, b.version

		'/pkg.png'


Template.manifest_installer_item.pkg_display_name = ->
	pkg = MunkiPkgsinfo.findOne({'dom.name': this.toString().split('-')[0]})
	if pkg? and pkg.dom? and pkg.dom.display_name?
		pkg.dom.display_name


Template.manifest_installer_item.pkg_name_is_valid = ->
	MunkiPkgsinfo.findOne({'dom.name': this.toString()})?


	else
		[]

# Returns the glyphicon-{{glyph}} appropriate for the category.
Template.manifest_installer_item.glyph = ->
	glyphs = {
		'managed_installs': 'save'
