mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
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:
parent
8ede5ed5ec
commit
10c8184839
17
ChangeLog
17
ChangeLog
@ -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>
|
||||
|
||||
* lib/startup.links: Changed the news link to Gnotices
|
||||
|
@ -1273,6 +1273,8 @@ icons/Makefile
|
||||
|
||||
lib/mc.ext
|
||||
lib/mc-gnome.ext
|
||||
lib/mc.sh
|
||||
lib/mc.csh
|
||||
|
||||
mcfn_install
|
||||
vfs/extfs/ftplist vfs/extfs/uzip vfs/extfs/uzoo vfs/extfs/lslR vfs/extfs/ulha
|
||||
|
13
doc/mc.1.in
13
doc/mc.1.in
@ -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
|
||||
directory you were in (thanks to Torben Fjerdingstad and Sergey for
|
||||
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
|
||||
|
||||
bash and zsh users:
|
||||
|
||||
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"
|
||||
cd "`cat $MC`"
|
||||
rm "$MC"
|
||||
@ -72,7 +80,8 @@ alias mc 'setenv MC `@prefix@/bin/mc -P \!*`; cd $MC; unsetenv MC'
|
||||
.TP
|
||||
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
|
||||
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
|
||||
.I "\-s"
|
||||
Turns on the slow terminal mode, in this mode the program will not
|
||||
|
12
doc/mc.sgml
12
doc/mc.sgml
@ -78,13 +78,20 @@ you were in (thanks to Torben Fjerdingstad and Sergey for
|
||||
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.
|
||||
<tscreen><verb>
|
||||
|
||||
bash and zsh users:
|
||||
|
||||
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"
|
||||
cd "`cat $MC`"
|
||||
rm "$MC"
|
||||
@ -97,7 +104,8 @@ alias mc 'setenv MC `@prefix@/bin/mc -P \!*`; cd $MC; unsetenv MC'
|
||||
</verb></tscreen>
|
||||
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
|
||||
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
|
||||
program will not draw expensive line drawing characters
|
||||
|
@ -13,14 +13,17 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
#
|
||||
|
||||
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
|
||||
SUPPBIN_IN = mc.csh.in mc.sh.in
|
||||
SUPPBIN_OUT = mc.csh mc.sh
|
||||
DESKTOP_FILES = startup.links README.desktop
|
||||
TIFILES = README.xterm linux.ti xterm.ad xterm.ti ansi.ti vt100.ti xterm.tcap
|
||||
|
||||
DISTLIB = \
|
||||
$(LIBFILES_IN) \
|
||||
$(LIBFILES_CONST) \
|
||||
$(SUPPBIN_IN) \
|
||||
$(TIFILES) \
|
||||
$(DESKTOP_FILES) \
|
||||
Makefile.in tdiff \
|
||||
@ -51,12 +54,15 @@ realclean:
|
||||
distclean:
|
||||
$(RMF) $(srcdir)/*~ $(srcdir)/Makefile
|
||||
for I in $(LIBFILES_OUT); do $(RMF) $(srcdir)/$$I; done
|
||||
for I in $(SUPPBIN_OUT); do $(RMF) $(srcdir)/$$I; done
|
||||
|
||||
install:
|
||||
for I in $(LIBFILES_CONST); \
|
||||
do $(INSTALL_DATA) $(srcdir)/$$I $(DESTDIR)$(mclibdir)/$$I; done
|
||||
for I in $(LIBFILES_OUT); \
|
||||
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); \
|
||||
do $(INSTALL_DATA) $(srcdir)/$$I $(DESTDIR)$(tidir)/$$I; done
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(confdir)
|
||||
|
@ -1,2 +0,0 @@
|
||||
alias mc 'setenv MC `/usr/bin/mc -P \!*`; cd $MC; unsetenv MC'
|
||||
|
2
lib/mc.csh.in
Normal file
2
lib/mc.csh.in
Normal file
@ -0,0 +1,2 @@
|
||||
alias mc 'setenv MC `@prefix@/bin/mc -P \!*`; cd $MC; unsetenv MC'
|
||||
|
@ -2,8 +2,8 @@ mc ()
|
||||
{
|
||||
mkdir -p ~/.mc/tmp 2> /dev/null
|
||||
chmod 700 ~/.mc/tmp
|
||||
MC=~/.mc/tmp/mc$$-"$RANDOM"
|
||||
/usr/bin/mc -P "$@" > "$MC"
|
||||
MC=~/.mc/tmp/mc-$$
|
||||
@prefix@/bin/mc -P "$@" > "$MC"
|
||||
cd "`cat $MC`"
|
||||
rm "$MC"
|
||||
unset MC;
|
@ -1,6 +1,39 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
|
||||
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
|
||||
prefix=/usr/local
|
||||
fi
|
||||
@ -22,6 +55,40 @@ if test -f $PROFILE; then
|
||||
B=`grep "mc ()" $BASHRC`
|
||||
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
|
||||
:
|
||||
else
|
||||
@ -36,14 +103,15 @@ if test -f $PROFILE; then
|
||||
else
|
||||
echo "While examining your $PROFILE,"
|
||||
fi
|
||||
echo "I've found that you have no mc () function defined there."
|
||||
echo "This function enables a feature of mc(1) that when you leave mc(1),"
|
||||
echo "you return to a directory where you were in mc just before exiting"
|
||||
echo "and not to the directory you've started mc from."
|
||||
echo "I've found that you do not source $suppbindir/mc.sh there."
|
||||
echo "This shell script defines a function which enables a feature of mc(1)"
|
||||
echo "that when you leave mc(1), you return to a directory where you were"
|
||||
echo "in mc just before exiting and not to the directory you've started mc"
|
||||
echo "from."
|
||||
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
|
||||
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] "
|
||||
else
|
||||
echo -n "function to your $PROFILE? [y|n] "
|
||||
@ -55,11 +123,12 @@ if test -f $PROFILE; then
|
||||
INITFILE=$PROFILE
|
||||
fi
|
||||
case $rep in
|
||||
[Nn]*) exit ;;
|
||||
[Yy]*) ;;
|
||||
[Pp]*) INITFILE=$PROFILE ;;
|
||||
*) exit 1;;
|
||||
esac
|
||||
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"
|
||||
fi
|
||||
fi
|
||||
|
@ -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>
|
||||
|
||||
* ftpfs.c (ftpfs_set_debug), vfs.h: added const qualifier.
|
||||
|
@ -67,7 +67,7 @@ if ($8 ~ /^\^/)
|
||||
if ($8 ~ /\/$/)
|
||||
printf "drwxr-xr-x 1 %-8d %-8d %8d %s %s %s\n", uid, 0, $1, $5, $6, $8
|
||||
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
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user