#!/bin/bash # Copyright 2015 Gentoo Foundation # Distributed under the terms of the GNU GPL version 2 or later # Author: Markos Chandras tmpfile="/tmp/mn-pkglist$$.tmp" rdepdir=$1 cleanup () { [[ -e ${tmpfile} ]] && rm ${tmpfile} } portageq --no-filters --orphaned -n > ${tmpfile} || { cleanup; exit 1; } echo """ Orphan packages List generated on $(date)
Total packages: $(wc -l ${tmpfile} | cut -d ' ' -f1)

""" while read pkg; do echo """ """ done < ${tmpfile} echo """
Package Name Description Open bugs R-revdeps D-revdeps P-revdeps
${pkg} $(pquery --no-version --one-attr description ${pkg}) Open Bugs $(cat ${rdepdir}/rindex/${pkg} 2>/dev/null | wc -l) $(cat ${rdepdir}/dindex/${pkg} 2>/dev/null | wc -l) $(cat ${rdepdir}/pindex/${pkg} 2>/dev/null | wc -l)
""" cleanup exit 0