1999-09-22 Bjorn Eriksson <mdeans@algonet.se>

* vfs/extfs/uzip.in: Better handling of zip-archives that contain files
which contain spaces.


1999-09-22  Norbert Warmuth  <nwarmuth@privat.circular.de>

* lib/mc.sh.in, mc.csh.in: renamed from mc.sh resp. mc.csh. Adapt
path to the mc binary according to @prefix@.

* lib/Makefile.in (srcdir): mc.sh and mc.csh are now created by
configure. Install mc.sh and mc.csh in $(suppbindir).

* doc/mc.1.in, mc.sgml: Updated the mc function definition for bash
and zsh. Suggest to source mc.sh or mc.csh instead of adding verbatim
copies of the included function definitions.

* mcfn_install.in: Comment out definitions of the mc functions. Source
mc.sh instead of adding an outdated mc function definition.

* configure.in: output mc.sh and mc.csh
This commit is contained in:
Norbert Warmuth 1999-09-22 22:04:45 +00:00
parent 8ede5ed5ec
commit 10c8184839
11 changed files with 134 additions and 18 deletions

View File

@ -1,3 +1,20 @@
1999-09-22 Norbert Warmuth <nwarmuth@privat.circular.de>
* lib/mc.sh.in, mc.csh.in: renamed from mc.sh resp. mc.csh. Adapt
path to the mc binary according to @prefix@.
* lib/Makefile.in (srcdir): mc.sh and mc.csh are now created by
configure. Install mc.sh and mc.csh in $(suppbindir).
* doc/mc.1.in, mc.sgml: Updated the mc function definition for bash
and zsh. Suggest to source mc.sh or mc.csh instead of adding verbatim
copies of the included function definitions.
* mcfn_install.in: Comment out definitions of the mc functions. Source
mc.sh instead of adding an outdated mc function definition.
* configure.in: output mc.sh and mc.csh
1999-09-20 Federico Mena Quintero <federico@redhat.com> 1999-09-20 Federico Mena Quintero <federico@redhat.com>
* lib/startup.links: Changed the news link to Gnotices * lib/startup.links: Changed the news link to Gnotices

View File

@ -1273,6 +1273,8 @@ icons/Makefile
lib/mc.ext lib/mc.ext
lib/mc-gnome.ext lib/mc-gnome.ext
lib/mc.sh
lib/mc.csh
mcfn_install mcfn_install
vfs/extfs/ftplist vfs/extfs/uzip vfs/extfs/uzoo vfs/extfs/lslR vfs/extfs/ulha vfs/extfs/ftplist vfs/extfs/uzip vfs/extfs/uzoo vfs/extfs/lslR vfs/extfs/ulha

View File

