#!/bin/bash OVERLAY=/home/randk/.portage-local/ CATEGORY=$1 EBUILD=$2 PKGDIR=$(echo $EBUILD | awk -F- '{print $1 "-" $2}') # Usage - displays if full argument isn't given. if [[ -z "$EBUILD" ]]; then echo "ebuild2overlay " exit; fi # Category directory exists? If not create directory. cd $OVERLAY if ls | grep "$CATEGORY" > /dev/null; then echo " * Category directory already created."; else mkdir "$CATEGORY" echo " * Category directory created." fi # Package directory exists? If not create directory. cd $OVERLAY/$CATEGORY if ls | grep "$PKGDIR" > /dev/null; then echo " * Package directory already created."; else mkdir "$PKGDIR" echo " * Package directory created." fi # Move ebuild to overlay, keyword ppc arch, digest cd $OVERLAY$CATEGORY/$PKGDIR mv ~/Desktop/"$EBUILD" . ekeyword ~ppc "$EBUILD" sudo ebuild "$EBUILD" digest