Changeset 3793
- Timestamp:
- 09/06/08 18:06:24 (3 months ago)
- Files:
-
- trunk/freewrt/tools/paxmirabilis/src/Makefile (modified) (2 diffs)
- trunk/freewrt/tools/paxmirabilis/src/ar_subs.c (modified) (6 diffs)
- trunk/freewrt/tools/paxmirabilis/src/cpio.1 (modified) (13 diffs)
- trunk/freewrt/tools/paxmirabilis/src/extern.h (modified) (2 diffs)
- trunk/freewrt/tools/paxmirabilis/src/ftree.c (modified) (3 diffs)
- trunk/freewrt/tools/paxmirabilis/src/gen_subs.c (modified) (4 diffs)
- trunk/freewrt/tools/paxmirabilis/src/options.c (modified) (10 diffs)
- trunk/freewrt/tools/paxmirabilis/src/pax.1 (modified) (15 diffs)
- trunk/freewrt/tools/paxmirabilis/src/pax.h (modified) (2 diffs)
- trunk/freewrt/tools/paxmirabilis/src/sel_subs.c (modified) (2 diffs)
- trunk/freewrt/tools/paxmirabilis/src/tables.c (modified) (5 diffs)
- trunk/freewrt/tools/paxmirabilis/src/tables.h (modified) (2 diffs)
- trunk/freewrt/tools/paxmirabilis/src/tar.1 (modified) (5 diffs)
- trunk/freewrt/tools/paxmirabilis/strlfun.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/freewrt/tools/paxmirabilis/src/Makefile
r2029 r3793 1 # $MirOS: src/bin/pax/Makefile,v 1. 4 2006/08/18 18:21:36tg Exp $1 # $MirOS: src/bin/pax/Makefile,v 1.6 2008/05/07 13:50:21 tg Exp $ 2 2 # $OpenBSD: Makefile,v 1.10 2001/05/26 00:32:20 millert Exp $ 3 3 … … 18 18 tar.c tty_subs.c 19 19 MAN= pax.1 tar.1 cpio.1 20 LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio 20 LINKS= ${BINDIR}/pax ${BINDIR}/tar \ 21 ${BINDIR}/pax ${BINDIR}/cpio 21 22 22 .if (${MACHINE_OS} == "Interix") || (${MACHINE_OS} == "Linux") 23 .if (${MACHINE_OS} == "Interix") || (${MACHINE_OS} == "Linux") || (${MACHINE_OS} == "GNU") 23 24 CPPFLAGS+= -DLONG_OFF_T 24 25 .endif trunk/freewrt/tools/paxmirabilis/src/ar_subs.c
r2029 r3793 1 /** $MirOS: src/bin/pax/ar_subs.c,v 1.5 2007/02/17 04:52:39 tg Exp $ */ 2 /* $OpenBSD: ar_subs.c,v 1.29 2006/01/25 17:42:08 markus Exp $ */ 1 /* $OpenBSD: ar_subs.c,v 1.31 2006/11/17 08:38:04 otto Exp $ */ 3 2 /* $NetBSD: ar_subs.c,v 1.5 1995/03/21 09:07:06 cgd Exp $ */ 4 3 … … 51 50 52 51 __SCCSID("@(#)ar_subs.c 8.2 (Berkeley) 4/18/94"); 53 __RCSID("$MirOS: src/bin/pax/ar_subs.c,v 1. 5 2007/02/17 04:52:39tg Exp $");52 __RCSID("$MirOS: src/bin/pax/ar_subs.c,v 1.6 2007/10/23 20:07:41 tg Exp $"); 54 53 55 54 static void wr_archive(ARCHD *, int is_app); … … 326 325 vfpart = 0; 327 326 } 328 continue;327 goto popd; 329 328 } 330 329 /* … … 337 336 (void)rd_skip(arcn->skip + arcn->pad); 338 337 purg_lnk(arcn); 339 continue;338 goto popd; 340 339 } 341 340 /* … … 353 352 (void)rd_skip(cnt + arcn->pad); 354 353 354 popd: 355 355 /* 356 356 * if required, chdir around. … … 410 410 if (is_app) 411 411 goto trailer; 412 else 413 return; 414 } 415 if (((*frmt->st_wr)() < 0)) 416 return; 412 return; 413 } else if (((*frmt->st_wr)() < 0)) 414 return; 415 417 416 wrf = frmt->wr; 418 417 trunk/freewrt/tools/paxmirabilis/src/cpio.1
r2029 r3793 1 .\" $MirOS: src/bin/pax/cpio.1,v 1.1 5 2006/07/21 17:34:59tg Exp $2 .\" $OpenBSD: cpio.1,v 1.2 3 2006/01/03 17:22:47jmc Exp $1 .\" $MirOS: src/bin/pax/cpio.1,v 1.17 2008/03/14 17:05:06 tg Exp $ 2 .\" $OpenBSD: cpio.1,v 1.26 2007/05/31 19:19:15 jmc Exp $ 3 3 .\" 4 4 .\" Copyright (c) 2005 Thorsten Glaser <tg@66h.42h.de> … … 26 26 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 .\" 28 .Dd July 21, 2006 29 .Dt CPIO 1 30 .Os MirBSD 31 .\" for portability 28 .\" $OpenBSD: cpio.1,v 1.26 2007/05/31 19:19:15 jmc Exp $ 29 .\" 30 .\"- 31 .\" Try to make GNU groff and AT&T nroff more compatible 32 .\" * ` generates ‘ in groff, so use \` 33 .\" * ' generates ’ in groff, \' generates ´, so use \*(aq 34 .\" * - generates ‐ in groff, \- generates −, fixed in tmac/mdoc/doc-groff 35 .\" thus use - for hyphens and \- for minus signs and option dashes 36 .\" * ~ is size-reduced and placed atop in groff, so use \*(TI 37 .\" * ^ is size-reduced and placed atop in groff, so use \*(ha 38 .\" * \(en does not work in nroff, so use \*(en 39 .ie \n(.g \{\ 40 . ds aq \(aq 41 . ds TI \(ti 42 . ds ha \(ha 43 . ds en \(en 44 .\} 45 .el \{\ 46 . ds aq ' 47 . ds TI ~ 48 . ds ha ^ 49 . ds en \(em 50 .\} 51 .\" 52 .\" Implement .Dd with the Mdocdate RCS keyword 53 .rn Dd xD 54 .de Dd 55 .ie \\$1$Mdocdate: \{\ 56 . xD \\$2 \\$3, \\$4 57 .\} 58 .el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 59 .. 60 .\" 61 .\" .Dd must come before definition of .Mx, because when called 62 .\" with -mandoc, it might implement .Mx itself, but we want to 63 .\" use our own definition. And .Dd must come *first*, always. 64 .Dd $Mdocdate: March 14 2008 $ 65 .\" 66 .\" Implement .Mx (MirBSD) 32 67 .de Mx 33 68 .nr cF \\n(.f … … 54 89 .\} 55 90 .. 91 .Dt CPIO 1 92 .Os MirBSD 56 93 .Sh NAME 57 94 .Nm cpio … … 60 97 .Nm cpio 61 98 .Fl o 62 .Op Fl aABcLvzZ99 .Op Fl AaBcLvZz 63 100 .Op Fl C Ar bytes 64 101 .Op Fl F Ar archive … … 66 103 .Op Fl M Ar flag 67 104 .Op Fl O Ar archive 68 .Ar "< name-list"69 .Op Ar "> archive"105 .Ar \*(Lt name-list 106 .Op Ar \*(Gt archive 70 107 .Nm cpio 71 108 .Fl i 72 .Op Fl bBcdfmrsStuvzZ6109 .Op Fl 6BbcdfmrSstuvZz 73 110 .Op Fl C Ar bytes 74 111 .Op Fl E Ar file … … 76 113 .Op Fl H Ar format 77 114 .Op Fl I Ar archive 78 .Op Ar "pattern ..."79 .Op Ar "< archive"115 .Op Ar pattern ... 116 .Op Ar \*(Lt archive 80 117 .Nm cpio 81 118 .Fl p 82 .Op Fl ad lLmuv119 .Op Fl adLlmuv 83 120 .Ar destination-directory 84 .Ar "< name-list"121 .Ar \*(Lt name-list 85 122 .Sh DESCRIPTION 86 123 The … … 98 135 output. 99 136 .Bl -tag -width Ds 137 .It Fl A 138 Append to the specified archive. 100 139 .It Fl a 101 140 Reset the access times on files that have been copied to the 102 141 archive. 103 .It Fl A104 Append to the specified archive.105 142 .It Fl B 106 143 Set block size of output to 5120 bytes. 107 .It Fl c108 Use ASCII format for109 .Nm110 header for portability.111 144 .It Fl C Ar bytes 112 145 Set the block size of output to 113 146 .Ar bytes . 147 .It Fl c 148 Use ASCII format for 149 .Nm 150 header for portability. 114 151 .It Fl F Ar archive 115 .It Fl O Ar archive 116 Use the specified file name as the archive to write to. 152 Use the specified file as the input for the archive. 117 153 .It Fl H Ar format 118 154 Write the archive in the specified format. … … 197 233 .Ar links 198 234 specifiers are ignored. 235 .It Fl O Ar archive 236 Use the specified file name as the archive to write to. 199 237 .It Fl v 200 238 Be verbose about operations. 201 239 List filenames as they are written to the archive. 240 .It Fl Z 241 Compress archive using 242 .Xr compress 1 243 format. 202 244 .It Fl z 203 245 Compress archive using 204 246 .Xr gzip 1 205 format.206 .It Fl Z207 Compress archive using208 .Xr compress 1209 247 format. 210 248 .El … … 216 254 that were specified on the command line. 217 255 .Bl -tag -width Ds 256 .It Fl 6 257 Process old-style 258 .Nm 259 format archives. 260 .It Fl B 261 Set the block size of the archive being read to 5120 bytes. 218 262 .It Fl b 219 263 Do byte and word swapping after reading in data from the 220 264 archive, for restoring archives created on systems with 221 265 a different byte order. 222 .It Fl B223 Set the block size of the archive being read to 5120 bytes.224 .It Fl c225 Expect the archive headers to be in ASCII format.226 266 .It Fl C Ar bytes 227 267 Read archive written with a block size of 228 268 .Ar bytes . 269 .It Fl c 270 Expect the archive headers to be in ASCII format. 229 271 .It Fl d 230 272 Create any intermediate directories as needed during … … 233 275 Read list of file name patterns to extract or list from 234 276 .Ar file . 277 .It Fl F Ar archive , Fl I Ar archive 278 Use the specified file as the input for the archive. 235 279 .It Fl f 236 280 Restore all files except those matching the 237 281 .Ar patterns 238 282 given on the command line. 239 .It Fl F Ar archive240 .It Fl I Ar archive241 Use the specified file as the input for the archive.242 283 .It Fl H Ar format 243 284 Read an archive of the specified format. … … 279 320 .It Fl r 280 321 Rename restored files interactively. 322 .It Fl S 323 Swap words after reading data from the archive. 281 324 .It Fl s 282 325 Swap bytes after reading data from the archive. 283 .It Fl S284 Swap words after reading data from the archive.285 326 .It Fl t 286 327 Only list the contents of the archive, no files or … … 292 333 Be verbose about operations. 293 334 List filenames as they are copied in from the archive. 335 .It Fl Z 336 Uncompress archive using 337 .Xr compress 1 338 format. 294 339 .It Fl z 295 340 Uncompress archive using 296 341 .Xr gzip 1 297 342 format. 298 .It Fl Z299 Uncompress archive using300 .Xr compress 1301 format.302 .It Fl 6303 Process old-style304 .Nm305 format archives.306 343 .El 307 344 .It Fl p … … 317 354 Create any intermediate directories as needed to write 318 355 the files at the new location. 356 .It Fl L 357 Follow symbolic links. 319 358 .It Fl l 320 359 When possible, link files rather than creating an 321 360 extra copy. 322 .It Fl L323 Follow symbolic links.324 361 .It Fl m 325 362 Restore modification times on files. trunk/freewrt/tools/paxmirabilis/src/extern.h
r2029 r3793 1 /** $MirOS: src/bin/pax/extern.h,v 1. 9 2007/02/17 04:52:40tg Exp $ */2 /* $OpenBSD: extern.h,v 1.3 1 2005/04/28 06:58:07otto Exp $ */1 /** $MirOS: src/bin/pax/extern.h,v 1.10 2007/10/23 20:07:42 tg Exp $ */ 2 /* $OpenBSD: extern.h,v 1.32 2006/11/17 08:38:04 otto Exp $ */ 3 3 /* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */ 4 4 … … 250 250 extern char *tempfile; 251 251 extern char *tempbase; 252 extern int havechd; 252 253 253 254 int main(int, char **); trunk/freewrt/tools/paxmirabilis/src/ftree.c
r2029 r3793 1 /* $OpenBSD: ftree.c,v 1.2 6 2005/04/21 21:47:18 beckExp $ */1 /* $OpenBSD: ftree.c,v 1.27 2006/12/26 20:58:25 otto Exp $ */ 2 2 /* $NetBSD: ftree.c,v 1.4 1995/03/21 09:07:21 cgd Exp $ */ 3 3 … … 49 49 50 50 __SCCSID("@(#)ftree.c 8.2 (Berkeley) 4/18/94"); 51 __RCSID("$MirOS: src/bin/pax/ftree.c,v 1. 2 2007/02/17 04:52:40tg Exp $");51 __RCSID("$MirOS: src/bin/pax/ftree.c,v 1.3 2007/10/23 20:07:42 tg Exp $"); 52 52 53 53 /* … … 350 350 for (;;) { 351 351 if ((ftent = fts_read(ftsp)) == NULL) { 352 if (errno) 353 syswarn(1, errno, "next_file"); 352 354 /* 353 355 * out of files in this tree, go to next arg, if none trunk/freewrt/tools/paxmirabilis/src/gen_subs.c
r2029 r3793 1 /** $MirOS: src/bin/pax/gen_subs.c,v 1.7 2007/02/17 04:52:40 tg Exp $ */ 2 /* $OpenBSD: gen_subs.c,v 1.18 2005/04/28 06:58:07 otto Exp $ */ 1 /* $OpenBSD: gen_subs.c,v 1.19 2007/04/04 21:55:10 millert Exp $ */ 3 2 /* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */ 4 3 … … 40 39 #include <sys/stat.h> 41 40 #include <stdio.h> 42 #include <tzfile.h>43 41 #ifdef __INTERIX 44 42 #include <utmpx.h> … … 56 54 57 55 __SCCSID("@(#)gen_subs.c 8.1 (Berkeley) 5/31/93"); 58 __RCSID("$MirOS: src/bin/pax/gen_subs.c,v 1. 7 2007/02/17 04:52:40tg Exp $");56 __RCSID("$MirOS: src/bin/pax/gen_subs.c,v 1.9 2008/03/14 15:55:21 tg Exp $"); 59 57 60 58 #ifdef __GLIBC__ … … 157 155 safe_print(arcn->ln_name, fp); 158 156 } else if (arcn->type == PAX_SLK) { 159 fputs(" => ", fp);157 fputs(" -> ", fp); 160 158 safe_print(arcn->ln_name, fp); 161 159 } trunk/freewrt/tools/paxmirabilis/src/options.c
r2029 r3793 1 /** $MirOS: src/bin/pax/options.c,v 1.24 2007/02/17 04:52:41 tg Exp $ */ 2 /* $OpenBSD: options.c,v 1.64 2006/04/09 03:35:34 jaredy Exp $ */ 1 /* $OpenBSD: options.c,v 1.67 2007/02/24 09:50:55 jmc Exp $ */ 3 2 /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ 4 3 … … 58 57 59 58 __SCCSID("@(#)options.c 8.2 (Berkeley) 4/18/94"); 60 __RCSID("$MirOS: src/bin/pax/options.c,v 1.2 4 2007/02/17 04:52:41tg Exp $");59 __RCSID("$MirOS: src/bin/pax/options.c,v 1.26 2008/08/07 19:40:39 tg Exp $"); 61 60 62 61 #ifdef __GLIBC__ … … 175 174 176 175 /* 176 * Do we have -C anywhere? 177 */ 178 int havechd = 0; 179 180 /* 177 181 * options() 178 182 * figure out if we are pax, tar or cpio. Call the appropriate options … … 183 187 options(int argc, char **argv) 184 188 { 189 size_t n; 185 190 186 191 /* 187 192 * Are we acting like pax, tar or cpio (based on argv[0]) 188 193 */ 189 if ((argv0 = strrchr(argv[0], '/')) != NULL) 190 argv0++; 191 else 192 argv0 = argv[0]; 193 194 if (strcmp(NM_TAR, argv0) == 0) { 194 if ((n = strlen(argv[0])) >= 3 && !strcmp(argv[0] + n - 3, NM_TAR)) { 195 argv0 = NM_TAR; 195 196 tar_options(argc, argv); 196 return;197 } else if (strcmp(NM_CPIO, argv0) == 0) {197 } else if (n >= 4 && !strcmp(argv[0] + n - 4, NM_CPIO)) { 198 argv0 = NM_CPIO; 198 199 cpio_options(argc, argv); 199 return; 200 } 201 /* 202 * assume pax as the default 203 */ 204 argv0 = NM_PAX; 205 pax_options(argc, argv); 200 } else { 201 argv0 = NM_PAX; 202 pax_options(argc, argv); 203 } 206 204 } 207 205 … … 794 792 break; 795 793 case 'C': 794 havechd++; 796 795 chdname = optarg; 797 796 break; … … 941 940 break; 942 941 chdname = *argv++; 942 havechd++; 943 943 } else if (pat_add(*argv++, chdname) < 0) 944 944 tar_usage(); … … 1038 1038 if (ftree_add(*argv++, 1) < 0) 1039 1039 tar_usage(); 1040 havechd++; 1040 1041 } else if (ftree_add(*argv++, 0) < 0) 1041 1042 tar_usage(); … … 1637 1638 { 1638 1639 (void)fputs( 1639 "usage: pax [-0cd OnRSvz] [-E limit] [-f archive] [-G group] [-s replstr]\n"1640 "\t [-T [from_date][,to_date][/[c][m]]] [-U user] [pattern ...]\n"1641 " pax -r [-0cDdik OnuvzYZz] [-E limit] [-f archive] [-G group]\n"1642 "\t [-o options] [-p string] [-s replstr] [-T [from_date][,to_date]]\n"1640 "usage: pax [-0cdnOvz] [-E limit] [-f archive] [-G group] [-s replstr]\n" 1641 "\t [-T range] [-U user] [pattern ...]\n" 1642 " pax -r [-0cDdiknOuvYZz] [-E limit] [-f archive] [-G group]\n" 1643 "\t [-o options] [-p string] [-s replstr] [-T range]\n" 1643 1644 "\t [-U user] [pattern ...]\n" 1644 1645 " pax -w [-0adHiLOPtuvXz] [-B bytes] [-b blocksize] [-f archive]\n" 1645 "\t [-G group] [-M value] [-o options] [-s replstr]\n"1646 "\t [-T [from_date][,to_date][/[c][m]]] [-U user] [-x format] [file ...]\n"1647 " pax -r -w [-0DdHikLlnOPtuvXYZ] [-G group] [-p string] [-s replstr]\n"1648 "\t [-T [from_date][,to_date][/[c][m]]] [-U user] [file ...] directory\n",1646 "\t [-G group] [-M flag] [-o options] [-s replstr]\n" 1647 "\t [-T range] [-U user] [-x format] [file ...]\n" 1648 " pax -rw [-0DdHikLlnOPtuvXYZ] [-G group] [-p string] [-s replstr]\n" 1649 "\t [-T range] [-U user] [file ...] directory\n", 1649 1650 stderr); 1650 1651 exit(1); … … 1660 1661 { 1661 1662 (void)fputs( 1662 "usage: tar {crtux}[014578befHhLmOoPpq svwXZz]\n"1663 "usage: tar {crtux}[014578befHhLmOoPpqRSsvwXZz]\n" 1663 1664 "\t [blocking-factor | archive | replstr] [-C directory] [-I file]\n" 1664 1665 "\t [file ...]\n" 1665 " tar {-crtux} [-014578eHhLmOoPpq vwXZz] [-b blocking-factor] [-M value]\n"1666 " tar {-crtux} [-014578eHhLmOoPpqRSvwXZz] [-b blocking-factor] [-M flag]\n" 1666 1667 "\t [-C directory] [-f archive] [-I file] [-s replstr] [file ...]\n", 1667 1668 stderr); … … 1677 1678 cpio_usage(void) 1678 1679 { 1679 (void)fputs("usage: cpio -o [- aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);1680 (void)fputs(" [-M flag] [- Farchive] <name-list [>archive]\n", stderr);1681 (void)fputs(" cpio -i [- bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]\n", stderr);1682 (void)fputs(" [- I archive] [-Farchive] [pattern...] [<archive]\n", stderr);1683 (void)fputs(" cpio -p [-ad lLmuvV] destination-directory <name-list\n", stderr);1680 (void)fputs("usage: cpio -o [-AaBcLvZz] [-C bytes] [-F archive] [-H format]\n", stderr); 1681 (void)fputs(" [-M flag] [-O archive] <name-list [>archive]\n", stderr); 1682 (void)fputs(" cpio -i [-6BbcdfmrSstuvZz] [-C bytes] [-E file] [-F archive]\n", stderr); 1683 (void)fputs(" [-H format] [-I archive] [pattern...] [<archive]\n", stderr); 1684 (void)fputs(" cpio -p [-adLlmuv] destination-directory <name-list\n", stderr); 1684 1685 exit(1); 1685 1686 } trunk/freewrt/tools/paxmirabilis/src/pax.1
r2029 r3793 1 .\" $MirOS: src/bin/pax/pax.1,v 1. 7 2006/07/21 17:34:59tg Exp $2 .\" $OpenBSD: pax.1,v 1. 48 2006/05/12 11:55:58jmc Exp $1 .\" $MirOS: src/bin/pax/pax.1,v 1.9 2008/03/14 17:05:06 tg Exp $ 2 .\" $OpenBSD: pax.1,v 1.52 2007/05/31 19:19:15 jmc Exp $ 3 3 .\" $NetBSD: pax.1,v 1.3 1995/03/21 09:07:37 cgd Exp $ 4 4 .\" … … 37 37 .\" @(#)pax.1 8.4 (Berkeley) 4/18/94 38 38 .\" 39 .Dd July 21, 2006 40 .Dt PAX 1 41 .Os MirBSD 42 .\" for portability 39 .\"- 40 .\" Try to make GNU groff and AT&T nroff more compatible 41 .\" * ` generates ‘ in groff, so use \` 42 .\" * ' generates ’ in groff, \' generates ´, so use \*(aq 43 .\" * - generates ‐ in groff, \- generates −, fixed in tmac/mdoc/doc-groff 44 .\" thus use - for hyphens and \- for minus signs and option dashes 45 .\" * ~ is size-reduced and placed atop in groff, so use \*(TI 46 .\" * ^ is size-reduced and placed atop in groff, so use \*(ha 47 .\" * \(en does not work in nroff, so use \*(en 48 .ie \n(.g \{\ 49 . ds aq \(aq 50 . ds TI \(ti 51 . ds ha \(ha 52 . ds en \(en 53 .\} 54 .el \{\ 55 . ds aq ' 56 . ds TI ~ 57 . ds ha ^ 58 . ds en \(em 59 .\} 60 .\" 61 .\" Implement .Dd with the Mdocdate RCS keyword 62 .rn Dd xD 63 .de Dd 64 .ie \\$1$Mdocdate: \{\ 65 . xD \\$2 \\$3, \\$4 66 .\} 67 .el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 68 .. 69 .\" 70 .\" .Dd must come before definition of .Mx, because when called 71 .\" with -mandoc, it might implement .Mx itself, but we want to 72 .\" use our own definition. And .Dd must come *first*, always. 73 .Dd $Mdocdate: March 14 2008 $ 74 .\" 75 .\" Implement .Mx (MirBSD) 43 76 .de Mx 44 77 .nr cF \\n(.f … … 46 79 .ds aa \&\f\\n(cF\s\\n(cZ 47 80 .if \\n(aC==0 \{\ 48 . if \\n(.$==0 \&MirOS\\*(aa 81 . ie \\n(.$==0 \&MirOS\\*(aa 82 . el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 49 83 .\} 50 .if \\n(.$==1 \{\ 51 . if "\\$1"." \&MirOS\\$1\\*(aa 52 . if "\\$1"," \&MirOS\\$1\\*(aa 84 .if \\n(aC>\\n(aP \{\ 85 . nr aP \\n(aP+1 86 . ie \\n(C\\n(aP==2 \{\ 87 . as b1 \&MirOS\ #\&\\*(A\\n(aP\\*(aa 88 . ie \\n(aC>\\n(aP \{\ 89 . nr aP \\n(aP+1 90 . nR 91 . \} 92 . el .aZ 93 . \} 94 . el \{\ 95 . as b1 \&MirOS\\*(aa 96 . nR 97 . \} 53 98 .\} 54 99 .. 100 .Dt PAX 1 101 .Os MirBSD 55 102 .Sh NAME 56 103 .Nm pax … … 59 106 .Bk -words 60 107 .Nm pax 61 .Op Fl 0cd Onvz108 .Op Fl 0cdnOvz 62 109 .Op Fl E Ar limit 63 110 .Op Fl f Ar archive … … 69 116 .Nm pax 70 117 .Fl r 71 .Op Fl 0cDdik OnuvYZz118 .Op Fl 0cDdiknOuvYZz 72 119 .Op Fl E Ar limit 73 120 .Op Fl f Ar archive … … 86 133 .Op Fl f Ar archive 87 134 .Op Fl G Ar group 88 .Op Fl M Ar value135 .Op Fl M Ar flag 89 136 .Op Fl o Ar options 90 137 .Op Fl s Ar replstr … … 94 141 .Op Ar file ... 95 142 .Nm pax 96 .Fl r 97 .Fl w 143 .Fl rw 98 144 .Op Fl 0DdHikLlnOPtuvXYZ 99 145 .Op Fl G Ar group … … 167 213 operand is also a directory, the entire file hierarchy rooted 168 214 at that directory will be included. 169 .It Fl r Flw215 .It Fl rw 170 216 .Em Copy . 171 217 .Nm … … 474 520 hard links are made between the source and destination file hierarchies 475 521 whenever possible. 476 .It Fl M Ar value522 .It Fl M Ar flag 477 523 Configure the archive normaliser. 478 .Ar value524 .Ar flag 479 525 is either a number or a string, optionally prefixed with 480 526 .Dq no- 481 to turn the flagoff.527 to turn it off. 482 528 See 483 529 .Xr cpio 1 … … 705 751 standard error in the following format: 706 752 .Pp 707 .D1 Em original-pathname No >>Em new-pathname753 .D1 Em original-pathname No \*(Gt\*(Gt Em new-pathname 708 754 .Pp 709 755 File or archive member names that substitute to the empty string … … 907 953 currently supports the following formats: 908 954 .Bl -tag -width "sv4cpio" 955 .It Cm bcpio 956 The old binary cpio format. 957 The default blocksize for this format is 5120 bytes. 958 This format is not very portable and should not be used when other formats 959 are available. 960 Inode and device information about a file (used for detecting file hard links 961 by this format), which may be truncated by this format, is detected by 962 .Nm 963 and is repaired. 909 964 .It Cm cpio 910 965 The extended cpio interchange format specified in the … … 912 967 standard. 913 968 The default blocksize for this format is 5120 bytes. 914 Inode and device information about a file (used for detecting file hard links915 by this format), which may be truncated by this format, is detected by916 .Nm917 and is repaired.918 .It Cm bcpio919 The old binary cpio format.920 The default blocksize for this format is 5120 bytes.921 This format is not very portable and should not be used when other formats922 are available.923 969 Inode and device information about a file (used for detecting file hard links 924 970 by this format), which may be truncated by this format, is detected by … … 1104 1150 .Ed 1105 1151 .Pp 1106 Readthe archive1107 .Pa a.pax ,1108 with all files rooted in1152 Extract files from the archive 1153 .Pa a.pax . 1154 Files rooted in 1109 1155 .Pa /usr 1110 into the archive extracted relative to the current directory: 1111 .Pp 1112 .Dl $ pax -r -s ',^//*usr//*,,' -f a.pax 1156 are extracted relative to the current working directory; 1157 all other files are extracted to their unmodified path. 1158 .Pp 1159 .Dl $ pax -r -s ',^/usr/,,' -f a.pax 1113 1160 .Pp 1114 1161 This can be used to interactively select the files to copy from the … … 1186 1233 The 1187 1234 .Nm 1188 utility is a superset of the 1189 .St -p1003.2 1190 standard. 1191 The options 1192 .Fl 0 , 1193 .Fl B , 1194 .Fl D , 1195 .Fl E , 1196 .Fl G , 1197 .Fl H , 1198 .Fl L , 1199 .Fl M , 1200 .Fl O , 1201 .Fl P , 1202 .Fl T , 1203 .Fl U , 1204 .Fl Y , 1205 .Fl Z , 1235 utility is compliant with the 1236 .St -p1003.1-2004 1237 specification. 1238 .Pp 1239 The flags 1240 .Op Fl 0BDEGHLMOPTUYZz , 1206 1241 the archive formats 1207 1242 .Em bcpio , … … 1213 1248 and 1214 1249 .Em read 1215 operations are extensions to the 1216 .Tn POSIX 1217 standard. 1250 operations 1251 are extensions to that specification. 1218 1252 .Sh AUTHORS 1219 1253 Keith Muller at the University of California, San Diego. trunk/freewrt/tools/paxmirabilis/src/pax.h
r2029 r3793 1 /** $MirOS: src/bin/pax/pax.h,v 1. 6 2007/01/23 11:55:54tg Exp $ */1 /** $MirOS: src/bin/pax/pax.h,v 1.7 2008/03/14 15:55:21 tg Exp $ */ 2 2 /* $OpenBSD: pax.h,v 1.17 2005/11/09 19:59:06 otto Exp $ */ 3 3 /* $NetBSD: pax.h,v 1.3 1995/03/21 09:07:41 cgd Exp $ */ … … 252 252 #define _PAX_ 1 253 253 #define _TFILE_BASE "paxXXXXXXXXXX" 254 255 /* copied from <tzfile.h> */ 256 #define SECSPERMIN 60 257 #define MINSPERHOUR 60 258 #define HOURSPERDAY 24 259 #define DAYSPERNYEAR 365 260 #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) 261 #define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY) 262 #define TM_YEAR_BASE 1900 trunk/freewrt/tools/paxmirabilis/src/sel_subs.c
r2029 r3793 44 44 #include <stdlib.h> 45 45 #include <string.h> 46 #include <tzfile.h>47 46 #include <unistd.h> 48 47 #include "pax.h" … … 51 50 52 51 __SCCSID("@(#)sel_subs.c 8.1 (Berkeley) 5/31/93"); 53 __RCSID("$MirOS: src/bin/pax/sel_subs.c,v 1. 2 2007/02/17 04:52:41 tg Exp $");52 __RCSID("$MirOS: src/bin/pax/sel_subs.c,v 1.3 2008/03/14 15:55:21 tg Exp $"); 54 53 55 54 static int str_sec(const char *, time_t *); trunk/freewrt/tools/paxmirabilis/src/tables.c
r2029 r3793 1 /** $MirOS: src/bin/pax/tables.c,v 1.7 2007/02/17 04:52:41 tg Exp $ */ 2 /* $OpenBSD: tables.c,v 1.23 2005/04/21 21:47:18 beck Exp $ */ 1 /* $OpenBSD: tables.c,v 1.25 2007/09/02 15:19:08 deraadt Exp $ */ 3 2 /* $NetBSD: tables.c,v 1.4 1995/03/21 09:07:45 cgd Exp $ */ 4 3 … … 51 50 52 51 __SCCSID("@(#)tables.c 8.1 (Berkeley) 5/31/93"); 53 __RCSID("$MirOS: src/bin/pax/tables.c,v 1. 7 2007/02/17 04:52:41tg Exp $");52 __RCSID("$MirOS: src/bin/pax/tables.c,v 1.8 2007/10/23 20:07:42 tg Exp $"); 54 53 55 54 /* … … 149 148 if ((pt = ltab[indx]) != NULL) { 150 149 /* 151 * it 's hash chain in not empty, walk down looking for it150 * its hash chain in not empty, walk down looking for it 152 151 */ 153 152 ppt = &(ltab[indx]); … … 1100 1099 1101 1100 dirsize = DIRP_SIZE; 1102 if ((dirp = malloc(dirsize *sizeof(DIRDATA))) == NULL) {1101 if ((dirp = calloc(dirsize, sizeof(DIRDATA))) == NULL) { 1103 1102 paxwarn(1, "Unable to allocate memory for directory times"); 1104 1103 return(-1); … … 1124 1123 { 1125 1124 DIRDATA *dblk; 1125 char realname[MAXPATHLEN], *rp; 1126 1126 1127 1127 if (dirp == NULL) 1128 1128 return; 1129 1129 1130 if (havechd && *name != '/') { 1131 if ((rp = realpath(name, realname)) == NULL) { 1132 paxwarn(1, "Cannot canonicalize %s", name); 1133 return; 1134 } 1135 name = rp; 1136 } 1130 1137 if (dircnt == (long)dirsize) { 1131 1138 dblk = realloc(dirp, 2 * dirsize * sizeof(DIRDATA)); trunk/freewrt/tools/paxmirabilis/src/tables.h
r204 r3793 1 /** $MirOS: src/bin/pax/tables.h,v 1. 2 2005/11/16 13:58:39tg Exp $ */2 /* $OpenBSD: tables.h,v 1. 7 2004/11/29 16:23:22 ottoExp $ */1 /** $MirOS: src/bin/pax/tables.h,v 1.3 2007/10/23 20:07:42 tg Exp $ */ 2 /* $OpenBSD: tables.h,v 1.8 2006/08/05 23:05:13 ray Exp $ */ 3 3 /* $NetBSD: tables.h,v 1.3 1995/03/21 09:07:47 cgd Exp $ */ 4 4 … … 138 138 139 139 /* 140 * ftree directory access time reset table. When we are done with witha140 * ftree directory access time reset table. When we are done with a 141 141 * subtree we reset the access and mod time of the directory when the tflag is 142 142 * set. Not really explicitly specified in the pax spec, but easy and fast to trunk/freewrt/tools/paxmirabilis/src/tar.1
r2029 r3793 1 .\" $MirOS: src/bin/pax/tar.1,v 1. 8 2006/07/21 17:34:59tg Exp $2 .\" $OpenBSD: tar.1,v 1.4 7 2005/05/24 16:33:45 jaredyExp $1 .\" $MirOS: src/bin/pax/tar.1,v 1.10 2008/03/14 17:05:06 tg Exp $ 2 .\" $OpenBSD: tar.1,v 1.48 2007/05/31 19:19:15 jmc Exp $ 3 3 .\" 4 4 .\" Copyright (c) 1996 SigmaSoft, Th. Lockert … … 25 25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 26 .\" 27 .\" $OpenBSD: tar.1,v 1.47 2005/05/24 16:33:45 jaredy Exp $ 28 .\" 29 .Dd July 21, 2006 30 .Dt TAR 1 31 .Os MirBSD 32 .\" for portability 27 .\" $OpenBSD: tar.1,v 1.48 2007/05/31 19:19:15 jmc Exp $ 28 .\" 29 .\"- 30 .\" Try to make GNU groff and AT&T nroff more compatible 31 .\" * ` generates ‘ in groff, so use \` 32 .\" * ' generates ’ in groff, \' generates ´, so use \*(aq 33 .\" * - generates ‐ in groff, \- generates −, fixed in tmac/mdoc/doc-groff 34 .\" thus use - for hyphens and \- for minus signs and option dashes 35 .\" * ~ is size-reduced and placed atop in groff, so use \*(TI 36 .\" * ^ is size-reduced and placed atop in groff, so use \*(ha 37 .\" * \(en does not work in nroff, so use \*(en 38 .ie \n(.g \{\ 39 . ds aq \(aq 40 . ds TI \(ti 41 . ds ha \(ha 42 . ds en \(en 43 .\} 44 .el \{\ 45 . ds aq ' 46 . ds TI ~ 47 . ds ha ^ 48 . ds en \(em 49 .\} 50 .\" 51 .\" Implement .Dd with the Mdocdate RCS keyword 52 .rn Dd xD 53 .de Dd 54 .ie \\$1$Mdocdate: \{\ 55 . xD \\$2 \\$3, \\$4 56 .\} 57 .el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 58 .. 59 .\" 60 .\" .Dd must come before definition of .Mx, because when called 61 .\" with -mandoc, it might implement .Mx itself, but we want to 62 .\" use our own definition. And .Dd must come *first*, always. 63 .Dd $Mdocdate: March 14 2008 $ 64 .\" 65 .\" Implement .Mx (MirBSD) 33 66 .de Mx 34 67 .nr cF \\n(.f … … 36 69 .ds aa \&\f\\n(cF\s\\n(cZ 37 70 .if \\n(aC==0 \{\ 38 . if \\n(.$==0 \&MirBSD\\*(aa 71 . ie \\n(.$==0 \&MirOS\\*(aa 72 . el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 39 73 .\} 40 .if \\n(.$==1 \{\ 41 . if "\\$1"." \&MirBSD\\$1\\*(aa 42 . if "\\$1"," \&MirBSD\\$1\\*(aa 74 .if \\n(aC>\\n(aP \{\ 75 . nr aP \\n(aP+1 76 . ie \\n(C\\n(aP==2 \{\ 77 . as b1 \&MirOS\ #\&\\*(A\\n(aP\\*(aa 78 . ie \\n(aC>\\n(aP \{\ 79 . nr aP \\n(aP+1 80 . nR 81 . \} 82 . el .aZ 83 . \} 84 . el \{\ 85 . as b1 \&MirOS\\*(aa 86 . nR 87 . \} 43 88 .\} 44 89 .. 90 .Dt TAR 1 91 .Os MirBSD 45 92 .Sh NAME 46 93 .Nm tar … … 60 107 .Nm tar 61 108 .No { Ns Fl crtux Ns } 62 .Op Fl 014578eHhLmOoPpq vwXZz109 .Op Fl 014578eHhLmOoPpqRSvwXZz 63 110 .Op Fl b Ar blocking-factor 64 111 .Op Fl C Ar directory 65 112 .Op Fl f Ar archive 66 113 .Op Fl I Ar file 67 .Op Fl M Ar value114 .Op Fl M Ar flag 68 115 .Op Fl s Ar replstr 69 116 .Op Ar file ... … … 178 225 .Fl h 179 226 option. 180 .It Fl M Ar value227 .It Fl M Ar flag 181 228 Configure the archive normaliser. 182 .Ar value229 .Ar flag 183 230 is either a number or a string, optionally prefixed with 184 231 .Dq no- 185 to turn the flagoff.232 to turn it off. 186 233 See 187 234 .Xr cpio 1 trunk/freewrt/tools/paxmirabilis/strlfun.c
r2027 r3793 1 /* $MirOS: src/lib/libc/string/strlfun.c,v 1.14 2007/01/07 02:11:40 tg Exp $ */2 3 1 /*- 4 * Copyright (c) 2006 5 * Thorsten Glaser <tg@mirbsd. de>2 * Copyright (c) 2006, 2008 3 * Thorsten Glaser <tg@mirbsd.org> 6 4 * 7 5 * Provided that these terms and disclaimer and all copyright notices … … 20 18 * of said person's immediate fault when using the work as intended. 21 19 *- 22 * The strlcat() code below has been written by Thorsten Glaser. Bodo 23 * Eggert suggested optimising the strlcpy() code, originally written 24 * by Todd C. Miller (see below), which was carried out by Th. Glaser 25 * as well as merging this code with strxfrm() for ISO-10646-only sy- 26 * stems and writing wcslcat(), wcslcpy() and wcsxfrm() equivalents. 20 * The original implementations of strlcpy(3) and strlcat(3) are from 21 * Todd C. Miller; the licence is reproduced below. However, this ap- 22 * plies only to the strlcpy(3) portion of the code, as Thorsten Gla- 23 * ser write the following strlcat(3) implementation according to the 24 * spec. Both functions below have been optimised according to sugge- 25 * stions from Bodo Eggert. Thorsten Glaser also has merged this code 26 * with strxfrm(3) for ISO-10646-only systems and wrote the wide char 27 * variants wcslcat(3), wcslcpy(3), and wcsxfrm(3) (see wcslfun.c). 27 28 */ 28 29 … … 41 42 #undef HAVE_STRLCAT 42 43 #else 44 #include <stddef.h> /* for size_t in user space (SUSv3) */ 43 45 #if defined(HAVE_CONFIG_H) && (HAVE_CONFIG_H != 0)
