#!/bin/bash # Copyright 2007 Timothy Redaelli # Distributed under the terms of the GNU General Public License v2 function extract_metadata() { while read i; do KEY=${i%%=*} VALUE=${i#*=} eval "${KEY}"='${VALUE}' done < "$1" echo "${DEPEND}" echo "${RDEPEND}" echo "${SLOT}" echo "${SRC_URI}" echo "${RESTRICT}" echo "${HOMEPAGE}" echo "${LICENSE}" echo "${DESCRIPTION}" echo "${KEYWORDS}" echo "${_eclasses_}" | awk '{for (i = 1; i <= NF - 3; i+=3) printf ("%s ", $i); print $i}' echo "${IUSE}" echo "" echo "${PDEPEND}" echo "${PROVIDE}" echo "${EAPI:-0}" } portdir=$(portageq portdir) rm -rf "${portdir}/metadata/cache/" while read i; do FILE="${portdir}/metadata/cache/${i#/var/cache/edb/dep${portdir}}" DIR=${FILE%/*} [[ -d "${DIR}" ]] || mkdir -p "${DIR}" extract_metadata "${i}" > "${FILE}" done < <(find /var/cache/edb/dep"${portdir}" -type f)