@ -53,13 +53,21 @@ directory; this, along with the shell function below, will allow you
to browse through your directories and automatically move to the last to browse through your directories and automatically move to the last
directory you were in (thanks to Torben Fjerdingstad and Sergey for directory you were in (thanks to Torben Fjerdingstad and Sergey for
contributing this function and the code which implements this option). contributing this function and the code which implements this option).
Please don't add verbatim copies of the function definitions below. Source the
files @prefix@/lib/mc/bin/mc.sh (bash and zsh users) respectively
@prefix@/lib/mc/bin/mc.csh (tcsh users) instead. This way you will not
need to change your profiles if the function definitions are improved,
provided that you don't compile MC with a different prefix.
.nf .nf
bash and zsh users: bash and zsh users:
mc () mc ()
{ {
MC=/tmp/mc$$-"$RANDOM" mkdir -p ~/.mc/tmp 2> /dev/null
chmod 700 ~/.mc/tmp
MC=~/.mc/tmp/mc-$$
@prefix@/bin/mc -P "$@" > "$MC" @prefix@/bin/mc -P "$@" > "$MC"
cd "`cat $MC`" cd "`cat $MC`"
rm "$MC" rm "$MC"
@ -72,7 +80,8 @@ alias mc 'setenv MC `@prefix@/bin/mc -P \!*`; cd $MC; unsetenv MC'
.TP .TP
I know the bash function could be shorter for zsh and bash but the I know the bash function could be shorter for zsh and bash but the
backquotes on bash won't accept your suspension the program with backquotes on bash won't accept your suspension the program with
C-z. C-z. The temporary file is created in the private directory ~/.mc/tmp
in order to avoid symlink attachs in a world writable /tmp.
.TP .TP
.I "\-s" .I "\-s"
Turns on the slow terminal mode, in this mode the program will not Turns on the slow terminal mode, in this mode the program will not

View File

@ -78,13 +78,20 @@ you were in (thanks to Torben Fjerdingstad and Sergey for
contributing this function and the code which implements contributing this function and the code which implements
this option). this option).
Please don't add verbatim copies of the function definitions below. Source the
files @prefix@/lib/mc/bin/mc.sh (bash and zsh users) respectively
@prefix@/lib/mc/bin/mc.csh (tcsh users) instead. This way you will not
need to change your profiles if the function definitions are improved,
provided that you don't compile MC with a different prefix.
<tscreen><verb> <tscreen><verb>
bash and zsh users: bash and zsh users:
mc () mc ()
{ {
MC=/tmp/mc$$-"$RANDOM" mkdir -p ~/.mc/tmp 2> /dev/null
chmod 700 ~/.mc/tmp
MC=~/.mc/tmp/mc$$-"$RANDOM"
@prefix@/bin/mc -P "$@" > "$MC" @prefix@/bin/mc -P "$@" > "$MC"
cd "`cat $MC`" cd "`cat $MC`"
rm "$MC" rm "$MC"
@ -97,7 +104,8 @@ alias mc 'setenv MC `@prefix@/bin/mc -P \!*`; cd $MC; unsetenv MC'
</verb></tscreen> </verb></tscreen>
I know the bash function could be shorter for zsh and bash but the I know the bash function could be shorter for zsh and bash but the
backquotes on bash won't accept your suspension the program with backquotes on bash won't accept your suspension the program with
C-z. C-z. The temporary file is created in the private directory ~/.mc/tmp
in order to avoid symlink attachs in a world writable /tmp.
<tag/-s/ Turns on the slow terminal mode, in this mode the <tag/-s/ Turns on the slow terminal mode, in this mode the
program will not draw expensive line drawing characters program will not draw expensive line drawing characters

View File

@ -13,14 +13,17 @@ INSTALL_DATA = @INSTALL_DATA@
# #
LIBFILES_IN = mc.ext.in mc-gnome.ext.in LIBFILES_IN = mc.ext.in mc-gnome.ext.in
LIBFILES_OUT = mc.ext mc-gnome.ext LIBFILES_OUT = mc.ext mc-gnome.ext mc.csh mc.sh
LIBFILES_CONST = mc.hint mc.hint.es mc.lib mc.menu LIBFILES_CONST = mc.hint mc.hint.es mc.lib mc.menu
SUPPBIN_IN = mc.csh.in mc.sh.in
SUPPBIN_OUT = mc.csh mc.sh
DESKTOP_FILES = startup.links README.desktop DESKTOP_FILES = startup.links README.desktop
TIFILES = README.xterm linux.ti xterm.ad xterm.ti ansi.ti vt100.ti xterm.tcap TIFILES = README.xterm linux.ti xterm.ad xterm.ti ansi.ti vt100.ti xterm.tcap
DISTLIB = \ DISTLIB = \
$(LIBFILES_IN) \ $(LIBFILES_IN) \
$(LIBFILES_CONST) \ $(LIBFILES_CONST) \
$(SUPPBIN_IN) \
$(TIFILES) \ $(TIFILES) \
$(DESKTOP_FILES) \ $(DESKTOP_FILES) \
Makefile.in tdiff \ Makefile.in tdiff \
@ -51,12 +54,15 @@ realclean:
distclean: distclean:
$(RMF) $(srcdir)/*~ $(srcdir)/Makefile $(RMF) $(srcdir)/*~ $(srcdir)/Makefile
for I in $(LIBFILES_OUT); do $(RMF) $(srcdir)/$$I; done for I in $(LIBFILES_OUT); do $(RMF) $(srcdir)/$$I; done
for I in $(SUPPBIN_OUT); do $(RMF) $(srcdir)/$$I; done
install: install:
for I in $(LIBFILES_CONST); \ for I in $(LIBFILES_CONST); \
do $(INSTALL_DATA) $(srcdir)/$$I $(DESTDIR)$(mclibdir)/$$I; done do $(INSTALL_DATA) $(srcdir)/$$I $(DESTDIR)$(mclibdir)/$$I; done
for I in $(LIBFILES_OUT); \ for I in $(LIBFILES_OUT); \
do $(INSTALL_DATA) $(builddir)/lib/$$I $(DESTDIR)$(mclibdir)/$$I; done do $(INSTALL_DATA) $(builddir)/lib/$$I $(DESTDIR)$(mclibdir)/$$I; done
for I in $(SUPPBIN_OUT); \
do $(INSTALL_PROGRAM) -m 755 $(builddir)/lib/$$I $(DESTDIR)$(suppbindir)//$$I; done
for I in $(TIFILES); \ for I in $(TIFILES); \
do $(INSTALL_DATA) $(srcdir)/$$I $(DESTDIR)$(tidir)/$$I; done do $(INSTALL_DATA) $(srcdir)/$$I $(DESTDIR)$(tidir)/$$I; done
$(MKINSTALLDIRS) $(DESTDIR)$(confdir) $(MKINSTALLDIRS) $(DESTDIR)$(confdir)

View File

@ -1,2 +0,0 @@
alias mc 'setenv MC `/usr/bin/mc -P \!*`; cd $MC; unsetenv MC'

2
lib/mc.csh.in Normal file
View File

@ -0,0 +1,2 @@
alias mc 'setenv MC `@prefix@/bin/mc -P \!*`; cd $MC; unsetenv MC'

View File

@ -2,8 +2,8 @@ mc ()
{ {
mkdir -p ~/.mc/tmp 2> /dev/null mkdir -p ~/.mc/tmp 2> /dev/null
chmod 700 ~/.mc/tmp chmod 700 ~/.mc/tmp
MC=~/.mc/tmp/mc$$-"$RANDOM" MC=~/.mc/tmp/mc-$$
/usr/bin/mc -P "$@" > "$MC" @prefix@/bin/mc -P "$@" > "$MC"
cd "`cat $MC`" cd "`cat $MC`"
rm "$MC" rm "$MC"
unset MC; unset MC;

View File

@ -1,6 +1,39 @@
#!/bin/sh #!/bin/sh
# #
prefix=@prefix@ prefix=@prefix@
suppbindir=@prefix@/lib/mc/bin
do_compat_replace () {
cp $1 $1.orig
if test "$?" != "0"; then
echo "Command \`cp $1 $1.orig' failed. File $1 not changed!"
return 1
fi
sed '/^mc ()/ {
# Add comment
i\
#Commented out by mc_fninstall. Source @prefix@/lib/mc/bin/mc.sh instead.
}
/^mc ()[^}]*$/,/}[; ]*$/{
# Function definition over several lines
s/^\(.*\)$/#\1/g
}
/^mc ().*}.*$/{
# Function definition on one line
s/^\(.*\)$/#\1/g
}' < $1.orig > $1
echo >> $1
echo ". $suppbindir/mc.sh" >> $1
echo ""
echo "I commented out the mc () function definitions in $1 and added"
echo "\`. $suppbindir/mc.sh'. Your previous profile has been saved as"
echo "$1.orig."
}
if test -n `echo $prefix | grep prefix`; then if test -n `echo $prefix | grep prefix`; then
prefix=/usr/local prefix=/usr/local
fi fi
@ -22,6 +55,40 @@ if test -f $PROFILE; then
B=`grep "mc ()" $BASHRC` B=`grep "mc ()" $BASHRC`
fi fi
fi fi
if test -n "$A" -o -n "$B"; then
if test -n "$B"; then
echo "While examining your $PROFILE and $BASHRC,"
else
echo "While examining your $PROFILE,"
fi
echo "I've found that you have a probably outdated mc () function definition"
echo "there. Do you want to replace this function definition with "
echo " . $suppbindir/mc.sh"
read rep
case $rep in
[Yy]*) ;;
*) exit ;;
esac
if test -n "$A"; then
do_compat_replace $PROFILE
fi
if test -n "$B"; then
do_compat_replace $BASHRC
fi
exit 0
fi
unset -f do_compat_replace
# This doesn't handle the case that $prefix changed
A=`grep "/mc.sh" $PROFILE`
B=
if test -n "$BASHRC"; then
if test -f $BASHRC; then
B=`grep "/mc.sh" $BASHRC`
fi
fi
if test -n "$A"; then if test -n "$A"; then
: :
else else
@ -36,14 +103,15 @@ if test -f $PROFILE; then
else else
echo "While examining your $PROFILE," echo "While examining your $PROFILE,"
fi fi
echo "I've found that you have no mc () function defined there." echo "I've found that you do not source $suppbindir/mc.sh there."
echo "This function enables a feature of mc(1) that when you leave mc(1)," echo "This shell script defines a function which enables a feature of mc(1)"
echo "you return to a directory where you were in mc just before exiting" echo "that when you leave mc(1), you return to a directory where you were"
echo "and not to the directory you've started mc from." echo "in mc just before exiting and not to the directory you've started mc"
echo "from."
echo "Would you like to append" echo "Would you like to append"
echo 'mc () { MC=`'$prefix'/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC };' echo "test -f $suppbindir/mc.sh && . $suppbindir/mc.sh"
if test -n "$BASHRC"; then if test -n "$BASHRC"; then
echo "function to your (p) $PROFILE (mc function will be active in your login shells)" echo "to your (p) $PROFILE (mc function will be active in your login shells)"
echo -n "or to your (b) $BASHRC (in every bash instance) or (n) no? [p|b|n] " echo -n "or to your (b) $BASHRC (in every bash instance) or (n) no? [p|b|n] "
else else
echo -n "function to your $PROFILE? [y|n] " echo -n "function to your $PROFILE? [y|n] "
@ -55,11 +123,12 @@ if test -f $PROFILE; then
INITFILE=$PROFILE INITFILE=$PROFILE
fi fi
case $rep in case $rep in
[Nn]*) exit ;; [Yy]*) ;;
[Pp]*) INITFILE=$PROFILE ;; [Pp]*) INITFILE=$PROFILE ;;
*) exit 1;;
esac esac
echo >>$INITFILE echo >>$INITFILE
echo 'mc () { MC=`'$prefix'/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC };' >>$INITFILE echo 'test -f $suppbindir/mc.sh && . $suppbindir/mc.sh' >>$INITFILE
echo "mc () function appended to your $INITFILE" echo "mc () function appended to your $INITFILE"
fi fi
fi fi

View File

@ -1,3 +1,8 @@
1999-09-22 Bjorn Eriksson <mdeans@algonet.se>
* extfs/uzip.in: Better handling of zip-archives that contain files
which contain spaces.
1999-09-19 Norbert Warmuth <nwarmuth@privat.circular.de> 1999-09-19 Norbert Warmuth <nwarmuth@privat.circular.de>
* ftpfs.c (ftpfs_set_debug), vfs.h: added const qualifier. * ftpfs.c (ftpfs_set_debug), vfs.h: added const qualifier.

View File

@ -67,7 +67,7 @@ if ($8 ~ /^\^/)
if ($8 ~ /\/$/) if ($8 ~ /\/$/)
printf "drwxr-xr-x 1 %-8d %-8d %8d %s %s %s\n", uid, 0, $1, $5, $6, $8 printf "drwxr-xr-x 1 %-8d %-8d %8d %s %s %s\n", uid, 0, $1, $5, $6, $8
else else
printf "-rw-r--r-- 1 %-8d %-8d %8d %s %s %s\n", uid, 0, $1, $5, $6, $8 printf "-rw-r--r-- 1 %-8d %-8d %8d %s %s %s\n", uid, 0, $1, $5, $6, substr($0, index($0, $7) + length($7 " ")
}' 2>/dev/null }' 2>/dev/null
fi fi
} }