From 5df06e76306db7dca022b7a1ae9ce496b5a798af Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT service" Date: Sat, 10 Jul 2010 20:03:38 +0400 Subject: [PATCH] VFS: fixups of UNDELFS VFS switch on/off. Signed-off-by: Andrew Borodin --- lib/vfs/mc-vfs/vfs-impl.h | 2 ++ lib/vfs/mc-vfs/vfs.c | 4 ++-- m4.include/mc-vfs.m4 | 4 ++-- m4.include/vfs/mc-vfs-undelfs.m4 | 13 +++++-------- src/cmd.c | 8 ++++---- src/keybind.c | 2 +- src/main.c | 6 +++--- src/textconf.c | 6 +++--- 8 files changed, 22 insertions(+), 23 deletions(-) diff --git a/lib/vfs/mc-vfs/vfs-impl.h b/lib/vfs/mc-vfs/vfs-impl.h index 4b8e848b3..3d1d61a3c 100644 --- a/lib/vfs/mc-vfs/vfs-impl.h +++ b/lib/vfs/mc-vfs/vfs-impl.h @@ -116,7 +116,9 @@ void init_extfs (void); void init_fish (void); void init_sfs (void); void init_tarfs (void); +#ifdef ENABLE_VFS_UNDELFS void init_undelfs (void); +#endif #endif /* ENABLE_VFS */ diff --git a/lib/vfs/mc-vfs/vfs.c b/lib/vfs/mc-vfs/vfs.c index fba92c4da..a246a285c 100644 --- a/lib/vfs/mc-vfs/vfs.c +++ b/lib/vfs/mc-vfs/vfs.c @@ -1338,9 +1338,9 @@ vfs_init (void) init_tarfs (); init_cpiofs (); -#ifdef USE_EXT2FSLIB +#ifdef ENABLE_VFS_UNDELFS init_undelfs (); -#endif /* USE_EXT2FSLIB */ +#endif /* ENABLE_VFS_UNDELFS */ #ifdef USE_NETCODE init_ftpfs (); diff --git a/m4.include/mc-vfs.m4 b/m4.include/mc-vfs.m4 index 213b01171..a604f904b 100644 --- a/m4.include/mc-vfs.m4 +++ b/m4.include/mc-vfs.m4 @@ -72,7 +72,6 @@ AC_DEFUN([AC_MC_VFS_CHECKS],[ AC_MC_VFS_FISH AC_MC_VFS_EXTFS AC_MC_VFS_SFS - AC_MC_VFS_UNDELFS AC_MC_VFS_SAMBA MC_WITH_VFS @@ -85,8 +84,9 @@ AC_DEFUN([AC_MC_VFS_CHECKS],[ AM_CONDITIONAL(ENABLE_VFS_FISH, [false]) AM_CONDITIONAL(ENABLE_VFS_EXTFS, [false]) AM_CONDITIONAL(ENABLE_VFS_SFS, [false]) - AM_CONDITIONAL(ENABLE_VFS_UNDELFS, [false]) fi + AC_MC_VFS_UNDELFS + AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"]) ]) diff --git a/m4.include/vfs/mc-vfs-undelfs.m4 b/m4.include/vfs/mc-vfs-undelfs.m4 index 0cb78fbc2..9ed2029c6 100644 --- a/m4.include/vfs/mc-vfs-undelfs.m4 +++ b/m4.include/vfs/mc-vfs-undelfs.m4 @@ -1,7 +1,7 @@ dnl MC_UNDELFS_CHECKS dnl Check for ext2fs undel support. dnl Set shell variable ext2fs_undel to "yes" if we have it, -dnl "no" otherwise. May define USE_EXT2FSLIB for cpp. +dnl "no" otherwise. May define ENABLE_VFS_UNDELFS for cpp. dnl Will set EXT2FS_UNDEL_LIBS to required libraries. AC_DEFUN([MC_UNDELFS_CHECKS], [ @@ -20,8 +20,6 @@ AC_DEFUN([MC_UNDELFS_CHECKS], [ #endif ]) if test x"$ext2fs_ext2fs_h" = xyes; then - AC_DEFINE(USE_EXT2FSLIB, 1, - [Define to enable undelete support on ext2]) ext2fs_undel=yes EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err" AC_CHECK_TYPE(ext2_ino_t, , @@ -49,14 +47,13 @@ dnl Ext2fs undelete support dnl AC_DEFUN([AC_MC_VFS_UNDELFS], [ - AC_ARG_ENABLE([undelfs], - [ --enable-vfs-undelfs Support for ext2 undelete filesystem]) - - if test x"$enable_vfs_undelfs" = x"yes" ; then + AC_ARG_ENABLE([vfs-undelfs], + AC_HELP_STRING([--enable-vfs-undelfs], [Support for ext2 undelete filesystem])) + if test x"$enable_vfs" != x"no" -a x"$enable_vfs_undelfs" != x"no"; then MC_UNDELFS_CHECKS - if test x"$ext2fs_undel" = xyes; then + if test x"$ext2fs_undel" = x"yes"; then enable_vfs_undelfs="yes" AC_MC_VFS_ADDNAME([undelfs]) AC_DEFINE(ENABLE_VFS_UNDELFS, [1], [Support for ext2 undelfs]) diff --git a/src/cmd.c b/src/cmd.c index be9a6ec23..748743af1 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1222,7 +1222,7 @@ get_random_hint (int force) return result; } -#if defined(USE_NETCODE) || defined(USE_EXT2FSLIB) +#if defined(USE_NETCODE) || defined(ENABLE_VFS_UNDELFS) static void nice_cd (const char *text, const char *xtext, const char *help, const char *history_name, const char *prefix, int to_home) @@ -1252,7 +1252,7 @@ nice_cd (const char *text, const char *xtext, const char *help, g_free (cd_path); g_free (machine); } -#endif /* USE_NETCODE || USE_EXT2FSLIB */ +#endif /* USE_NETCODE || ENABLE_VFS_UNDELFS */ #ifdef USE_NETCODE @@ -1284,7 +1284,7 @@ smblink_cmd (void) #endif /* ENABLE_VFS_SMB */ #endif /* USE_NETCODE */ -#ifdef USE_EXT2FSLIB +#ifdef ENABLE_VFS_UNDELFS void undelete_cmd (void) { @@ -1292,7 +1292,7 @@ undelete_cmd (void) _("Enter device (without /dev/) to undelete\nfiles on: (F1 for details)"), "[Undelete File System]", ":undelete_cmd: Undel on ext2 fs ", "/#undel:", 0); } -#endif /* USE_EXT2FSLIB */ +#endif /* ENABLE_VFS_UNDELFS */ void quick_cd_cmd (void) diff --git a/src/keybind.c b/src/keybind.c index 382de3cb8..efcea7d3b 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -386,7 +386,7 @@ static name_keymap_t command_names[] = { { "CmdSymlink", CK_SymlinkCmd }, { "CmdTree", CK_TreeCmd }, { "CmdTreeBox", CK_TreeBoxCmd }, -#ifdef USE_EXT2FSLIB +#ifdef ENABLE_VFS_UNDELFS { "CmdUndelete", CK_UndeleteCmd }, #endif { "CmdUnselect", CK_UnselectCmd }, diff --git a/src/main.c b/src/main.c index b89f4f41d..1cec8b2da 100644 --- a/src/main.c +++ b/src/main.c @@ -757,7 +757,7 @@ create_command_menu (void) #endif entries = g_list_append (entries, menu_entry_create (_("Screen lis&t"), CK_DialogListCmd)); entries = g_list_append (entries, menu_separator_create ()); -#ifdef USE_EXT2FSLIB +#ifdef ENABLE_VFS_UNDELFS entries = g_list_append (entries, menu_entry_create (_("&Undelete files (ext2fs only)"), CK_UndeleteCmd)); @@ -766,7 +766,7 @@ create_command_menu (void) entries = g_list_append (entries, menu_entry_create (_("&Listing format edit"), CK_ListmodeCmd)); #endif -#if defined (USE_EXT2FSLIB) || defined (LISTMODE_EDITOR) +#if defined (ENABLE_VFS_UNDELFS) || defined (LISTMODE_EDITOR) entries = g_list_append (entries, menu_separator_create ()); #endif entries = @@ -1398,7 +1398,7 @@ midnight_execute_cmd (Widget * sender, unsigned long command) case CK_TreeBoxCmd: treebox_cmd (); break; -#ifdef USE_EXT2FSLIB +#ifdef ENABLE_VFS_UNDELFS case CK_UndeleteCmd: undelete_cmd (); break; diff --git a/src/textconf.c b/src/textconf.c index f27bcedcf..5cf488509 100644 --- a/src/textconf.c +++ b/src/textconf.c @@ -36,6 +36,9 @@ static const char *const vfs_supported[] = { "tarfs", "extfs", "cpiofs", +#ifdef ENABLE_VFS_UNDELFS + "undelfs", +#endif #ifdef USE_NETCODE "ftpfs", "fish", @@ -43,9 +46,6 @@ static const char *const vfs_supported[] = { "smbfs", # endif /* ENABLE_VFS_SMB */ #endif /* USE_NETCODE */ -#ifdef USE_EXT2FSLIB - "undelfs", -#endif NULL }; #endif /* ENABLE_VFS */