removing line: export -f mc from /usr/lib/mc/mc.sh will allow the script to be loaded from .bashrc (giving you changedir capability, i mean: mc will chdir to its latest working dir at exit) without having portage to spurt out warning during emerge.
Ok I really don't think I understand what you want to do here? Are you also talking about /usr/lib/mc/bin/mc.sh right? since there isn't mc.sh in /usr/lib/mc.. and what warning are you getting?
mc.sh is provided in /usr/lib/mc/bin. I modified my ~/.bashrc to load also mc.sh (as it happen on RedHat) ; this change allows MC to change directory to the last one used into MC as you exit MC. (you invoke mc into /usr, then into MC you move to /etc and exit MC, you now are in /etc). Problem is that gentoo's mc.sh have and "export -f mc" line at bottom of it which causes the mc alias function to be sourced into env; this will cause portage generate warnings every time you emerge a package. infact, loading mc.sh via .bashrc will perfectly work without the "export -f mc". i can supply my scripts to let you understand, if needed. and oh, yes, this is really a "cosmetic" fix. HTH
oops...mouse wheel made konqueror change forms...restoring bug as "normal" and "opened" . sorry.
Yeah just send it to me please and maybe a sample of anything else to get it working .. the appropriate lines from .bashrc? maybe naz
Whats up here ?
Martin: I don't know, i sent my fix to Michael in july...and that's all :)
Hrm .. problem is that we do not have a /etc/profile.d/ ... Another way is to create a /usr/bin/mc wrapper that sources that, and then calls say /usr/bin/mc-bin
Alessandro, any suggestions ? Would the wrapper resolve the issue ?
don't know : i tried the wrapper some time ago and it didn't work... btw i'll check it as soon as I'll be able to resurrect my gentoo hd (rad: probably on monday/tuesday), which is currently down due to an hardware failure (damn!). bye! alessandro
just tested: no, the wrapper thing won't work :( if someone want to use my solution on his own i can attach here a tar.gz with all the needed files (basically: /etc/profile.d/mc.sh, /etc/bashrc and a modified /etc/skel/.bashrc which needs to be copied to ~/.bashrc) bye, Alessandro
Dang, I can't find the files you sent me, it seems that there should a easy way around this issue, just need to apply some thought
Michael: i can send you the .tar.gz again, if you want.... or better: i'm gonna dump them here: 1: /etc/bashrc ----> # /etc/bashrc for i in /etc/profile.d/*.sh; do if [ -x $i ]; then . $i fi done # include this, so also xterm,kterm,gterm,etc will have default bash settings if [ "x$SHLVL" != "x1" ]; then # We're not a login shell source /etc/profile fi # vim:ts=4:sw=4 <---- 2: /etc/profile.d (directory) 3: /etc/profile.d/mc.sh (<- please note: this is NOT the same as /usr/lib/mc/bin/mc.sh since it won't work) ---> # this is a slightly modified version of /usr/lib/mc/mc.sh which fixes # problems with portage when this script is included into the bash env mc () { mkdir -p $HOME/.mc/tmp 2> /dev/null chmod 700 $HOME/.mc/tmp MC=$HOME/.mc/tmp/mc-$$ /usr/bin/mc -P "$@" > "$MC" cd "`cat $MC`" rm -f "$MC" unset MC; } <--- 4: add this at bottom of /etc/skel/.bashrc (and so also my ~/.bashrc ) ----> if [ -f /etc/bashrc ]; then . /etc/bashrc fi <---- HTH, Alessandro
Well I created a file in /etc/ called mc.env which contains: # /etc/mc.env # This variable can be set to mc.sh or mc.csh depending on your shell. MC_ENV=/usr/lib/mc/bin/mc.sh for i in $MC_ENV; do if [ -x $i ]; then . $i fi done # include this, so also xterm,kterm,gterm,etc will have default bash settings if [ "x$SHLVL" != "x1" ]; then # We're not a login shell source /etc/profile fi With that completed I copied /usr/lib/mc/bin/mc.sh to mc.sh.bak and edited out export line then sourced it from with .bashrc which contains if [ -f /etc/mc.env ]; then . /etc/mc.env fi This seems to work ok for me. Care to test? I'm thinking that maybe we should maybe consider setting a enviroment variable with a script in env.d which will just source in the fixed mc.sh script. I'm not sure if that will work.. but I will test in a little bit.
tested: your solution work as expected... btw, i like the env.d idea much better since users wouldn't have to mess up their .bashrc bye, Alessandro
Commited to additions to portage for testing. Naz
please note that mc 4.6.x needs a slighlty different syntax: instead of: /usr/bin/mc -P "$@" > "$MC" use: /usr/bin/mc -P "$MC" bye, Alessandro
Michael : just checked it: please change syntax of the file as suggested in comment #16 sinec the current one is wrong in mc 4.6.0 (it will cause mc to crash on startup using -P "$@" > "$MC" instead of the new -P "$MC" alessandro