From f33f7a5031cf5a88df30ef45477108e668957977 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT service" Date: Tue, 13 Jul 2010 11:38:38 +0400 Subject: [PATCH] VFS: tarfs can now be switched off Signed-off-by: Andrew Borodin --- lib/vfs/mc-vfs/Makefile.am | 8 +++++++- lib/vfs/mc-vfs/vfs-impl.h | 4 +++- lib/vfs/mc-vfs/vfs.c | 4 +++- m4.include/mc-vfs.m4 | 3 +-- m4.include/vfs/mc-vfs-tarfs.m4 | 4 ++-- src/textconf.c | 2 ++ 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lib/vfs/mc-vfs/Makefile.am b/lib/vfs/mc-vfs/Makefile.am index 263cf70ea..41e3320f9 100644 --- a/lib/vfs/mc-vfs/Makefile.am +++ b/lib/vfs/mc-vfs/Makefile.am @@ -16,11 +16,13 @@ BASICFILES = \ utilvfs.c utilvfs.h \ local.c local.h \ gc.c gc.h \ - tar.c \ extfs.c \ sfs.c CPIOFILES = cpio.c +TARFILES = tar.c +SFSFILES = sfs.c +EXTFSFILES = extfs.c UNDELFILES = undelfs.c NETFILES = \ @@ -34,6 +36,9 @@ libvfs_mc_la_SOURCES = $(BASICFILES) if ENABLE_VFS_CPIO libvfs_mc_la_SOURCES += $(CPIOFILES) endif +if ENABLE_VFS_TAR +libvfs_mc_la_SOURCES += $(TARFILES) +endif if ENABLE_VFS_UNDELFS libvfs_mc_la_SOURCES += $(UNDELFILES) endif @@ -47,6 +52,7 @@ endif EXTRA_DIST = HACKING README \ $(BASICFILES) \ $(CPIOFILES) \ + $(TARFILES) \ $(UNDELFILES) \ $(NETFILES) \ $(SMBFILES) diff --git a/lib/vfs/mc-vfs/vfs-impl.h b/lib/vfs/mc-vfs/vfs-impl.h index 167748ed1..d9dd46947 100644 --- a/lib/vfs/mc-vfs/vfs-impl.h +++ b/lib/vfs/mc-vfs/vfs-impl.h @@ -114,10 +114,12 @@ void *vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode #ifdef ENABLE_VFS_CPIO void init_cpiofs (void); #endif +#ifdef ENABLE_VFS_TAR +void init_tarfs (void); +#endif 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 diff --git a/lib/vfs/mc-vfs/vfs.c b/lib/vfs/mc-vfs/vfs.c index b9b38d3b3..21fef9d89 100644 --- a/lib/vfs/mc-vfs/vfs.c +++ b/lib/vfs/mc-vfs/vfs.c @@ -1335,10 +1335,12 @@ vfs_init (void) init_extfs (); init_sfs (); - init_tarfs (); #ifdef ENABLE_VFS_CPIO init_cpiofs (); #endif /* ENABLE_VFS_CPIO */ +#ifdef ENABLE_VFS_TAR + init_tarfs (); +#endif /* ENABLE_VFS_TAR */ #ifdef ENABLE_VFS_UNDELFS init_undelfs (); #endif /* ENABLE_VFS_UNDELFS */ diff --git a/m4.include/mc-vfs.m4 b/m4.include/mc-vfs.m4 index b8f612afe..2edeba59d 100644 --- a/m4.include/mc-vfs.m4 +++ b/m4.include/mc-vfs.m4 @@ -66,7 +66,6 @@ AC_DEFUN([AC_MC_VFS_CHECKS],[ AC_MSG_NOTICE([Enabling VFS code]) - AC_MC_VFS_TARFS AC_MC_VFS_FTP AC_MC_VFS_FISH AC_MC_VFS_EXTFS @@ -77,7 +76,6 @@ AC_DEFUN([AC_MC_VFS_CHECKS],[ else vfs_type="Plain OS filesystem" - AM_CONDITIONAL(ENABLE_VFS_TAR, [false]) AM_CONDITIONAL(ENABLE_VFS_FTP, [false]) AM_CONDITIONAL(ENABLE_VFS_FISH, [false]) AM_CONDITIONAL(ENABLE_VFS_EXTFS, [false]) @@ -85,6 +83,7 @@ AC_DEFUN([AC_MC_VFS_CHECKS],[ fi AC_MC_VFS_CPIOFS + AC_MC_VFS_TARFS AC_MC_VFS_UNDELFS AM_CONDITIONAL(ENABLE_VFS, [test x"$enable_vfs" = x"yes"]) diff --git a/m4.include/vfs/mc-vfs-tarfs.m4 b/m4.include/vfs/mc-vfs-tarfs.m4 index 5cfd825a7..413647649 100644 --- a/m4.include/vfs/mc-vfs-tarfs.m4 +++ b/m4.include/vfs/mc-vfs-tarfs.m4 @@ -2,8 +2,8 @@ dnl TAR filesystem support AC_DEFUN([AC_MC_VFS_TARFS], [ AC_ARG_ENABLE([vfs-tar], - [ --enable-vfs-tar Support for tar filesystem [[yes]]]) - if test x"$enable_vfs_tar" != x"no"; then + AC_HELP_STRING([--enable-vfs-tar], [Support for tar filesystem [[yes]]])) + if test "$enable_vfs" != "no" -a x"$enable_vfs_tar" != x"no"; then enable_vfs_tar="yes" AC_MC_VFS_ADDNAME([tar]) AC_DEFINE([ENABLE_VFS_TAR], [1], [Support for tar filesystem]) diff --git a/src/textconf.c b/src/textconf.c index 232b4c099..43eb22a3e 100644 --- a/src/textconf.c +++ b/src/textconf.c @@ -36,7 +36,9 @@ static const char *const vfs_supported[] = { #ifdef ENABLE_VFS_CPIO "cpiofs", #endif +#ifdef ENABLE_VFS_TAR "tarfs", +#endif "extfs", #ifdef ENABLE_VFS_UNDELFS "undelfs",