mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-22 03:02:06 +03:00
Rename FISH VFS to SHELL one.
This commit is contained in:
parent
3f42309a5d
commit
6ca4ab4b4e
@ -654,8 +654,8 @@ src/vfs/extfs/helpers/uwim
|
||||
src/vfs/extfs/helpers/uzip
|
||||
src/vfs/extfs/helpers/uzoo
|
||||
|
||||
src/vfs/fish/Makefile
|
||||
src/vfs/fish/helpers/Makefile
|
||||
src/vfs/shell/Makefile
|
||||
src/vfs/shell/helpers/Makefile
|
||||
|
||||
src/vfs/ftpfs/Makefile
|
||||
|
||||
|
@ -171,9 +171,9 @@ VFS options:
|
||||
(on by default)
|
||||
Support for FTP vfs
|
||||
|
||||
`--enable-vfs-fish'
|
||||
`--enable-vfs-shell'
|
||||
(on by default)
|
||||
Support for FISH vfs
|
||||
Support for SHELL vfs
|
||||
|
||||
`--enable-vfs-sftp'
|
||||
(auto)
|
||||
|
@ -128,7 +128,7 @@ These are hints for the text mode edition:
|
||||
|
||||
* The Virtual File System is a cute addition to the project, you may
|
||||
browse in tar and compressed tar files as well as browsing remote
|
||||
machines with the fish file system.
|
||||
machines with the shell file system.
|
||||
|
||||
* Please read the manual page.
|
||||
|
||||
|
4
doc/TODO
4
doc/TODO
@ -73,7 +73,7 @@ window title.
|
||||
Better date parser - don't allow seconds and year in ftp listings on the
|
||||
same line.
|
||||
|
||||
Report errors in fish operations and recover from them.
|
||||
Report errors in shell operations and recover from them.
|
||||
|
||||
Allow colors to be defined in the mc.lib file. Make it possible to
|
||||
avoid using a super-long line to redefine all colors.
|
||||
@ -82,7 +82,7 @@ Filters in the editor should operate on the open file - don't close and
|
||||
reopen the file. They don't work on VFS now. For example, a gzipped
|
||||
files on FTP cannot be edited.
|
||||
|
||||
ftp and fish with home != '/' - readjust directory to the home.
|
||||
ftp and shell with home != '/' - readjust directory to the home.
|
||||
|
||||
Make "Find File" dialog more responsive. Keep state in a structure and
|
||||
preserve it when the search is suspended.
|
||||
|
@ -3138,7 +3138,7 @@ used to manipulate tar and compressed tar files; the
|
||||
.IR undelfs ,
|
||||
used to recover deleted files on ext2 file systems (the default file
|
||||
system for Linux systems),
|
||||
.I fish
|
||||
.I shell
|
||||
(for manipulating files over shell connections such as rsh and ssh).
|
||||
If the code was compiled with
|
||||
.I sftpfs
|
||||
@ -3225,7 +3225,7 @@ Examples:
|
||||
The latter specifies the full path of the tar archive.
|
||||
.\"NODE " FIle transfer over SHell filesystem"
|
||||
.SH " FIle transfer over SHell filesystem"
|
||||
The fish file system is a network based file system that allows you to
|
||||
The shell file system is a network based file system that allows you to
|
||||
manipulate the files in a remote machine as if they were local. To use
|
||||
this, the other side has to have bash\-compatible shell.
|
||||
.PP
|
||||
@ -4094,7 +4094,7 @@ If this variable is on (default is off) when you browse the file system
|
||||
on a Tree panel, it will automatically reload the other panel with the
|
||||
contents of the selected directory.
|
||||
.TP
|
||||
.I fish_directory_timeout
|
||||
.I shell_directory_timeout
|
||||
This variable holds the lifetime of a directory cache entry in seconds. The
|
||||
default value is 900 seconds.
|
||||
.TP
|
||||
|
@ -3588,7 +3588,7 @@ tar\-файлов;
|
||||
файлов в файловой системе ext2 (файловая система, используемая в Linux
|
||||
по умолчанию);
|
||||
.br
|
||||
\- файловой системы fish (для манипулирования файлами при работе с
|
||||
\- файловой системы shell (для манипулирования файлами при работе с
|
||||
оболочкой через такие программы как rsh и ssh);
|
||||
.br
|
||||
\- и, наконец, сетевой файловой системы nfs.
|
||||
@ -3607,7 +3607,7 @@ tar\-файлов;
|
||||
.\"Tar File System"
|
||||
.br
|
||||
.\"LINK2"
|
||||
Файловая система FISH (FIle transfer over SHell)
|
||||
Файловая система SHELL (FIle transfer over SHell)
|
||||
.\"FIle transfer over SHell filesystem"
|
||||
.br
|
||||
.\"LINK2"
|
||||
@ -3726,8 +3726,8 @@ tar\-файлов, то есть обычно для получения спис
|
||||
.PP
|
||||
В последнем примере указан полный путь к tar\-архиву.
|
||||
.\"NODE " FIle transfer over SHell filesystem"
|
||||
.SH " Файловая система FISH (FIle transfer over SHell)"
|
||||
Файловая система fish \- это сетевая файловая система, которая позволяет
|
||||
.SH " Файловая система SHELL (FIle transfer over SHell)"
|
||||
Файловая система shell \- это сетевая файловая система, которая позволяет
|
||||
работать с файлами на удалённом компьютере так, как если бы они были
|
||||
расположены на вашем диске. Для того чтобы это было возможно, на
|
||||
удалённом компьютере должна быть запущена bash\-совместимая оболочка shell.
|
||||
|
@ -30,23 +30,23 @@
|
||||
#define CHARSETS_LIST "mc.charsets"
|
||||
#define MC_MACRO_FILE "mc.macros"
|
||||
|
||||
#define FISH_PREFIX "fish"
|
||||
#define VFS_SHELL_PREFIX "shell"
|
||||
|
||||
#define FISH_LS_FILE "ls"
|
||||
#define FISH_EXISTS_FILE "fexists"
|
||||
#define FISH_MKDIR_FILE "mkdir"
|
||||
#define FISH_UNLINK_FILE "unlink"
|
||||
#define FISH_CHOWN_FILE "chown"
|
||||
#define FISH_CHMOD_FILE "chmod"
|
||||
#define FISH_UTIME_FILE "utime"
|
||||
#define FISH_RMDIR_FILE "rmdir"
|
||||
#define FISH_LN_FILE "ln"
|
||||
#define FISH_MV_FILE "mv"
|
||||
#define FISH_HARDLINK_FILE "hardlink"
|
||||
#define FISH_GET_FILE "get"
|
||||
#define FISH_SEND_FILE "send"
|
||||
#define FISH_APPEND_FILE "append"
|
||||
#define FISH_INFO_FILE "info"
|
||||
#define VFS_SHELL_LS_FILE "ls"
|
||||
#define VFS_SHELL_EXISTS_FILE "fexists"
|
||||
#define VFS_SHELL_MKDIR_FILE "mkdir"
|
||||
#define VFS_SHELL_UNLINK_FILE "unlink"
|
||||
#define VFS_SHELL_CHOWN_FILE "chown"
|
||||
#define VFS_SHELL_CHMOD_FILE "chmod"
|
||||
#define VFS_SHELL_UTIME_FILE "utime"
|
||||
#define VFS_SHELL_RMDIR_FILE "rmdir"
|
||||
#define VFS_SHELL_LN_FILE "ln"
|
||||
#define VFS_SHELL_MV_FILE "mv"
|
||||
#define VFS_SHELL_HARDLINK_FILE "hardlink"
|
||||
#define VFS_SHELL_GET_FILE "get"
|
||||
#define VFS_SHELL_SEND_FILE "send"
|
||||
#define VFS_SHELL_APPEND_FILE "append"
|
||||
#define VFS_SHELL_INFO_FILE "info"
|
||||
|
||||
#define MC_EXTFS_DIR "extfs.d"
|
||||
|
||||
|
@ -174,8 +174,8 @@ static name_keymap_t command_names[] = {
|
||||
ADD_KEYMAP_NAME (LinkSymbolicEdit),
|
||||
ADD_KEYMAP_NAME (ExternalPanelize),
|
||||
ADD_KEYMAP_NAME (Filter),
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
ADD_KEYMAP_NAME (ConnectFish),
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
ADD_KEYMAP_NAME (ConnectShell),
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FTP
|
||||
ADD_KEYMAP_NAME (ConnectFtp),
|
||||
|
@ -151,7 +151,7 @@ enum
|
||||
CK_LinkSymbolicEdit,
|
||||
CK_ExternalPanelize,
|
||||
CK_Filter,
|
||||
CK_ConnectFish,
|
||||
CK_ConnectShell,
|
||||
CK_ConnectFtp,
|
||||
CK_ConnectSftp,
|
||||
CK_PanelInfo,
|
||||
|
@ -74,7 +74,7 @@ static const struct
|
||||
|
||||
/* data */
|
||||
{ &mc_data_str, MC_SKINS_DIR },
|
||||
{ &mc_data_str, FISH_PREFIX },
|
||||
{ &mc_data_str, VFS_SHELL_PREFIX },
|
||||
{ &mc_data_str, MC_ASHRC_FILE },
|
||||
{ &mc_data_str, MC_BASHRC_FILE },
|
||||
{ &mc_data_str, MC_INPUTRC_FILE },
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
/*** file scope macro definitions ****************************************************************/
|
||||
|
||||
/* Parsing code is used by ftpfs, fish and extfs */
|
||||
/* Parsing code is used by ftpfs, shell and extfs */
|
||||
#define MAXCOLS 30
|
||||
|
||||
/*** file scope type declarations ****************************************************************/
|
||||
|
@ -68,7 +68,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef EREMOTEIO
|
||||
#define E_REMOTE EREMOTEIO /* if other side of ftp/fish reports error */
|
||||
#define E_REMOTE EREMOTEIO /* if other side of ftp/shell reports error */
|
||||
#else
|
||||
#define E_REMOTE ENETUNREACH /* :-( there's no EREMOTEIO on some systems */
|
||||
#endif
|
||||
@ -133,7 +133,7 @@ typedef struct vfs_class
|
||||
{
|
||||
const char *name; /* "FIles over SHell" */
|
||||
vfs_flags_t flags;
|
||||
const char *prefix; /* "fish:" */
|
||||
const char *prefix; /* "shell:" */
|
||||
int verrno; /* can't use errno because glibc2 might define errno as function */
|
||||
gboolean flush; /* if set to TRUE, invalidate directory cache */
|
||||
FILE *logfile;
|
||||
|
@ -109,7 +109,7 @@ typedef struct
|
||||
} vfs_file_handler_t;
|
||||
|
||||
/*
|
||||
* One of our subclasses (tar, cpio, fish, ftpfs) with data and methods.
|
||||
* One of our subclasses (tar, cpio, shell, ftpfs) with data and methods.
|
||||
* Extends vfs_class.
|
||||
*/
|
||||
struct vfs_s_subclass
|
||||
|
@ -13,7 +13,7 @@ m4_include([m4.include/vfs/mc-vfs-extfs.m4])
|
||||
m4_include([m4.include/vfs/mc-vfs-sfs.m4])
|
||||
m4_include([m4.include/vfs/mc-vfs-ftp.m4])
|
||||
m4_include([m4.include/vfs/mc-vfs-sftp.m4])
|
||||
m4_include([m4.include/vfs/mc-vfs-fish.m4])
|
||||
m4_include([m4.include/vfs/mc-vfs-shell.m4])
|
||||
m4_include([m4.include/vfs/mc-vfs-undelfs.m4])
|
||||
m4_include([m4.include/vfs/mc-vfs-tarfs.m4])
|
||||
m4_include([m4.include/vfs/mc-vfs-cpiofs.m4])
|
||||
@ -71,7 +71,7 @@ AC_DEFUN([mc_VFS_CHECKS],
|
||||
|
||||
mc_VFS_CPIOFS
|
||||
mc_VFS_EXTFS
|
||||
mc_VFS_FISH
|
||||
mc_VFS_SHELL
|
||||
mc_VFS_FTP
|
||||
mc_VFS_SFS
|
||||
mc_VFS_SFTP
|
||||
@ -80,7 +80,7 @@ AC_DEFUN([mc_VFS_CHECKS],
|
||||
|
||||
AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"])
|
||||
|
||||
if test x"$enable_vfs_ftp" = x"yes" -o x"$enable_vfs_fish" = x"yes" -o x"$enable_vfs_sftp" = x"yes"; then
|
||||
if test x"$enable_vfs_ftp" = x"yes" -o x"$enable_vfs_shell" = x"yes" -o x"$enable_vfs_sftp" = x"yes"; then
|
||||
mc_ENABLE_VFS_NET
|
||||
fi
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
dnl Enable FISH protocol (classic)
|
||||
AC_DEFUN([mc_VFS_FISH],
|
||||
[
|
||||
AC_ARG_ENABLE([vfs-fish],
|
||||
AS_HELP_STRING([--enable-vfs-fish], [Support for FISH filesystem @<:@yes@:>@]))
|
||||
if test "$enable_vfs" = "yes" -a "x$enable_vfs_fish" != xno; then
|
||||
enable_vfs_fish="yes"
|
||||
mc_VFS_ADDNAME([fish])
|
||||
AC_DEFINE([ENABLE_VFS_FISH], [1], [Support for FISH vfs])
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_VFS_FISH, [test "$enable_vfs" = "yes" -a x"$enable_vfs_fish" = x"yes"])
|
||||
])
|
12
m4.include/vfs/mc-vfs-shell.m4
Normal file
12
m4.include/vfs/mc-vfs-shell.m4
Normal file
@ -0,0 +1,12 @@
|
||||
dnl Enable SHELL protocol
|
||||
AC_DEFUN([mc_VFS_SHELL],
|
||||
[
|
||||
AC_ARG_ENABLE([vfs-shell],
|
||||
AS_HELP_STRING([--enable-vfs-shell], [Support for SHELL filesystem @<:@yes@:>@]))
|
||||
if test "$enable_vfs" = "yes" -a "x$enable_vfs_shell" != xno; then
|
||||
enable_vfs_shell="yes"
|
||||
mc_VFS_ADDNAME([shell])
|
||||
AC_DEFINE([ENABLE_VFS_SHELL], [1], [Support for SHELL vfs])
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_VFS_SHELL, [test "$enable_vfs" = "yes" -a x"$enable_vfs_shell" = x"yes"])
|
||||
])
|
@ -50,7 +50,7 @@ ScreenList = alt-prime
|
||||
# EditExtensionsFile =
|
||||
# EditFileHighlightFile =
|
||||
# Filter =
|
||||
# ConnectFish =
|
||||
# ConnectShell =
|
||||
# ConnectFtp =
|
||||
# Undelete =
|
||||
EditorViewerHistory = alt-shift-e
|
||||
|
@ -50,7 +50,7 @@ ScreenList = alt-prime
|
||||
# EditExtensionsFile =
|
||||
# EditFileHighlightFile =
|
||||
# Filter =
|
||||
# ConnectFish =
|
||||
# ConnectShell =
|
||||
# ConnectFtp =
|
||||
# Undelete =
|
||||
EditorViewerHistory = alt-shift-e
|
||||
|
@ -1199,15 +1199,15 @@ sftplink_cmd (void)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
void
|
||||
fishlink_cmd (void)
|
||||
shelllink_cmd (void)
|
||||
{
|
||||
nice_cd (_("Shell link to machine"), _(machine_str),
|
||||
"[FIle transfer over SHell filesystem]", ":fishlink_cmd: Shell link to machine ",
|
||||
"sh://", 1, TRUE);
|
||||
}
|
||||
#endif /* ENABLE_VFS_FISH */
|
||||
#endif /* ENABLE_VFS_SHELL */
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
@ -35,8 +35,8 @@ void ftplink_cmd (void);
|
||||
#ifdef ENABLE_VFS_SFTP
|
||||
void sftplink_cmd (void);
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
void fishlink_cmd (void);
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
void shelllink_cmd (void);
|
||||
#endif
|
||||
void undelete_cmd (void);
|
||||
void help_cmd (void);
|
||||
|
@ -1521,7 +1521,7 @@ recursive_erase (file_op_total_context_t * tctx, file_op_context_t * ctx, const
|
||||
*
|
||||
* ATTENTION! Be careful when modifying this function (like commit 25e419ba0886f)!
|
||||
* Some implementations of readdir() in MC VFS (for example, vfs_s_readdir(), which is used
|
||||
* in FISH) don't return "." and ".." entries.
|
||||
* in SHELL) don't return "." and ".." entries.
|
||||
*/
|
||||
static int
|
||||
check_dir_is_empty (const vfs_path_t * vpath)
|
||||
|
@ -210,8 +210,8 @@ create_panel_menu (void)
|
||||
#ifdef ENABLE_VFS_FTP
|
||||
entries = g_list_prepend (entries, menu_entry_new (_("FT&P link..."), CK_ConnectFtp));
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
entries = g_list_prepend (entries, menu_entry_new (_("S&hell link..."), CK_ConnectFish));
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
entries = g_list_prepend (entries, menu_entry_new (_("S&hell link..."), CK_ConnectShell));
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_SFTP
|
||||
entries = g_list_prepend (entries, menu_entry_new (_("SFTP li&nk..."), CK_ConnectSftp));
|
||||
@ -1240,9 +1240,9 @@ midnight_execute_cmd (Widget * sender, long command)
|
||||
case CK_Find:
|
||||
find_cmd (current_panel);
|
||||
break;
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
case CK_ConnectFish:
|
||||
fishlink_cmd ();
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
case CK_ConnectShell:
|
||||
shelllink_cmd ();
|
||||
break;
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FTP
|
||||
|
10
src/setup.c
10
src/setup.c
@ -44,8 +44,8 @@
|
||||
#ifdef ENABLE_VFS_FTP
|
||||
#include "src/vfs/ftpfs/ftpfs.h"
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
#include "src/vfs/fish/fish.h"
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
#include "src/vfs/shell/shell.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
@ -386,9 +386,9 @@ static const struct
|
||||
{ "ftpfs_directory_timeout", &ftpfs_directory_timeout },
|
||||
{ "ftpfs_retry_seconds", &ftpfs_retry_seconds },
|
||||
#endif /* ENABLE_VFS_FTP */
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
{ "fish_directory_timeout", &fish_directory_timeout },
|
||||
#endif /* ENABLE_VFS_FISH */
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
{ "shell_directory_timeout", &shell_directory_timeout },
|
||||
#endif /* ENABLE_VFS_SHELL */
|
||||
#endif /* ENABLE_VFS */
|
||||
/* option_tab_spacing is used in internal viewer */
|
||||
{ "editor_tab_spacing", &option_tab_spacing },
|
||||
|
@ -75,8 +75,8 @@ static const char *const vfs_supported[] = {
|
||||
#ifdef ENABLE_VFS_SFTP
|
||||
"sftpfs",
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
"fish",
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
"shell",
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
@ -218,15 +218,15 @@ show_datadirs_extended (void)
|
||||
|
||||
PRINTF_SECTION (_("File extension handlers:"), EXTHELPERSDIR);
|
||||
|
||||
#if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_FISH
|
||||
#if defined ENABLE_VFS_EXTFS || defined ENABLE_VFS_SHELL
|
||||
PRINTF_SECTION (_("VFS plugins and scripts:"), LIBEXECDIR);
|
||||
#ifdef ENABLE_VFS_EXTFS
|
||||
PRINTF2 ("extfs.d:", LIBEXECDIR, MC_EXTFS_DIR PATH_SEP_STR);
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
PRINTF2 ("fish:", LIBEXECDIR, FISH_PREFIX PATH_SEP_STR);
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
PRINTF2 ("shell:", LIBEXECDIR, VFS_SHELL_PREFIX PATH_SEP_STR);
|
||||
#endif
|
||||
#endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_FISH */
|
||||
#endif /* ENABLE_VFS_EXTFS || defiined ENABLE_VFS_SHELL */
|
||||
(void) puts ("");
|
||||
|
||||
PRINTF_GROUP (_("User data"));
|
||||
@ -237,8 +237,8 @@ show_datadirs_extended (void)
|
||||
#ifdef ENABLE_VFS_EXTFS
|
||||
PRINTF ("extfs.d:", mc_config_get_data_path (), MC_EXTFS_DIR PATH_SEP_STR);
|
||||
#endif
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
PRINTF ("fish:", mc_config_get_data_path (), FISH_PREFIX PATH_SEP_STR);
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
PRINTF ("shell:", mc_config_get_data_path (), VFS_SHELL_PREFIX PATH_SEP_STR);
|
||||
#endif
|
||||
#ifdef USE_INTERNAL_EDIT
|
||||
PRINTF ("mcedit macros:", mc_config_get_data_path (), MC_MACRO_FILE);
|
||||
|
@ -16,9 +16,9 @@ SUBDIRS += extfs
|
||||
libmc_vfs_la_LIBADD += extfs/libvfs-extfs.la
|
||||
endif
|
||||
|
||||
if ENABLE_VFS_FISH
|
||||
SUBDIRS += fish
|
||||
libmc_vfs_la_LIBADD += fish/libvfs-fish.la
|
||||
if ENABLE_VFS_SHELL
|
||||
SUBDIRS += shell
|
||||
libmc_vfs_la_LIBADD += shell/libvfs-shell.la
|
||||
endif
|
||||
|
||||
if ENABLE_VFS_FTP
|
||||
|
@ -1,10 +0,0 @@
|
||||
fishdir = $(libexecdir)/@PACKAGE@/fish
|
||||
|
||||
# Files to install and distribute other than fish scripts
|
||||
FISH_MISC = README.fish
|
||||
|
||||
# Install and distribute FISH helper scripts w/o shebang & executable bit as data
|
||||
fish_DATA = $(FISH_MISC) ls mkdir fexists unlink chown chmod rmdir ln mv hardlink get send append info utime
|
||||
fishconfdir = $(sysconfdir)/@PACKAGE@
|
||||
|
||||
EXTRA_DIST = $(fish_DATA)
|
@ -1,15 +0,0 @@
|
||||
FILENAME="/${FISH_FILENAME}"
|
||||
echo "### 001"
|
||||
{
|
||||
bss=4096
|
||||
bsl=4095
|
||||
if [ $FISH_FILESIZE -lt $bss ]; then
|
||||
bss=1;
|
||||
bsl=0;
|
||||
fi
|
||||
while [ $FISH_FILESIZE -gt 0 ]; do
|
||||
cnt=`expr \\( $FISH_FILESIZE + $bsl \\) / $bss`
|
||||
n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c`
|
||||
FISH_FILESIZE=`expr $FISH_FILESIZE - $n`
|
||||
done
|
||||
}; echo "### 200"
|
@ -1,5 +0,0 @@
|
||||
if chmod ${FISH_FILEMODE} "/${FISH_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
@ -1,5 +0,0 @@
|
||||
if chown ${FISH_FILEOWNER}:${FISH_FILEGROUP} "/${FISH_FILENAME}" ; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
@ -1,2 +0,0 @@
|
||||
ls -l "/${FISH_FILENAME}" >/dev/null 2>/dev/null
|
||||
echo '### '$?
|
@ -1,5 +0,0 @@
|
||||
if mv "/${FISH_FILEFROM}" "/${FISH_FILETO}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
@ -1,5 +0,0 @@
|
||||
if rmdir "/${FISH_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
@ -1,16 +0,0 @@
|
||||
FILENAME="/${FISH_FILENAME}"
|
||||
echo "### 001"
|
||||
{
|
||||
> "${FILENAME}"
|
||||
bss=4096
|
||||
bsl=4095
|
||||
if [ $FISH_FILESIZE -lt $bss ]; then
|
||||
bss=1;
|
||||
bsl=0;
|
||||
fi
|
||||
while [ $FISH_FILESIZE -gt 0 ]; do
|
||||
cnt=`expr \\( $FISH_FILESIZE + $bsl \\) / $bss`
|
||||
n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c`
|
||||
FISH_FILESIZE=`expr $FISH_FILESIZE - $n`
|
||||
done
|
||||
}; echo "### 200"
|
@ -1,5 +0,0 @@
|
||||
if rm -f "/${FISH_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
@ -1,12 +0,0 @@
|
||||
if TZ=UTC touch -h -m -d "$FISH_TOUCHMTIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null && \
|
||||
TZ=UTC touch -h -a -d "$FISH_TOUCHATIME_W_NSEC" "/${FISH_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
elif TZ=UTC touch -h -m -t $FISH_TOUCHMTIME "/${FISH_FILENAME}" 2>/dev/null && \
|
||||
TZ=UTC touch -h -a -t $FISH_TOUCHATIME "/${FISH_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
elif [ -n "$FISH_HAVE_PERL" ] &&
|
||||
perl -e 'utime '$FISH_FILEATIME','$FISH_FILEMTIME',@ARGV;' "/${FISH_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
@ -46,8 +46,8 @@
|
||||
#include "extfs/extfs.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
#include "fish/fish.h"
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
#include "shell/shell.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_VFS_FTP
|
||||
@ -115,9 +115,9 @@ vfs_plugins_init (void)
|
||||
#ifdef ENABLE_VFS_SFTP
|
||||
vfs_init_sftpfs ();
|
||||
#endif /* ENABLE_VFS_SFTP */
|
||||
#ifdef ENABLE_VFS_FISH
|
||||
vfs_init_fish ();
|
||||
#endif /* ENABLE_VFS_FISH */
|
||||
#ifdef ENABLE_VFS_SHELL
|
||||
vfs_init_shell ();
|
||||
#endif /* ENABLE_VFS_SHELL */
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -6,8 +6,8 @@ AM_CPPFLAGS = \
|
||||
$(GLIB_CFLAGS) \
|
||||
-I$(top_srcdir)
|
||||
|
||||
noinst_LTLIBRARIES = libvfs-fish.la
|
||||
noinst_LTLIBRARIES = libvfs-shell.la
|
||||
|
||||
libvfs_fish_la_SOURCES = \
|
||||
fish.c fish.h \
|
||||
fishdef.h
|
||||
libvfs_shell_la_SOURCES = \
|
||||
shell.c shell.h \
|
||||
shelldef.h
|
10
src/vfs/shell/helpers/Makefile.am
Normal file
10
src/vfs/shell/helpers/Makefile.am
Normal file
@ -0,0 +1,10 @@
|
||||
shelldir = $(libexecdir)/@PACKAGE@/shell
|
||||
|
||||
# Files to install and distribute other than shell scripts
|
||||
SHELL_MISC = README.shell
|
||||
|
||||
# Install and distribute SHELL helper scripts w/o shebang & executable bit as data
|
||||
shell_DATA = $(SHELL_MISC) ls mkdir fexists unlink chown chmod rmdir ln mv hardlink get send append info utime
|
||||
shellconfdir = $(sysconfdir)/@PACKAGE@
|
||||
|
||||
EXTRA_DIST = $(shell_DATA)
|
@ -17,8 +17,8 @@ current user has host-specific overrides in his per-user MC configuration
|
||||
directory. User-defined overrides take priority over sytem-wide scripts
|
||||
if they exist. The order in which the directories are traversed is as follows:
|
||||
|
||||
/usr/libexec/mc/fish
|
||||
~/.local/share/mc/fish/<hostname>/
|
||||
/usr/libexec/mc/shell
|
||||
~/.local/share/mc/shell/<hostname>/
|
||||
|
||||
Server's reply is multiline, but always ends with
|
||||
|
||||
@ -37,7 +37,7 @@ PRELIMinary success, if they were, it marks failure
|
||||
|
||||
Connecting
|
||||
~~~~~~~~~~
|
||||
MC uses "echo FISH:;/bin/sh" as command executed on remote machine.
|
||||
MC uses "echo SHELL:;/bin/sh" as command executed on remote machine.
|
||||
|
||||
Actions
|
||||
~~~~~~~
|
||||
@ -201,26 +201,26 @@ Script: ln
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
You can use following parameters:
|
||||
FISH_FILESIZE
|
||||
FISH_FILENAME
|
||||
FISH_FILEMODE
|
||||
FISH_FILEOWNER
|
||||
FISH_FILEGROUPE
|
||||
FISH_FILEFROM
|
||||
FISH_FILETO
|
||||
SHELL_FILESIZE
|
||||
SHELL_FILENAME
|
||||
SHELL_FILEMODE
|
||||
SHELL_FILEOWNER
|
||||
SHELL_FILEGROUPE
|
||||
SHELL_FILEFROM
|
||||
SHELL_FILETO
|
||||
|
||||
NB:
|
||||
'FISH_FILESIZE' is used if we operate with single file name in 'unlink', 'rmdir', 'chmod', etc...
|
||||
'FISH_FILEFROM','FISH_FILETO' are used if we operate with two files in 'ln', 'hardlink', 'mv' etc...
|
||||
'FISH_FILEOWNER', 'FISH_FILEGROUPE' are a new user/group in chown
|
||||
'SHELL_FILESIZE' is used if we operate with single file name in 'unlink', 'rmdir', 'chmod', etc...
|
||||
'SHELL_FILEFROM','SHELL_FILETO' are used if we operate with two files in 'ln', 'hardlink', 'mv' etc...
|
||||
'SHELL_FILEOWNER', 'SHELL_FILEGROUPE' are a new user/group in chown
|
||||
|
||||
and flags:
|
||||
FISH_HAVE_HEAD
|
||||
FISH_HAVE_SED
|
||||
FISH_HAVE_AWK
|
||||
FISH_HAVE_PERL
|
||||
FISH_HAVE_LSQ
|
||||
FISH_HAVE_DATE_MDYT
|
||||
SHELL_HAVE_HEAD
|
||||
SHELL_HAVE_SED
|
||||
SHELL_HAVE_AWK
|
||||
SHELL_HAVE_PERL
|
||||
SHELL_HAVE_LSQ
|
||||
SHELL_HAVE_DATE_MDYT
|
||||
|
||||
That's all, folks!
|
||||
pavel@ucw.cz
|
15
src/vfs/shell/helpers/append
Normal file
15
src/vfs/shell/helpers/append
Normal file
@ -0,0 +1,15 @@
|
||||
FILENAME="/${SHELL_FILENAME}"
|
||||
echo "### 001"
|
||||
{
|
||||
bss=4096
|
||||
bsl=4095
|
||||
if [ $SHELL_FILESIZE -lt $bss ]; then
|
||||
bss=1;
|
||||
bsl=0;
|
||||
fi
|
||||
while [ $SHELL_FILESIZE -gt 0 ]; do
|
||||
cnt=`expr \\( $SHELL_FILESIZE + $bsl \\) / $bss`
|
||||
n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c`
|
||||
SHELL_FILESIZE=`expr $SHELL_FILESIZE - $n`
|
||||
done
|
||||
}; echo "### 200"
|
5
src/vfs/shell/helpers/chmod
Normal file
5
src/vfs/shell/helpers/chmod
Normal file
@ -0,0 +1,5 @@
|
||||
if chmod ${SHELL_FILEMODE} "/${SHELL_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
5
src/vfs/shell/helpers/chown
Normal file
5
src/vfs/shell/helpers/chown
Normal file
@ -0,0 +1,5 @@
|
||||
if chown ${SHELL_FILEOWNER}:${SHELL_FILEGROUP} "/${SHELL_FILENAME}" ; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
2
src/vfs/shell/helpers/fexists
Normal file
2
src/vfs/shell/helpers/fexists
Normal file
@ -0,0 +1,2 @@
|
||||
ls -l "/${SHELL_FILENAME}" >/dev/null 2>/dev/null
|
||||
echo '### '$?
|
@ -1,6 +1,6 @@
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
fish_get_perl ()
|
||||
shell_get_perl ()
|
||||
{
|
||||
FILENAME=$1
|
||||
OFFSET=$2
|
||||
@ -34,7 +34,7 @@ exit 0
|
||||
' "${FILENAME}" $OFFSET
|
||||
}
|
||||
|
||||
fish_get_tail ()
|
||||
shell_get_tail ()
|
||||
{
|
||||
FILENAME=$1
|
||||
OFFSET=$2
|
||||
@ -66,7 +66,7 @@ else
|
||||
fi
|
||||
}
|
||||
|
||||
fish_get_dd ()
|
||||
shell_get_dd ()
|
||||
{
|
||||
FILENAME=$1
|
||||
OFFSET=$2
|
||||
@ -95,10 +95,10 @@ else
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -n "${FISH_HAVE_PERL}" ]; then
|
||||
fish_get_perl "/${FISH_FILENAME}" ${FISH_START_OFFSET}
|
||||
elif [ -n "${FISH_HAVE_TAIL}" ]; then
|
||||
fish_get_tail "/${FISH_FILENAME}" ${FISH_START_OFFSET}
|
||||
if [ -n "${SHELL_HAVE_PERL}" ]; then
|
||||
shell_get_perl "/${SHELL_FILENAME}" ${SHELL_START_OFFSET}
|
||||
elif [ -n "${SHELL_HAVE_TAIL}" ]; then
|
||||
shell_get_tail "/${SHELL_FILENAME}" ${SHELL_START_OFFSET}
|
||||
else
|
||||
fish_get_dd "/${FISH_FILENAME}" ${FISH_START_OFFSET}
|
||||
shell_get_dd "/${SHELL_FILENAME}" ${SHELL_START_OFFSET}
|
||||
fi
|
@ -1,5 +1,5 @@
|
||||
FILEFROM="/${FISH_FILEFROM}"
|
||||
FILETO="/${FISH_FILETO}"
|
||||
FILEFROM="/${SHELL_FILEFROM}"
|
||||
FILETO="/${SHELL_FILETO}"
|
||||
if ln "${FILEFROM}" "${FILETO}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
@ -1,12 +1,12 @@
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
#FISH_HAVE_HEAD 1
|
||||
#FISH_HAVE_SED 2
|
||||
#FISH_HAVE_AWK 4
|
||||
#FISH_HAVE_PERL 8
|
||||
#FISH_HAVE_LSQ 16
|
||||
#FISH_HAVE_DATE_MDYT 32
|
||||
#FISH_HAVE_TAIL 64
|
||||
#SHELL_HAVE_HEAD 1
|
||||
#SHELL_HAVE_SED 2
|
||||
#SHELL_HAVE_AWK 4
|
||||
#SHELL_HAVE_PERL 8
|
||||
#SHELL_HAVE_LSQ 16
|
||||
#SHELL_HAVE_DATE_MDYT 32
|
||||
#SHELL_HAVE_TAIL 64
|
||||
res=0
|
||||
if `echo yes| head -c 1 > /dev/null 2>&1` ; then
|
||||
res=`expr $res + 1`
|
@ -1,5 +1,5 @@
|
||||
FILEFROM="${FISH_FILEFROM}"
|
||||
FILETO="/${FISH_FILETO}"
|
||||
FILEFROM="${SHELL_FILEFROM}"
|
||||
FILETO="/${SHELL_FILETO}"
|
||||
if ln -s "${FILEFROM}" "${FILETO}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
@ -1,10 +1,10 @@
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
perl_res="1"
|
||||
fish_list_lsq ()
|
||||
shell_list_lsq ()
|
||||
{
|
||||
FISH_DIR="$1"
|
||||
ls -Qlan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | (
|
||||
SHELL_DIR="$1"
|
||||
ls -Qlan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | (
|
||||
while read p l u g s m d y n; do
|
||||
echo "P$p $u.$g"
|
||||
echo "S$s"
|
||||
@ -14,7 +14,7 @@ while read p l u g s m d y n; do
|
||||
done
|
||||
)
|
||||
|
||||
ls -Qlan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | (
|
||||
ls -Qlan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | (
|
||||
while read p l u g a i m d y n; do
|
||||
echo "P$p $u.$g"
|
||||
echo "E$a$i"
|
||||
@ -26,13 +26,13 @@ done
|
||||
echo '### 200'
|
||||
}
|
||||
|
||||
fish_list_sed ()
|
||||
shell_list_sed ()
|
||||
{
|
||||
FISH_DIR="$1"
|
||||
ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | (
|
||||
SHELL_DIR="$1"
|
||||
ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | (
|
||||
while read p l u g s rec; do
|
||||
if [ -n "$g" ]; then
|
||||
if [ -n "$FISH_HAVE_DATE_MDYT" ]; then
|
||||
if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then
|
||||
filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+ //'`
|
||||
filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'`
|
||||
else
|
||||
@ -42,7 +42,7 @@ while read p l u g s rec; do
|
||||
pfile=\"`echo "$filename" | sed -e 's#^\(.*\) -> \(.*\)#\1" -> "\2#'`\"
|
||||
echo "P$p $u.$g"
|
||||
echo "S$s"
|
||||
if [ -n "$FISH_HAVE_DATE_MDYT" ]; then
|
||||
if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then
|
||||
echo "d$filedate"
|
||||
else
|
||||
echo "D$filedate"
|
||||
@ -52,10 +52,10 @@ while read p l u g s rec; do
|
||||
fi
|
||||
done
|
||||
)
|
||||
ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | (
|
||||
ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | (
|
||||
while read p l u g a i rec; do
|
||||
if [ -n "$g" ]; then
|
||||
if [ -n "$FISH_HAVE_DATE_MDYT" ]; then
|
||||
if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then
|
||||
filename=`echo "$rec"| sed 's/[^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+ //'`
|
||||
filedate=`echo "$rec"| sed 's/\([^[:space:]]\+ \+[^[:space:]]\+ \+[^[:space:]]\+\) .*/\1/'`
|
||||
else
|
||||
@ -65,7 +65,7 @@ while read p l u g a i rec; do
|
||||
pfile=\"`echo "$filename" | sed -e 's#^\(.*\) -> \(.*\)#\1" -> "\2#'`\"
|
||||
echo "P$p $u.$g"
|
||||
echo "E$a$i"
|
||||
if [ -n "$FISH_HAVE_DATE_MDYT" ]; then
|
||||
if [ -n "$SHELL_HAVE_DATE_MDYT" ]; then
|
||||
echo "d$filedate"
|
||||
else
|
||||
echo "D$filedate"
|
||||
@ -78,10 +78,10 @@ done
|
||||
echo '### 200'
|
||||
}
|
||||
|
||||
fish_list_poor_ls ()
|
||||
shell_list_poor_ls ()
|
||||
{
|
||||
FISH_DIR="$1"
|
||||
ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[^cbt]' | (
|
||||
SHELL_DIR="$1"
|
||||
ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[^cbt]' | (
|
||||
while read p l u g s m d y n n2 n3; do
|
||||
if [ -n "$g" ]; then
|
||||
if [ "$m" = "0" ]; then
|
||||
@ -97,7 +97,7 @@ while read p l u g s m d y n n2 n3; do
|
||||
fi
|
||||
done
|
||||
)
|
||||
ls -lan "${FISH_DIR}" 2>/dev/null | grep '^[cb]' | (
|
||||
ls -lan "${SHELL_DIR}" 2>/dev/null | grep '^[cb]' | (
|
||||
while read p l u g a i m d y n n2 n3; do
|
||||
if [ -n "$g" ]; then
|
||||
if [ "$a" = "0" ]; then
|
||||
@ -116,9 +116,9 @@ done
|
||||
echo '### 200'
|
||||
}
|
||||
|
||||
fish_list_perl ()
|
||||
shell_list_perl ()
|
||||
{
|
||||
FISH_DIR=$1
|
||||
SHELL_DIR=$1
|
||||
perl -e '
|
||||
use strict;
|
||||
use POSIX;
|
||||
@ -151,19 +151,19 @@ while((my $filename = readdir (DIR))){
|
||||
printf("### 500\n");
|
||||
}
|
||||
exit 0
|
||||
' "/${FISH_DIR}"
|
||||
' "/${SHELL_DIR}"
|
||||
perl_res=$?
|
||||
}
|
||||
|
||||
if [ -n "${FISH_HAVE_PERL}" ]; then
|
||||
fish_list_perl "/${FISH_FILENAME}"
|
||||
if [ -n "${SHELL_HAVE_PERL}" ]; then
|
||||
shell_list_perl "/${SHELL_FILENAME}"
|
||||
fi
|
||||
if [ "${perl_res}" != "0" ]; then
|
||||
if [ -n "${FISH_HAVE_LSQ}" ]; then
|
||||
fish_list_lsq "/${FISH_FILENAME}"
|
||||
elif [ -n "${FISH_HAVE_SED}" ]; then
|
||||
fish_list_sed "/${FISH_FILENAME}"
|
||||
if [ -n "${SHELL_HAVE_LSQ}" ]; then
|
||||
shell_list_lsq "/${SHELL_FILENAME}"
|
||||
elif [ -n "${SHELL_HAVE_SED}" ]; then
|
||||
shell_list_sed "/${SHELL_FILENAME}"
|
||||
else
|
||||
fish_list_poor_ls "/${FISH_FILENAME}"
|
||||
shell_list_poor_ls "/${SHELL_FILENAME}"
|
||||
fi
|
||||
fi
|
@ -1,4 +1,4 @@
|
||||
if mkdir "/$FISH_FILENAME" 2>/dev/null; then
|
||||
if mkdir "/$SHELL_FILENAME" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
5
src/vfs/shell/helpers/mv
Normal file
5
src/vfs/shell/helpers/mv
Normal file
@ -0,0 +1,5 @@
|
||||
if mv "/${SHELL_FILEFROM}" "/${SHELL_FILETO}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
5
src/vfs/shell/helpers/rmdir
Normal file
5
src/vfs/shell/helpers/rmdir
Normal file
@ -0,0 +1,5 @@
|
||||
if rmdir "/${SHELL_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
16
src/vfs/shell/helpers/send
Normal file
16
src/vfs/shell/helpers/send
Normal file
@ -0,0 +1,16 @@
|
||||
FILENAME="/${SHELL_FILENAME}"
|
||||
echo "### 001"
|
||||
{
|
||||
> "${FILENAME}"
|
||||
bss=4096
|
||||
bsl=4095
|
||||
if [ $SHELL_FILESIZE -lt $bss ]; then
|
||||
bss=1;
|
||||
bsl=0;
|
||||
fi
|
||||
while [ $SHELL_FILESIZE -gt 0 ]; do
|
||||
cnt=`expr \\( $SHELL_FILESIZE + $bsl \\) / $bss`
|
||||
n=`dd bs=$bss count=$cnt | tee -a "${FILENAME}" | wc -c`
|
||||
SHELL_FILESIZE=`expr $SHELL_FILESIZE - $n`
|
||||
done
|
||||
}; echo "### 200"
|
5
src/vfs/shell/helpers/unlink
Normal file
5
src/vfs/shell/helpers/unlink
Normal file
@ -0,0 +1,5 @@
|
||||
if rm -f "/${SHELL_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
12
src/vfs/shell/helpers/utime
Normal file
12
src/vfs/shell/helpers/utime
Normal file
@ -0,0 +1,12 @@
|
||||
if TZ=UTC touch -h -m -d "$SHELL_TOUCHMTIME_W_NSEC" "/${SHELL_FILENAME}" 2>/dev/null && \
|
||||
TZ=UTC touch -h -a -d "$SHELL_TOUCHATIME_W_NSEC" "/${SHELL_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
elif TZ=UTC touch -h -m -t $SHELL_TOUCHMTIME "/${SHELL_FILENAME}" 2>/dev/null && \
|
||||
TZ=UTC touch -h -a -t $SHELL_TOUCHATIME "/${SHELL_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
elif [ -n "$SHELL_HAVE_PERL" ] &&
|
||||
perl -e 'utime '$SHELL_FILEATIME','$SHELL_FILEMTIME',@ARGV;' "/${SHELL_FILENAME}" 2>/dev/null; then
|
||||
echo "### 000"
|
||||
else
|
||||
echo "### 500"
|
||||
fi
|
File diff suppressed because it is too large
Load Diff
@ -1,13 +1,13 @@
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief Header: Virtual File System: FISH implementation for transferring files over
|
||||
* \brief Header: Virtual File System: SHELL implementation for transferring files over
|
||||
* shell connections
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MC__VFS_FISH_H
|
||||
#define MC__VFS_FISH_H
|
||||
#ifndef MC__VFS_SHELL_H
|
||||
#define MC__VFS_SHELL_H
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
@ -17,12 +17,12 @@
|
||||
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
||||
extern int fish_directory_timeout;
|
||||
extern int shell_directory_timeout;
|
||||
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
void vfs_init_fish (void);
|
||||
void vfs_init_shell (void);
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
#endif
|
||||
#endif /* MC__VFS_SHELL_H */
|
@ -1,18 +1,18 @@
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \brief Header: FISH script defaults
|
||||
* \brief Header: SHELL script defaults
|
||||
*/
|
||||
|
||||
#ifndef MC__FISH_DEF_H
|
||||
#define MC__FISH_DEF_H
|
||||
#ifndef MC__VFS_SHELL_DEF_H
|
||||
#define MC__VFS_SHELL_DEF_H
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
/* default 'ls' script */
|
||||
#define FISH_LS_DEF_CONTENT "" \
|
||||
#define VFS_SHELL_LS_DEF_CONTENT "" \
|
||||
"export LC_TIME=C\n" \
|
||||
"ls -Qlan \"/${FISH_FILENAME}\" 2>/dev/null | grep '^[^cbt]' | (\n" \
|
||||
"ls -Qlan \"/${SHELL_FILENAME}\" 2>/dev/null | grep '^[^cbt]' | (\n" \
|
||||
"while read p l u g s m d y n; do\n" \
|
||||
" echo \"P$p $u.$g\"\n" \
|
||||
" echo \"S$s\"\n" \
|
||||
@ -21,7 +21,7 @@
|
||||
" echo\n" \
|
||||
"done\n" \
|
||||
")\n" \
|
||||
"ls -Qlan \"/${FISH_FILENAME}\" 2>/dev/null | grep '^[cb]' | (\n" \
|
||||
"ls -Qlan \"/${SHELL_FILENAME}\" 2>/dev/null | grep '^[cb]' | (\n" \
|
||||
"while read p l u g a i m d y n; do\n" \
|
||||
" echo \"P$p $u.$g\"\n" \
|
||||
" echo \"E$a$i\"\n" \
|
||||
@ -33,110 +33,109 @@
|
||||
"echo \"### 200\"\n"
|
||||
|
||||
/* default file exists script */
|
||||
#define FISH_EXISTS_DEF_CONTENT "" \
|
||||
"ls -l \"/${FISH_FILENAME}\" >/dev/null 2>/dev/null\n" \
|
||||
#define VFS_SHELL_EXISTS_DEF_CONTENT "" \
|
||||
"ls -l \"/${SHELL_FILENAME}\" >/dev/null 2>/dev/null\n" \
|
||||
"echo '### '$?\n"
|
||||
|
||||
/* default 'mkdir' script */
|
||||
#define FISH_MKDIR_DEF_CONTENT "" \
|
||||
"if mkdir \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \
|
||||
#define VFS_SHELL_MKDIR_DEF_CONTENT "" \
|
||||
"if mkdir \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'unlink' script */
|
||||
#define FISH_UNLINK_DEF_CONTENT "" \
|
||||
"if rm -f \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \
|
||||
#define VFS_SHELL_UNLINK_DEF_CONTENT "" \
|
||||
"if rm -f \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'chown' script */
|
||||
#define FISH_CHOWN_DEF_CONTENT "" \
|
||||
"if chown ${FISH_FILEOWNER}:${FISH_FILEGROUP} \"/${FISH_FILENAME}\"; then\n"\
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
#define VFS_SHELL_CHOWN_DEF_CONTENT "" \
|
||||
"if chown ${SHELL_FILEOWNER}:${SHELL_FILEGROUP} \"/${SHELL_FILENAME}\"; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'chmod' script */
|
||||
#define FISH_CHMOD_DEF_CONTENT "" \
|
||||
"if chmod ${FISH_FILEMODE} \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \
|
||||
#define VFS_SHELL_CHMOD_DEF_CONTENT "" \
|
||||
"if chmod ${SHELL_FILEMODE} \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'utime' script */
|
||||
#define FISH_UTIME_DEF_CONTENT "" \
|
||||
"#UTIME \"$FISH_TOUCHATIME_W_NSEC\" \"$FISH_TOUCHMTIME_W_NSEC\" $FISH_FILENAME\n" \
|
||||
"if TZ=UTC touch -h -m -d \"$FISH_TOUCHMTIME_W_NSEC\" \"/${FISH_FILENAME}\" 2>/dev/null && \\\n" \
|
||||
" TZ=UTC touch -h -a -d \"$FISH_TOUCHATIME_W_NSEC\" \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"elif TZ=UTC touch -h -m -t $FISH_TOUCHMTIME \"/${FISH_FILENAME}\" 2>/dev/null && \\\n" \
|
||||
" TZ=UTC touch -h -a -t $FISH_TOUCHATIME \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"elif [ -n \"$FISH_HAVE_PERL\" ] && \\\n" \
|
||||
" perl -e 'utime '$FISH_FILEATIME','$FISH_FILEMTIME',@ARGV;' \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
#define VFS_SHELL_UTIME_DEF_CONTENT "" \
|
||||
"#UTIME \"$SHELL_TOUCHATIME_W_NSEC\" \"$SHELL_TOUCHMTIME_W_NSEC\" $SHELL_FILENAME\n" \
|
||||
"if TZ=UTC touch -h -m -d \"$SHELL_TOUCHMTIME_W_NSEC\" \"/${SHELL_FILENAME}\" 2>/dev/null && \\\n" \
|
||||
" TZ=UTC touch -h -a -d \"$SHELL_TOUCHATIME_W_NSEC\" \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"elif TZ=UTC touch -h -m -t $SHELL_TOUCHMTIME \"/${SHELL_FILENAME}\" 2>/dev/null && \\\n" \
|
||||
" TZ=UTC touch -h -a -t $SHELL_TOUCHATIME \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"elif [ -n \"$SHELL_HAVE_PERL\" ] && \\\n" \
|
||||
" perl -e 'utime '$SHELL_FILEATIME','$SHELL_FILEMTIME',@ARGV;' \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
|
||||
/* default 'rmdir' script */
|
||||
#define FISH_RMDIR_DEF_CONTENT "" \
|
||||
"if rmdir \"/${FISH_FILENAME}\" 2>/dev/null; then\n" \
|
||||
#define VFS_SHELL_RMDIR_DEF_CONTENT "" \
|
||||
"if rmdir \"/${SHELL_FILENAME}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'ln -s' symlink script */
|
||||
#define FISH_LN_DEF_CONTENT "" \
|
||||
"if ln -s \"/${FISH_FILEFROM}\" \"/${FISH_FILETO}\" 2>/dev/null; then\n" \
|
||||
#define VFS_SHELL_LN_DEF_CONTENT "" \
|
||||
"if ln -s \"/${SHELL_FILEFROM}\" \"/${SHELL_FILETO}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'mv' script */
|
||||
#define FISH_MV_DEF_CONTENT "" \
|
||||
"if mv \"/${FISH_FILEFROM}\" \"/${FISH_FILETO}\" 2>/dev/null; then\n" \
|
||||
#define VFS_SHELL_MV_DEF_CONTENT "" \
|
||||
"if mv \"/${SHELL_FILEFROM}\" \"/${SHELL_FILETO}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'ln' hardlink script */
|
||||
#define FISH_HARDLINK_DEF_CONTENT "" \
|
||||
"if ln \"/${FISH_FILEFROM}\" \"/${FISH_FILETO}\" 2>/dev/null; then\n" \
|
||||
#define VFS_SHELL_HARDLINK_DEF_CONTENT "" \
|
||||
"if ln \"/${SHELL_FILEFROM}\" \"/${SHELL_FILETO}\" 2>/dev/null; then\n" \
|
||||
" echo \"### 000\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'retr' script */
|
||||
#define FISH_GET_DEF_CONTENT "" \
|
||||
"export LC_TIME=C\n" \
|
||||
"if dd if=\"/${FISH_FILENAME}\" of=/dev/null bs=1 count=1 2>/dev/null ; then\n" \
|
||||
" ls -ln \"/${FISH_FILENAME}\" 2>/dev/null | (\n" \
|
||||
" read p l u g s r\n" \
|
||||
" echo $s\n" \
|
||||
" )\n" \
|
||||
" echo \"### 100\"\n" \
|
||||
" cat \"/${FISH_FILENAME}\"\n" \
|
||||
" echo \"### 200\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
#define VFS_SHELL_GET_DEF_CONTENT "" \
|
||||
"export LC_TIME=C\n" \
|
||||
"if dd if=\"/${SHELL_FILENAME}\" of=/dev/null bs=1 count=1 2>/dev/null ; then\n" \
|
||||
" ls -ln \"/${SHELL_FILENAME}\" 2>/dev/null | (\n" \
|
||||
" read p l u g s r\n" \
|
||||
" echo $s\n" \
|
||||
" )\n" \
|
||||
" echo \"### 100\"\n" \
|
||||
" cat \"/${SHELL_FILENAME}\"\n" \
|
||||
" echo \"### 200\"\n" \
|
||||
"else\n" \
|
||||
" echo \"### 500\"\n" \
|
||||
"fi\n"
|
||||
|
||||
/* default 'stor' script */
|
||||
#define FISH_SEND_DEF_CONTENT "" \
|
||||
"FILENAME=\"/${FISH_FILENAME}\"\n" \
|
||||
"FILESIZE=${FISH_FILESIZE}\n" \
|
||||
#define VFS_SHELL_SEND_DEF_CONTENT "" \
|
||||
"FILENAME=\"/${SHELL_FILENAME}\"\n" \
|
||||
"FILESIZE=${SHELL_FILESIZE}\n" \
|
||||
"echo \"### 001\"\n" \
|
||||
"{\n" \
|
||||
" while [ $FILESIZE -gt 0 ]; do\n" \
|
||||
@ -147,9 +146,9 @@
|
||||
"}; echo \"### 200\"\n"
|
||||
|
||||
/* default 'appe' script */
|
||||
#define FISH_APPEND_DEF_CONTENT "" \
|
||||
"FILENAME=\"/${FISH_FILENAME}\"\n" \
|
||||
"FILESIZE=${FISH_FILESIZE}\n" \
|
||||
#define VFS_SHELL_APPEND_DEF_CONTENT "" \
|
||||
"FILENAME=\"/${SHELL_FILENAME}\"\n" \
|
||||
"FILESIZE=${SHELL_FILESIZE}\n" \
|
||||
"echo \"### 001\"\n" \
|
||||
"res=`exec 3>&1\n" \
|
||||
"(\n" \
|
||||
@ -168,15 +167,15 @@
|
||||
"}; echo \"### 200\"\n"
|
||||
|
||||
/* default 'info' script */
|
||||
#define FISH_INFO_DEF_CONTENT "" \
|
||||
#define VFS_SHELL_INFO_DEF_CONTENT "" \
|
||||
"export LC_TIME=C\n" \
|
||||
"#FISH_HAVE_HEAD 1\n" \
|
||||
"#FISH_HAVE_SED 2\n" \
|
||||
"#FISH_HAVE_AWK 4\n" \
|
||||
"#FISH_HAVE_PERL 8\n" \
|
||||
"#FISH_HAVE_LSQ 16\n" \
|
||||
"#FISH_HAVE_DATE_MDYT 32\n" \
|
||||
"#FISH_HAVE_TAIL 64\n" \
|
||||
"#SHELL_HAVE_HEAD 1\n" \
|
||||
"#SHELL_HAVE_SED 2\n" \
|
||||
"#SHELL_HAVE_AWK 4\n" \
|
||||
"#SHELL_HAVE_PERL 8\n" \
|
||||
"#SHELL_HAVE_LSQ 16\n" \
|
||||
"#SHELL_HAVE_DATE_MDYT 32\n" \
|
||||
"#SHELL_HAVE_TAIL 64\n" \
|
||||
"res=0\n" \
|
||||
"if `echo yes| head -c 1 > /dev/null 2>&1` ; then\n" \
|
||||
" res=`expr $res + 1`\n" \
|
||||
@ -221,4 +220,5 @@
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
#endif
|
||||
|
||||
#endif /* MC__VFS_SHELL_DEF_H */
|
@ -118,7 +118,7 @@ static const struct test_user_config_paths_ds
|
||||
},
|
||||
{ /* 10. */
|
||||
CONF_DATA,
|
||||
FISH_PREFIX
|
||||
VFS_SHELL_PREFIX
|
||||
},
|
||||
{ /* 11. */
|
||||
CONF_DATA,
|
||||
|
Loading…
Reference in New Issue
Block a user