On 04/ 7/11 07:19 PM, Dan Mick wrote:
If anyone else absolutely loathes, like me, the new "pkg must have -R" behavior,
here's a script to restore the old default ('operate on the image you're in').
#!/bin/ksh
if [[ "$@" == "version" ]] ; then /bin/pkg version; exit $?; fi
d=$(pwd)
imgroot=$(
while [[ true ]] ; do
if [[ -d $d/var/pkg ]]
then
if [[ "$d" != /* ]] then d=/$d; fi
echo "$d"
break
fi
if [[ "$d" == "/" ]]; then break; fi
d=${d%/*}
done
)
echo "/bin/pkg -R $imgroot $@"
/bin/pkg -R $imgroot "$@"
This is better; don't have to specially call out version:
#!/bin/ksh
d=$(pwd)
imgroot=$(
while [[ true ]] ; do
if [[ -d $d/var/pkg ]]
then
if [[ "$d" != /* ]] then d=/$d; fi
echo "$d"
break
fi
if [[ "$d" == "/" ]]; then break; fi
d=${d%/*}
done
)
echo "PKG_IMAGE=$imgroot"
PKG_IMAGE=$imgroot /bin/pkg "$@"
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss