[SOLVED] problem with tar and "--exclude" option

Robert P. J. Day rpjday at mindspring.com
Wed Apr 12 11:28:26 UTC 2006


  (well, sort of solved -- i can at least see what it's doing).

given a gzipped tarball with the contents (among other things):

  ./meta/
  ./meta/postinst.sh   (note leading ".", archive created like that)

the busybox form of tar has *very* different behaviour from GNU tar.

  if i use GNU tar and don't want the entire "meta" directory, i just
need to specify *either* of:

  --exclude meta -xvzf ...
  --exclude ./meta -xvzf ...

busybox tar, OTOH, does things differently.

--exclude meta:
	no effect at all, i'm guessing since i really need "./meta"

--exclude ./meta:
	appears to skip "meta" directory during the extraction but
	still extracts what's underneath, so the effect is still
	to extract the directory

--exclude "./meta/*"
	excludes *contents* of "meta" but still extracts an empty
	"meta" directory

--exclude ./meta --exclude "./meta/*"
	*finally* seems to do what i want


  should it really be this non-intuitive and different from GNU tar
behaviour?

rday



More information about the busybox mailing list