NetBSD Problem Report #1585
From gnats Tue Oct 10 21:53:21 1995
Received: from netbsd4me.jpl.nasa.gov by pain.lcs.mit.edu (8.6.9/8.6.9) with ESMTP id VAA29235 for <gnats-bugs@NetBSD.ORG>; Tue, 10 Oct 1995 21:45:12 -0400
Message-Id: <199510110144.SAA00612@netbsd4me.jpl.nasa.gov>
Date: Tue, 10 Oct 1995 18:44:32 -0700
From: earle@netbsd4me.jpl.nasa.gov
Reply-To: earle@netbsd4me.jpl.nasa.gov
To: gnats-bugs@NetBSD.ORG
Subject: tar "-P" option not documented in the man page
X-Send-Pr-Version: 3.2
>Number: 1585
>Category: misc
>Synopsis: The tar man page does not document the "-P" option.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: misc-bug-people
>State: closed
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Tue Oct 10 22:05:07 +0000 1995
>Closed-Date: Wed Mar 13 14:59:59 +0000 1996
>Last-Modified: Wed Mar 13 15:01:25 +0000 1996
>Originator: Greg &
>Release: 1.0
>Organization:
JPL
>Environment:
System: NetBSD netbsd4me 1.0 NetBSD 1.0 (NETBSD4ME) #5: Wed Oct 4 01:03:16 PDT 1995 root@netbsd4me:/usr/src/1.0/usr/src/sys/arch/sparc/compile/NETBSD4ME sparc
>Description:
I tried to create a tar archive with an absolute pathname in it.
tar proceeded to tell me
Removing leading / from absolute path names in the archive.
and created the archive with "usr/local/..." instead of "/usr/local/...".
I then read the tar(1) man page, and found no mention of how to override this
obnoxious behavior ;-)
Looking at the code (/usr/src/gnu/usr.bin/tar/create.c and tar.c), it
became obvious that the "-P" switch can be used to allow this behavior (it
sets a flag called f_absolute_paths, gee what do you know). The manual page
makes no mention of the "-P" switch, however. Upon further checking, I did
note that it *is* mentioned in tar.c::describe() in the usage message:
void
describe ()
{
puts ("choose one of the following:");
fputs ("\
...
-P, --absolute-paths don't strip leading `/'s from file names\n\
...
Also, there's a typo in the tar(1) man page source:
netbsdd4me:1:42 % diff -rc1 /usr/src/gnu/usr.bin/tar/tar.1 /tmp/tar.1
*** /usr/src/gnu/usr.bin/tar/tar.1 Mon Nov 21 13:37:18 1994
--- /tmp/tar.1 Tue Oct 10 18:31:41 1995
***************
*** 175,177 ****
.It Fl k
! -It Fl -keep-old-files
Keep files which already exist on disk; don't overwrite them from the archive.
--- 175,177 ----
.It Fl k
! .It Fl -keep-old-files
Keep files which already exist on disk; don't overwrite them from the archive.
>How-To-Repeat:
RTFM tar(1) :-)
>Fix:
Add something to the man page that documents the "-P" option. e.g.
netbsd4me:1:45 % diff -rc1 /usr/src/gnu/usr.bin/tar/tar.1 /tmp/tar.1
*** /usr/src/gnu/usr.bin/tar/tar.1 Mon Nov 21 13:37:18 1994
--- /tmp/tar.1 Tue Oct 10 18:35:36 1995
***************
*** 175,177 ****
.It Fl k
! -It Fl -keep-old-files
Keep files which already exist on disk; don't overwrite them from the archive.
--- 175,177 ----
.It Fl k
! .It Fl -keep-old-files
Keep files which already exist on disk; don't overwrite them from the archive.
***************
*** 214,215 ****
--- 214,218 ----
.Fl p s.
+ .It Fl P
+ .It Fl -absolute-paths
+ Don't strip leading `/'s from file names.
.It Fl R
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: is
State-Changed-When: Wed Mar 13 09:59:59 EST 1996
State-Changed-Why:
applied patch to man-page.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.