Index: bin/pax/ar_io.c =================================================================== --- bin/pax/ar_io.c (revision 279828) +++ bin/pax/ar_io.c (working copy) @@ -82,7 +82,8 @@ 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 */ +int force_one_volume; /* 1 if we ignore volume changes */ static int get_phys(void); static void ar_start_gzip(int, const char *, int); @@ -1123,7 +1124,7 @@ 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 || force_one_volume || strcmp(NM_TAR, argv0) == 0) return(-1); tty_prnt("\nATTENTION! %s archive volume change required.\n", argv0); Index: bin/pax/extern.h =================================================================== --- bin/pax/extern.h (revision 279828) +++ bin/pax/extern.h (working copy) @@ -45,6 +45,7 @@ */ extern const char *arcname; extern const char *gzip_program; +extern int force_one_volume; int ar_open(const char *); void ar_close(void); void ar_drain(void); Index: bin/pax/options.c =================================================================== --- bin/pax/options.c (revision 279828) +++ bin/pax/options.c (working copy) @@ -194,7 +194,7 @@ /* * 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 @@ Lflag = 1; flg |= CLF; break; + case 'O': + /* + * Force one volume. Non standard option. + */ + force_one_volume = 1; + break; case 'P': /* * do NOT follow symlinks (default) @@ -1526,18 +1532,18 @@ 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); @@ -1544,7 +1550,7 @@ (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); Index: bin/pax/pax.1 =================================================================== --- bin/pax/pax.1 (revision 279828) +++ bin/pax/pax.1 (working copy) @@ -33,7 +33,7 @@ .\" @(#)pax.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 21, 2013 +.Dd May 10, 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,11 @@ 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 +1181,7 @@ .Fl G , .Fl H , .Fl L , +.Fl O , .Fl P , .Fl T , .Fl U ,