Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

change to ebuild dirs easily

x ~ # which cde
cde () {
        [ $# -ne 1 ] && {
                echo "Usage: cde <package atom>"
                return 1
        }
        local cand
        local sel
        cand=($(for tree in $(portageq portdir) $(portageq portdir_overlay) ; do
                        find $tree -mindepth 2 -maxdepth 2 -type d | grep "${1}" | sort
                done))
        case $#cand in
                (0) echo "no match found"
                        return 1 ;;
                (1) sel=$cand[1]  ;;
                (*) until [ -n "$sel" ]
                        do
                                sel=$(zselect2 $cand)
                        done ;;
        esac
        [ -n "$sel" ] && {
                zexecverbose cd $sel
                return $?
        }
}

x squashfs-tools # cde binutils
1) /usr/portage/dev-embedded/msp430-binutils                                  
2) /usr/portage/sys-devel/binutils                                            
3) /usr/portage/sys-devel/binutils-apple                                      
4) /usr/portage/sys-devel/binutils-config                                     
5) /usr/portage/sys-devel/binutils-hppa64                                     
>2
cd /usr/portage/sys-devel/binutils
x binutils #

x binutils # cde trivdm 
cd /var/lib/xmw-overlay/x11-misc/trivdm
x trivdm #

[1] https://xmw.de/dotfiles/.zshrc
Tags: own linux

Don't be the product, buy the product!

Schweinderl