#!/bin/bash # This function will work for all X libraries named lib${foo} and matching # protocol headers named ${foo}proto. # Feed it 1=${foo}, and optionally 2=${bar} for a different library name from # the proto name. newxdepend() { headers=${1#X}proto library=lib${2:-${1}} DEPEND="${DEPEND} x11-libs/${library} x11-headers/${headers}" RDEPEND="${RDEPEND} x11-libs/${library}" } newxdepend ${1} ${2} echo DEPEND=$DEPEND echo RDEPEND=$RDEPEND