+2007-05-23 Koji Arai <arai@users.sourceforge.jp>
+
+ * config.h.in, configure.ac, src/lharc.c: the option -X was deprecated.
+ In place of it, added a long option --ignore-mac-files which
+ ignore Mac specific files ._*, .DS_Store and Icon\r when the
+ archive is created. Thanks to Hiroto Sakai.
+
2007-05-20 Koji Arai <arai@users.sourceforge.jp>
- * repository changed into the Subversion.
+ * repository changed to the Subversion.
* tests/lha-test12: should not use the raw CR code.
(when checkout from SVN repos, raw CR code is removed.)
[Define to 1 if you want to leave an old archive])
fi
-# enable this option if you need to ignore '.file' files
-# (mainly for the Mac OS X) *experimental*
-AC_MSG_CHECKING(whether enable -X option which ignore dot files)
-AC_ARG_ENABLE(ignore-dot-files,
- AC_HELP_STRING([--enable-ignore-dot-files],
- [enable -X option [[default=no]]]),
- ,
- # default
- enable_ignore_dot_files=no)
-
-AC_MSG_RESULT($enable_ignore_dot_files)
-if test "x$enable_ignore_dot_files" = xyes; then
- AC_DEFINE(IGNORE_DOT_FILES, 1,
- [Define to 1 if you want to ignore dot files with -X command line switch])
-fi
-
case $host_os in
*msdosdjgpp*)
CFLAGS="$CFLAGS -DNOT_COMPATIBLE_MODE"
static void
print_tiny_usage()
{
-#if HAVE_LIBAPPLEFILE
fprintf(stdout, "\
usage: lha [-]<commands>[<options>] [-<options> ...] archive_file [file...]\n\
commands: [axelvudmcpt]\n\
- options: [q[012]vnfto[567]dizg012eb[w=<dir>|x=<pattern>]]\n\
- long options: --system-kanji-code={euc,sjis,utf8,cap}\n\
- --archive-kanji-code={euc,sjis,utf8,cap}\n\
- --extract-broken-archive\n\
- --convert-filename-case\n\
- --help\n\
- --version\n");
-#else
- fprintf(stdout, "\
-usage: lha [-]<commands>[<options>] [-<options> ...] archive_file [file...]\n\
- commands: [axelvudmcpt]\n\
- options: [q[012]vnfto[567]dizg012e[w=<dir>|x=<pattern>]]\n\
+ options: [q[012]vnfto[567]dizg012%s%s[w=<dir>|x=<pattern>]]\n\
long options: --system-kanji-code={euc,sjis,utf8,cap}\n\
--archive-kanji-code={euc,sjis,utf8,cap}\n\
--extract-broken-archive\n\
--convert-filename-case\n\
+ --ignore-mac-files\n\
--traditional\n\
--help\n\
- --version\n");
+ --version\n"
+#ifdef EUC
+ ,"e"
+#else
+ ,""
+#endif
+#if HAVE_LIBAPPLEFILE
+ ,"b" /* decode_macbinary_contents */
+#else
+ ,""
#endif
+ );
}
static void
w=<dir> specify extract directory (x/e)\n\
x=<pattern> eXclude files (a/u/c)\n\
");
-#if IGNORE_DOT_FILES /* experimental feature */
- fprintf(stdout, "\
- X ignore dot files (a/u/c)\n\
-");
-#endif
}
#include "getopt_long.h"
SYSTEM_KANJI_CODE_OPTION,
ARCHIVE_KANJI_CODE_OPTION,
TRADITIONAL_BEHAVIOR,
+ IGNORE_MAC_FILES,
};
struct option long_options[] = {
{"extract-broken-archive", no_argument, &extract_broken_archive, 1},
{"convert-filename-case", no_argument, &convertcase, TRUE},
{"traditional", no_argument, 0, TRADITIONAL_BEHAVIOR},
+ {"ignore-mac-files", no_argument, 0, IGNORE_MAC_FILES},
{0, 0, 0, 0}
};
int i;
char short_options[256] = "q[012]vnfto[567]dizg012ew:x:";
/* "[...]" means optional 1 byte argument (original extention) */
-#if IGNORE_DOT_FILES
- strncat(short_options, "X", sizeof(short_options)-strlen(short_options)-1);
-#endif
#if HAVE_LIBAPPLEFILE
strncat(short_options, "b", sizeof(short_options)-strlen(short_options)-1);
#endif
exclude_files[i+1] = 0;
break;
-#if IGNORE_DOT_FILES /* experimental feature */
- case 'X':
- for (i = 0; exclude_files && exclude_files[i]; i++)
- ;
- exclude_files = (char**)xrealloc(exclude_files,
- sizeof(char*) * (i+2));
-
- exclude_files[i] = xstrdup(".*");
- exclude_files[i+1] = 0;
- break;
-#endif
case 'w':
if (!optarg) {
error("working directory does not specified for `-w'");
convertcase = TRUE;
break;
+ case IGNORE_MAC_FILES:
+ /* ignore Mac specific files (._*, .DS_Store and Icon\r)
+ when archiving */
+ for (i = 0; exclude_files && exclude_files[i]; i++)
+ ;
+ exclude_files = (char**)xrealloc(exclude_files,
+ sizeof(char*) * (i+4));
+
+ exclude_files[i] = xstrdup("._*");
+ exclude_files[i+1] = xstrdup(".DS_Store");
+ exclude_files[i+2] = xstrdup("Icon\r");
+ exclude_files[i+3] = 0;
+ break;
+
default:
error("unknown option `-%c'.", c);
return -1;