Martin McCormick wrote:
>A few days ago, I asked about the --include directive in tar
>after things didn't quite work the way the man page seemed to
>indicate. One might get the impression that if --include or
>--include='*pattern*' was added to a tar command, tar would only
>archive what was in the pattern and not archive everything as
>its default operation.
>
>        What I discovered was that --include doesn't appear to
>do anything at all. The example in the man page shows using it
>to filter an existing archive and make a tar file of what was in
>the existing archive that also matched the pattern. I never
>tried that since that is not what was needed here.

There certainly seems to be a bug here, either in the documentation or
the implementation.  The example you mention works as expected for me
on 9-CURRENT, but the --include option fails on, for example:

tar -cvf new.tar --include='baz'  foo/bar

when the pattern baz should match files in the directory foo/bar,
regardless of whether baz contains wildcards or not, or when baz is
anchored at the start or not.  The output is garbage.

>

...

>        The --include directive only seems to exist in the
>FreeBSD form of tar. I tried a Linux system's tar man page and
>it is not there but both support the -X path/filename for a list
>of exclusion patterns.
>

I don't see your point here.  For the sake of compatibility, bsdtar
aims to support GNU tar features, but not _only_ those features. The
--include option is useful for specifying files and directories to
include without having to anchor inclusion patterns from the start,
and without having to use tar -I/-T with an inclusion file, or tar in
conjunction with find(1) -- so the option should be fixed so that it
works.

b.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to