/* Tar -- a tape archiver.
- Copyright (C) 1988, 1992 Free Software Foundation
+ Copyright (C) 1988, 1992, 1993 Free Software Foundation
This file is part of GNU Tar.
#include <sys/types.h> /* Needed for typedefs in tar.h */
#include "getopt.h"
#include "regex.h"
-#include "fnmatch.h"
/*
* The following causes "tar.h" to produce definitions of all the
#include "tar.h"
#include "port.h"
-
-#if defined(_POSIX_VERSION) || defined(DIRENT)
-#include <dirent.h>
-#ifdef direct
-#undef direct
-#endif /* direct */
-#define direct dirent
-#define DP_NAMELEN(x) strlen((x)->d_name)
-#endif /* _POSIX_VERSION or DIRENT */
-#if !defined(_POSIX_VERSION) && !defined(DIRENT) && defined(BSD42)
-#include <sys/dir.h>
-#define DP_NAMELEN(x) (x)->d_namlen
-#endif /* not _POSIX_VERSION and BSD42 */
-#ifdef __MSDOS__
-#include "msd_dir.h"
-#define DP_NAMELEN(x) (x)->d_namlen
-#define direct dirent
-#endif
-#if defined(USG) && !defined(_POSIX_VERSION) && !defined(DIRENT)
-#include <ndir.h>
-#define DP_NAMELEN(x) strlen((x)->d_name)
-#endif /* USG and not _POSIX_VERSION and not DIRENT */
+#include "fnmatch.h"
/*
* We should use a conversion routine that does reasonable error
extern void create_archive ();
extern void update_archive ();
extern void junk_archive ();
+extern void init_volume_number ();
+extern void closeout_volume_number ();
/* JF */
extern time_t get_date ();
{"listed-incremental", 1, 0, 'g'},
{"multi-volume", 0, &f_multivol, 1},
{"info-script", 1, 0, 'F'},
+ {"new-volume-script", 1, 0, 'F'},
{"absolute-paths", 0, &f_absolute_paths, 1},
{"interactive", 0, &f_confirm, 1},
{"confirmation", 0, &f_confirm, 1},
-c, --create create a new archive\n\
-d, --diff,\n\
--compare find differences between archive and file system\n\
---delete delete from the archive (not for use on mag tapes!)\n\
+--delete delete from the archive (not for use on mag tapes!)\n\
-r, --append append files to the end of an archive\n\
-t, --list list the contents of an archive\n\
-u, --update only append files that are newer than copy in archive\n\
DEF_AR_FILE);
fputs ("\
--force-local archive file is local even if has a colon\n\
--F, --info-script F run script at end of each tape (implies -M)\n\
+-F, --info-script F\n\
+ --new-volume-script F run script at end of each tape (implies -M)\n\
-G, --incremental create/list/extract old GNU-format incremental backup\n\
-g, --listed-incremental F create/list/extract new GNU-format incremental backup\n\
-h, --dereference don't dump symlinks; dump the files they point to\n\
-i, --ignore-zeros ignore blocks of zeros in archive (normally mean EOF)\n\
--ignore-failed-read don't exit with non-zero status on unreadable files\n\
-k, --keep-old-files keep existing files; don't overwrite them from archive\n\
--K, --starting-file FILE begin at FILE in the archive\n\
+-K, --starting-file F begin at file F in the archive\n\
-l, --one-file-system stay in local file system when creating an archive\n\
--L, --tape-length LENGTH change tapes after writing LENGTH\n\
+-L, --tape-length N change tapes after writing N*1024 bytes\n\
", stdout); /* KLUDGE */
fputs ("\
-m, --modification-time don't extract file modified time\n\
-M, --multi-volume create/list/extract multi-volume archive\n\
-N, --after-date DATE,\n\
- --newer DATE only store files newer than DATE\n\
+ --newer DATE only store files newer than DATE\n\
-o, --old-archive,\n\
--portability write a V7 format archive, rather than ANSI format\n\
-O, --to-stdout extract files to standard output\n\
-S, --sparse handle sparse files efficiently\n\
-T, --files-from F get names to extract or create from file F\n\
--null -T reads null-terminated names, disable -C\n\
---totals print total bytes written with --create\n\
+--totals print total bytes written with --create\n\
-v, --verbose verbosely list files processed\n\
--V, --label NAME create archive with volume name NAME\n\
+-V, --label NAME create archive with volume name NAME\n\
--version print tar program version number\n\
-w, --interactive,\n\
--confirmation ask for confirmation for every action\n\
}
/* End of JF quick -C hack */
+#if 0
if (f_exclude && check_exclude (p))
goto tryagain;
+#endif
return un_quote_string (p);
}
while (p = read_name_from_file (buffer, &buffer_siz, namef))
next_name_is_dir = 0;
goto tryagain;
}
+#if 0
if (f_exclude && check_exclude (p))
goto tryagain;
+#endif
return un_quote_string (p);
}
return NULL;
if (chdir_name[0] != '/')
{
char *path = ck_malloc (PATH_MAX);
-#if defined(__MSDOS__) || defined(USG) || defined(_POSIX_VERSION)
+#if defined(__MSDOS__) || defined(HAVE_GETCWD) || defined(_POSIX_VERSION)
if (!getcwd (path, PATH_MAX))
{
msg ("Couldn't get current directory.");
/* Regular expressions (shell globbing, actually). */
if (nlp->regexp)
{
- if (fnmatch (nlp->name, p, FNM_TARPATH) == 0)
+ if (fnmatch (nlp->name, p, FNM_LEADING_DIR) == 0)
{
nlp->found = 1; /* Remember it matched */
if (f_startfile)
/* Regular expressions */
if (nlp->regexp)
{
- if (fnmatch (nlp->name, p, FNM_TARPATH) == 0)
+ if (fnmatch (nlp->name, p, FNM_LEADING_DIR) == 0)
return nlp; /* We got a match */
continue;
}
for (n = 0; n < size_re_exclude; n++)
{
- if (fnmatch (re_exclude[n], name, FNM_TARPATH) == 0)
+ if (fnmatch (re_exclude[n], name, FNM_LEADING_DIR) == 0)
return 1;
}
for (n = 0; n < size_exclude; n++)