Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 103627 - gentoo-bashcomp confused by multiline PORTDIR_OVERLAY
Summary: gentoo-bashcomp confused by multiline PORTDIR_OVERLAY
Status: RESOLVED DUPLICATE of bug 100373
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-24 14:39 UTC by Ed Catmur
Modified: 2005-08-25 02:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2005-08-24 14:39:32 UTC
$ emerge app-<tab>
$ emerge app-bash: cd: \: No such file or directory

In /etc/make.conf:
PORTDIR_OVERLAY="                           \
/srv/gentoo/trees/bmg-main/                 \
/srv/gentoo/trees/gentopia/                 \
/srv/gentoo/trees/lila-artwork/             \
/srv/gentoo/trees/kernel-sources/           \
/srv/gentoo/trees/bugs.gentoo.org/          \
/srv/gentoo/trees/gst-plugins.catmur.co.uk/ \
/srv/gentoo/trees/auto-unmask/              \
/srv/gentoo/trees/capella.catmur.co.uk/     \
"

Problem is the _portdir() function in /etc/bash_completion.d/gentoo:

_portdir()
{
    sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \
        /etc/make.{conf,globals} 2>/dev/null

    if [[ $1 == '-o' ]] ; then
        sed -n -e '/^PORTDIR_OVERLAY=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ;
q }' \
            /etc/make.conf 2>/dev/null
    fi
}

far easier to source the file in a subshell then echo the variable:

_portdir()
{
    ( source /etc/make.globals; source /etc/make.conf
    echo $PORTDIR ) 2>/dev/null

    if [[ $1 == '-o' ]] ; then
        ( source /etc/make.conf; echo $PORTDIR_OVERLAY ) 2>/dev/null
    fi
}
Comment 1 Ciaran McCreesh 2005-08-25 02:51:56 UTC

*** This bug has been marked as a duplicate of 100373 ***