From owner-freebsd-questions@FreeBSD.ORG Thu May 20 06:06:50 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98D5F106566C; Thu, 20 May 2010 06:06:50 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 049F88FC14; Thu, 20 May 2010 06:06:49 +0000 (UTC) Received: by wye20 with SMTP id 20so1306919wye.13 for ; Wed, 19 May 2010 23:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to :in-reply-to:references:date:message-id:subject:from:to:cc :content-type; bh=zXHsoCuQhURAB6rUKD09D90fLBAGY47Jmj5p6aFk280=; b=E1/EM+6fagXYEQfjQUPEMA3OOXdC4j0dgcPQGZ0NdxvmOsI+/snDEPrZBGtFBJMjYZ 0pbLU50434olRHARvEzXmt8oG6rsHGOCPtsmJ7lBKOcMw2lHhvXRbYXPMbnYXAnmEh/Z B6c3v1139m/C5kNUU/dC9IlnsHbd1jjP61ycI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=xgD/CxdpNcwETJRoTEr5h9OTKlhLGfRLQCaTq385srU8P41GiF9+Y6uUb0TvGlmRUC iGrc1jU2oSd5YQbDmUhEqRqGKXSrK/URh99p0SSntyAkeRgk59Sxa6ZEby84luMIXG2H eVRpEnzz9EpssH0dQv+yZ+LKkGTKp9bzruv/M= MIME-Version: 1.0 Received: by 10.216.86.6 with SMTP id v6mr1681895wee.185.1274335608843; Wed, 19 May 2010 23:06:48 -0700 (PDT) Received: by 10.216.64.68 with HTTP; Wed, 19 May 2010 23:06:48 -0700 (PDT) In-Reply-To: <4BF4CC14.3030809@freebsd.org> References: <4BF4CC14.3030809@freebsd.org> Date: Thu, 20 May 2010 06:06:48 +0000 Message-ID: From: "b. f." To: Tim Kientzle Content-Type: text/plain; charset=ISO-8859-1 Cc: Martin McCormick , freebsd-questions@freebsd.org Subject: Re: tar and --include X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2010 06:06:50 -0000 On 5/20/10, Tim Kientzle wrote: > b. f. wrote: >> Martin McCormick wrote: >>> 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 ... I never >>> tried that since that is not what was needed here. > > The --include directive was designed to support the > case of filtering an existing archive. GNU tar has > no equivalent to bsdtar's @archive feature and hence > has no real need for --include. > ... > >> 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 > > In your example here, the first item > tar inspects is "foo/bar", which does not match > the pattern and therefore is not included. > Excluding a directory excludes everything > in the directory. > > The net result is the same as if you had specified: > tar -cvf new.tar --exclude='foo/bar' foo/bar tar(1) states "The --include option is especially useful when filtering archives." If I understand your comments correctly, this statement should be changed to state that the option is, in fact, _only_ useful when filtering archives. The current description of the option is misleading. b.