summaryrefslogtreecommitdiffstats
path: root/bin/pax
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committersjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit65145fa4c81da358fcbc3b650156dab705dfa34e (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /bin/pax
parent60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff)
parente6b664c390af88d4a87208bc042ce503da664c3b (diff)
downloadFreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip
FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz
Merge sync of head
Diffstat (limited to 'bin/pax')
-rw-r--r--bin/pax/ar_io.c4
-rw-r--r--bin/pax/ar_subs.c1
-rw-r--r--bin/pax/buf_subs.c1
-rw-r--r--bin/pax/cache.c1
-rw-r--r--bin/pax/cpio.c2
-rw-r--r--bin/pax/extern.h1
-rw-r--r--bin/pax/file_subs.c1
-rw-r--r--bin/pax/gen_subs.c2
-rw-r--r--bin/pax/getoldopt.c3
-rw-r--r--bin/pax/options.c24
-rw-r--r--bin/pax/pat_rep.c2
-rw-r--r--bin/pax/pax.118
-rw-r--r--bin/pax/pax.c2
-rw-r--r--bin/pax/sel_subs.c1
-rw-r--r--bin/pax/tar.c2
-rw-r--r--bin/pax/tty_subs.c1
16 files changed, 33 insertions, 33 deletions
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c
index 4914c85..57aa46d 100644
--- a/bin/pax/ar_io.c
+++ b/bin/pax/ar_io.c
@@ -82,7 +82,7 @@ static int wr_trail = 1; /* trailer was rewritten in append */
static int can_unlnk = 0; /* do we unlink null archives? */
const char *arcname; /* printable name of archive */
const char *gzip_program; /* name of gzip program */
-static pid_t zpid = -1; /* pid of child process */
+static pid_t zpid = -1; /* pid of child process */
static int get_phys(void);
static void ar_start_gzip(int, const char *, int);
@@ -1123,7 +1123,7 @@ ar_next(void)
if (sigprocmask(SIG_SETMASK, &o_mask, NULL) < 0)
syswarn(0, errno, "Unable to restore signal mask");
- if (done || !wr_trail || strcmp(NM_TAR, argv0) == 0)
+ if (done || !wr_trail || Oflag || strcmp(NM_TAR, argv0) == 0)
return(-1);
tty_prnt("\nATTENTION! %s archive volume change required.\n", argv0);
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c
index 4a3e5e7..bcab2fc 100644
--- a/bin/pax/ar_subs.c
+++ b/bin/pax/ar_subs.c
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
-#include <stdlib.h>
#include "pax.h"
#include "extern.h"
diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c
index 995e34c..4922fc8 100644
--- a/bin/pax/buf_subs.c
+++ b/bin/pax/buf_subs.c
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "pax.h"
#include "extern.h"
diff --git a/bin/pax/cache.c b/bin/pax/cache.c
index 358707d..f6e52b4 100644
--- a/bin/pax/cache.c
+++ b/bin/pax/cache.c
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <pwd.h>
#include <grp.h>
-#include <unistd.h>
#include <stdlib.h>
#include "pax.h"
#include "cache.h"
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c
index 0d9cc9f..f385a59 100644
--- a/bin/pax/cpio.c
+++ b/bin/pax/cpio.c
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <stdint.h>
#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
#include "pax.h"
#include "cpio.h"
#include "extern.h"
diff --git a/bin/pax/extern.h b/bin/pax/extern.h
index 4375694..dc99e64 100644
--- a/bin/pax/extern.h
+++ b/bin/pax/extern.h
@@ -217,6 +217,7 @@ extern int vflag;
extern int Dflag;
extern int Hflag;
extern int Lflag;
+extern int Oflag;
extern int Xflag;
extern int Yflag;
extern int Zflag;
diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c
index 5e4cce1..f18227e 100644
--- a/bin/pax/file_subs.c
+++ b/bin/pax/file_subs.c
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <errno.h>
#include <sys/uio.h>
-#include <stdlib.h>
#include "pax.h"
#include "options.h"
#include "extern.h"
diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c
index 708e8af..232ee77 100644
--- a/bin/pax/gen_subs.c
+++ b/bin/pax/gen_subs.c
@@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
#include <langinfo.h>
#include <stdint.h>
#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
#include <string.h>
#include "pax.h"
#include "extern.h"
diff --git a/bin/pax/getoldopt.c b/bin/pax/getoldopt.c
index 2871721..838ff54 100644
--- a/bin/pax/getoldopt.c
+++ b/bin/pax/getoldopt.c
@@ -19,8 +19,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
-#include "pax.h"
-#include "extern.h"
+int getoldopt(int, char **, const char *);
int
getoldopt(int argc, char **argv, const char *optstring)
diff --git a/bin/pax/options.c b/bin/pax/options.c
index c6ebea2..06e487c 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -194,7 +194,7 @@ pax_options(int argc, char **argv)
/*
* process option flags
*/
- while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLPT:U:XYZ"))
+ while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ"))
!= -1) {
switch (c) {
case 'a':
@@ -447,6 +447,12 @@ pax_options(int argc, char **argv)
Lflag = 1;
flg |= CLF;
break;
+ case 'O':
+ /*
+ * Force one volume. Non standard option.
+ */
+ Oflag = 1;
+ break;
case 'P':
/*
* do NOT follow symlinks (default)
@@ -584,7 +590,7 @@ tar_options(int argc, char **argv)
{
int c;
int fstdin = 0;
- int Oflag = 0;
+ int tar_Oflag = 0;
int nincfiles = 0;
int incfiles_max = 0;
struct incfile {
@@ -664,7 +670,7 @@ tar_options(int argc, char **argv)
if (opt_add("write_opt=nodir") < 0)
tar_usage();
case 'O':
- Oflag = 1;
+ tar_Oflag = 1;
break;
case 'p':
/*
@@ -820,8 +826,8 @@ tar_options(int argc, char **argv)
* (unless -o specified)
*/
if (act == ARCHIVE || act == APPND)
- frmt = &(fsub[Oflag ? F_OTAR : F_TAR]);
- else if (Oflag) {
+ frmt = &(fsub[tar_Oflag ? F_OTAR : F_TAR]);
+ else if (tar_Oflag) {
paxwarn(1, "The -O/-o options are only valid when writing an archive");
tar_usage(); /* only valid when writing */
}
@@ -1526,25 +1532,25 @@ no_op(void)
void
pax_usage(void)
{
- (void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr);
+ (void)fputs("usage: pax [-cdnOvz] [-E limit] [-f archive] ", stderr);
(void)fputs("[-s replstr] ... [-U user] ...", stderr);
(void)fputs("\n [-G group] ... ", stderr);
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
(void)fputs("[pattern ...]\n", stderr);
- (void)fputs(" pax -r [-cdiknuvzDYZ] [-E limit] ", stderr);
+ (void)fputs(" pax -r [-cdiknOuvzDYZ] [-E limit] ", stderr);
(void)fputs("[-f archive] [-o options] ... \n", stderr);
(void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
(void)fputs("[-U user] ... [-G group] ...\n ", stderr);
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
(void)fputs(" [pattern ...]\n", stderr);
- (void)fputs(" pax -w [-dituvzHLPX] [-b blocksize] ", stderr);
+ (void)fputs(" pax -w [-dituvzHLOPX] [-b blocksize] ", stderr);
(void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
(void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
(void)fputs("[-o options] ... [-U user] ...", stderr);
(void)fputs("\n [-G group] ... ", stderr);
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
(void)fputs("[file ...]\n", stderr);
- (void)fputs(" pax -r -w [-diklntuvDHLPXYZ] ", stderr);
+ (void)fputs(" pax -r -w [-diklntuvDHLOPXYZ] ", stderr);
(void)fputs("[-p string] ... [-s replstr] ...", stderr);
(void)fputs("\n [-U user] ... [-G group] ... ", stderr);
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index 7b07975..e8d17db 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <errno.h>
#ifdef NET2_REGEX
#include <regexp.h>
#else
diff --git a/bin/pax/pax.1 b/bin/pax/pax.1
index aa3025a..c2e1731 100644
--- a/bin/pax/pax.1
+++ b/bin/pax/pax.1
@@ -33,7 +33,7 @@
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd December 21, 2013
+.Dd March 17, 2015
.Dt PAX 1
.Os
.Sh NAME
@@ -41,7 +41,7 @@
.Nd read and write file archives and copy directory hierarchies
.Sh SYNOPSIS
.Nm
-.Op Fl cdnvz
+.Op Fl cdnvzO
.Bk -words
.Op Fl f Ar archive
.Ek
@@ -68,7 +68,7 @@
.Op Ar pattern ...\&
.Nm
.Fl r
-.Op Fl cdiknuvzDYZ
+.Op Fl cdiknuvzDOYZ
.Bk -words
.Op Fl f Ar archive
.Ek
@@ -104,7 +104,7 @@
.Op Ar pattern ...\&
.Nm
.Fl w
-.Op Fl dituvzHLPX
+.Op Fl dituvzHLOPX
.Bk -words
.Op Fl b Ar blocksize
.Ek
@@ -147,7 +147,7 @@
.Nm
.Fl r
.Fl w
-.Op Fl diklntuvDHLPXYZ
+.Op Fl diklntuvDHLOPXYZ
.Bk -words
.Op Fl p Ar string
.Ar ...\&
@@ -853,6 +853,13 @@ Follow only command line symbolic links while performing a physical file
system traversal.
.It Fl L
Follow all symbolic links to perform a logical file system traversal.
+.It Fl O
+Force the archive to be one volume.
+If a volume ends prematurely,
+.Nm
+will not prompt for a new volume.
+This option can be useful for
+automated tasks where error recovery cannot be performed by a human.
.It Fl P
Do not follow symbolic links, perform a physical file system traversal.
This is the default mode.
@@ -1176,6 +1183,7 @@ The options
.Fl G ,
.Fl H ,
.Fl L ,
+.Fl O ,
.Fl P ,
.Fl T ,
.Fl U ,
diff --git a/bin/pax/pax.c b/bin/pax/pax.c
index 040db74..4e97610 100644
--- a/bin/pax/pax.c
+++ b/bin/pax/pax.c
@@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "pax.h"
#include "extern.h"
static int gen_init(void);
@@ -85,6 +84,7 @@ int vflag; /* produce verbose output */
int Dflag; /* same as uflag except inode change time */
int Hflag; /* follow command line symlinks (write only) */
int Lflag; /* follow symlinks when writing */
+int Oflag; /* limit to single volume */
int Xflag; /* archive files with same device id only */
int Yflag; /* same as Dflg except after name mode */
int Zflag; /* same as uflg except after name mode */
diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c
index fe131f7..e9cc759 100644
--- a/bin/pax/sel_subs.c
+++ b/bin/pax/sel_subs.c
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <string.h>
#include <strings.h>
-#include <unistd.h>
#include <stdlib.h>
#include "pax.h"
#include "sel_subs.h"
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index 4ee2786a8..32bdd6e 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$");
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
#include "pax.h"
#include "extern.h"
#include "tar.h"
diff --git a/bin/pax/tty_subs.c b/bin/pax/tty_subs.c
index b3d140e..b63da86 100644
--- a/bin/pax/tty_subs.c
+++ b/bin/pax/tty_subs.c
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
-#include <stdlib.h>
#include <string.h>
#include "pax.h"
#include "extern.h"
OpenPOWER on IntegriCloud