|
Lines 20-31
Link Here
|
| 20 |
# |
20 |
# |
| 21 |
_portdir() |
21 |
_portdir() |
| 22 |
{ |
22 |
{ |
|
|
23 |
local nlines layman_conf |
| 24 |
|
| 23 |
sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \ |
25 |
sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \ |
| 24 |
/etc/make.{conf,globals} 2>/dev/null |
26 |
/etc/make.{conf,globals} 2>/dev/null |
| 25 |
|
27 |
|
| 26 |
if [[ $1 == '-o' ]] ; then |
28 |
if [[ $1 == '-o' ]] ; then |
| 27 |
sed -n -e '/^PORTDIR_OVERLAY=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \ |
29 |
sed -n -e '/^PORTDIR_OVERLAY=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \ |
| 28 |
/etc/make.conf 2>/dev/null |
30 |
/etc/make.conf 2>/dev/null |
|
|
31 |
layman_conf="/usr/portage/local/layman/make.conf" |
| 32 |
if [[ -f ${layman_conf} ]] ; then |
| 33 |
nlines=$(wc -l ${layman_conf} | sed -e "s:\([0-9]\+\).*:\1:g") |
| 34 |
tail -n $[ $nlines - 1 ] ${layman_conf} | head -n $[ $nlines - 3 ] |
| 35 |
fi |
| 29 |
fi |
36 |
fi |
| 30 |
} |
37 |
} |
| 31 |
|
38 |
|