summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-08-10 03:08:01 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-08-10 03:08:01 +0000
commit8c954d1d2788d2127af116c848b5768865fba6d9 (patch)
tree2e78fd59dde17d1bcc0ab7e733e30bc85955fcf5
parent647b535c9b82a3e09126dcfd4d592e6ae11f428b (diff)
Add support for -h in tar emulation mode to follow symlinks
-rw-r--r--bin/pax/options.c12
-rw-r--r--bin/pax/tar.17
2 files changed, 14 insertions, 5 deletions
diff --git a/bin/pax/options.c b/bin/pax/options.c
index 05cdb90a544..e62b2c29718 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.7 1996/08/02 12:41:01 deraadt Exp $ */
+/* $OpenBSD: options.c,v 1.8 1996/08/10 03:08:00 tholo Exp $ */
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: options.c,v 1.7 1996/08/02 12:41:01 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: options.c,v 1.8 1996/08/10 03:08:00 tholo Exp $";
#endif
#endif /* not lint */
@@ -603,7 +603,7 @@ tar_options(argc, argv)
/*
* process option flags
*/
- while ((c = getoldopt(argc, argv, "b:cef:moprutvwxzBHLPXZ014578"))
+ while ((c = getoldopt(argc, argv, "b:cef:hmoprutvwxzBHLPXZ014578"))
!= EOF) {
switch(c) {
case 'b':
@@ -642,6 +642,12 @@ tar_options(argc, argv)
fstdin = 0;
arcname = optarg;
break;
+ case 'h':
+ /*
+ * follow symlinks
+ */
+ Lflag = 1;
+ break;
case 'm':
/*
* do not preserve modification time
diff --git a/bin/pax/tar.1 b/bin/pax/tar.1
index a492224f42d..78037f2a484 100644
--- a/bin/pax/tar.1
+++ b/bin/pax/tar.1
@@ -27,7 +27,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: tar.1,v 1.1 1996/06/11 18:07:13 tholo Exp $
+.\" $OpenBSD: tar.1,v 1.2 1996/08/10 03:08:00 tholo Exp $
.\"
.Dd June 11, 1996
.Dt TAR 1
@@ -37,7 +37,7 @@
.Nd tape archiver
.Sh SYNOPSIS
.Nm tar
-.No [-]{crtux}[befmopvwzHLPXZ014578]
+.No [-]{crtux}[befhmopvwzHLPXZ014578]
.Op Ar archive
.Op Ar blocksize
.Ar file1
@@ -84,6 +84,9 @@ Stop after first error.
.It Fl f Ar archive
Filename where the archive is stored. Defaults to
.Pa /dev/rmt8
+.It Fl h
+Follow symbolic links as if they were normal files
+or directories.
.It Fl m
Do not preserve modification time.
.It Fl o