#
get_useflaglist_ebuild() {
local known=$(echo "${ACTIVE_FLAGS[5]}" | egrep "^${1}")
+ local cacheformat
if [[ -n $known ]]; then
# No need to recache
return
fi
# Open the ebuild file and retrieve defined USE flags
[[ ! -d "$portdir/${1}" ]] && continue
- if [[ ! -d "$portdir/metadata/cache" ]]; then
+ cacheformat="unknown"
+ [[ -d "$portdir/metadata/cache" ]] && cacheformat="cache" # format is pms
+ [[ -d "$portdir/metadata/md5-cache" ]] && cacheformat="md5-cache" # format is md5-cache
+ if [[ "$cacheformat" == "unknown" ]]; then
echo "!!! Metadata cache not found. You need to run " >&2
echo "!!! 'egencache --repo=$overlay --update'" >&2
echo "!!! to generate metadata for your overlays" >&2
return 1
fi
- append=$(set +f; ls $portdir/metadata/cache/${1}-* \
+ append=$(set +f; ls ${portdir}/metadata/${cacheformat}/${1}-* \
| egrep "${1}-[0-9.]+" \
- | sed -e "s:$portdir/metadata/cache/${1}-::g" \
+ | sed -e "s:${portdir}/metadata/${cacheformat}/${1}-::g" \
| while read -d $'\n' version; do
IFS=$'\n'
- if [[ ! -e "$portdir/metadata/cache/${1}-$version" ]]; then
+ if [[ ! -e "${portdir}/metadata/${cacheformat}/${1}-$version" ]]; then
# Repo does not have this particular package
continue
fi
- iuse=$(head -11 "$portdir/metadata/cache/${1}-$version"|tail -1)
- slot=$(head -3 "$portdir/metadata/cache/${1}-$version"|tail -1)
+ if [[ "${cacheformat}" == "cache" ]]; then
+ iuse=$(head -n 11 "${portdir}/metadata/${cacheformat}/${1}-$version"|tail -n 1)
+ slot=$(head -n 3 "${portdir}/metadata/${cacheformat}/${1}-$version"|tail -n 1)
+ elif [[ "${cacheformat}" == "md5-cache" ]]; then
+ iuse=$(grep "^IUSE=" "${portdir}/metadata/${cacheformat}/${1}-$version" | sed 's/^IUSE=//')
+ slot=$(grep "^SLOT=" "${portdir}/metadata/${cacheformat}/${1}-$version" | sed 's/^SLOT=//')
+ else
+ # This is a bug, we should have already returned
+ return 1
+ fi
echo "${1};${version};${slot};${iuse};${overlay}"
done
)