1) Make sure there are no USE= in your make.conf 2) Interactively update your use flags (would be better with a menu akin to etc-update) 3) Watch the sed expression fail: 'sed: -e expression #1, char 696: No previous regular expression' Below is a diff to fix it. --- useflag.orig Tue Jul 30 16:02:08 2002 +++ useflag Tue Jul 30 16:02:50 2002 @@ -159,6 +159,7 @@ do_write_make() { local use_write="USE=\"$@\"" local old_use="USE=\"`do_get_make dashes`\"" + [ -z "${old_use}" ] && olduse="" if [ -w ${make_conf} ] && [ -w ${make_conf_dir} ]; then local use_write="USE=\"$@\"" local old_use=`grep "USE=\"" ${make_conf} | grep -v "#"`
Futher testing shows 1) that diff didn't fix it... and 2) it doesn't matter hwo you choose to set it...as long as USE is non-existant, sed fails
I didn't write "useflag;" assigning to karltk who probably knows who wrote it.
How about USE=${USE} somewhere before the sed expression? guarentees declaration...
Once you've written a fix for this, please attach your patch and reassign the bug back to me so that I may include it into Gentoolkit ASAP.
--- useflag.orig Tue Jul 30 12:02:08 2002 +++ useflag Sun Aug 4 17:53:25 2002 @@ -164,6 +164,13 @@ local old_use=`grep "USE=\"" ${make_conf} | grep -v "#"` local start_line=`grep -n "USE=\"" ${make_conf} | \ grep -v "#" | cut -d ":" -f1` + if [ -z "${old_use}" ]; then + echo "No USE=\"\" in ${make_conf}" + old_use='USE=""' + cp ${make_conf} ${make_temp} && \ + echo ${old_use} >> ${make_temp} && \ + mv ${make_temp} ${make_conf} + fi if [ "${old_use:0-1}" != "\\" ]; then sed -e "s/${old_use}/${use_write}/" ${make_conf} > \ ${make_temp}
I've read through the latest useflag code. It needs major rework to be even remotely safe. I have removed it from gentoolkit pending a major overhaul. I don't feel comfortable with it clearing out my /etc/make.conf consistently when I do: useflag -a foo It always does this if make.conf looks like USE="foo bar baz bax" Which is very common when one has a good collection of useflags.
I guess this one is invalidated by your useflag rewrite ;)