Changeset 3816
- Timestamp:
- 10/29/08 18:58:40 (2 months ago)
- Files:
-
- branches/freewrt_1_0/tools/paxmirabilis/Makefile (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/Makefile (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/ar_subs.c (modified) (9 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/cpio.1 (modified) (13 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/extern.h (modified) (3 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/file_subs.c (modified) (4 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/ftree.c (modified) (3 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/gen_subs.c (modified) (4 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/options.c (modified) (12 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/pax.1 (modified) (15 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/pax.h (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/sel_subs.c (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/tables.c (modified) (5 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/tables.h (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/tar.1 (modified) (5 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/strlfun.c (modified) (12 diffs)
- trunk/freewrt/tools/paxmirabilis/Makefile (modified) (2 diffs)
- trunk/freewrt/tools/paxmirabilis/src/ar_subs.c (modified) (6 diffs)
- trunk/freewrt/tools/paxmirabilis/src/extern.h (modified) (2 diffs)
- trunk/freewrt/tools/paxmirabilis/src/file_subs.c (modified) (4 diffs)
- trunk/freewrt/tools/paxmirabilis/src/options.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/freewrt_1_0/tools/paxmirabilis/Makefile
r2715 r3816 49 49 cp $(STAGING_DIR)/bin/pax ${TOPDIR}/lbin/pax 50 50 cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar 51 cd ${TOPDIR}/lbin && ln pax mircpio && ln pax mirpax && ln pax mirtar 51 52 52 53 install-lbin: … … 54 55 if [ -e $(STAGING_DIR)/bin/pax ]; then \ 55 56 cp $(STAGING_DIR)/bin/pax ${TOPDIR}/lbin/pax; \ 56 cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar; \ 57 cd ${TOPDIR}/lbin && ln pax cpio && ln pax tar && \ 58 ln pax mircpio && ln pax mirpax && ln pax mirtar; \ 57 59 else \ 58 60 rm -f $(TOOLS_STAMP_DIR)/.tools_paxmirabilis-install; \ branches/freewrt_1_0/tools/paxmirabilis/src/Makefile
r2715 r3816 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 branches/freewrt_1_0/tools/paxmirabilis/src/ar_subs.c
r2715 r3816 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 5 4 /*- 5 * Copyright (c) 2008 6 * Thorsten Glaser <tg@mirbsd.de> 6 7 * Copyright (c) 1992 Keith Muller. 7 8 * Copyright (c) 1992, 1993 … … 51 52 52 53 __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 $");54 __RCSID("$MirOS: src/bin/pax/ar_subs.c,v 1.7 2008/10/29 17:34:48 tg Exp $"); 54 55 55 56 static void wr_archive(ARCHD *, int is_app); … … 312 313 */ 313 314 if (!to_stdout) { 314 if ((arcn->type == PAX_HLK) || (arcn->type == PAX_HRG)) 315 res = lnk_creat(arcn); 316 else 315 if ((arcn->type == PAX_HLK) || (arcn->type == PAX_HRG)) { 316 res = lnk_creat(arcn, &fd); 317 if (fd != -1) 318 goto extdata; 319 } else 317 320 res = node_creat(arcn); 318 321 } … … 326 329 vfpart = 0; 327 330 } 328 continue;331 goto popd; 329 332 } 330 333 /* … … 337 340 (void)rd_skip(arcn->skip + arcn->pad); 338 341 purg_lnk(arcn); 339 continue;342 goto popd; 340 343 } 341 344 /* … … 343 346 * any unprocessed data 344 347 */ 348 extdata: 345 349 res = (*frmt->rd_data)(arcn, fd, &cnt); 346 350 if (fd != STDOUT_FILENO) … … 353 357 (void)rd_skip(cnt + arcn->pad); 354 358 359 popd: 355 360 /* 356 361 * if required, chdir around. … … 410 415 if (is_app) 411 416 goto trailer; 412 else 413 return; 414 } 415 if (((*frmt->st_wr)() < 0)) 416 return; 417 return; 418 } else if (((*frmt->st_wr)() < 0)) 419 return; 420 417 421 wrf = frmt->wr; 418 422 … … 929 933 */ 930 934 if ((arcn->type == PAX_HLK) || (arcn->type == PAX_HRG)) 931 res = lnk_creat(arcn );935 res = lnk_creat(arcn, NULL); 932 936 else 933 937 res = node_creat(arcn); branches/freewrt_1_0/tools/paxmirabilis/src/cpio.1
r2715 r3816 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. branches/freewrt_1_0/tools/paxmirabilis/src/extern.h
r2715 r3816 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.11 2008/10/29 17:34:48 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 … … 146 146 int file_creat(ARCHD *); 147 147 void file_close(ARCHD *, int); 148 int lnk_creat(ARCHD * );148 int lnk_creat(ARCHD *, int *); 149 149 int cross_lnk(ARCHD *); 150 150 int chk_same(ARCHD *); … … 250 250 extern char *tempfile; 251 251 extern char *tempbase; 252 extern int havechd; 252 253 253 254 int main(int, char **); branches/freewrt_1_0/tools/paxmirabilis/src/file_subs.c
r2051 r3816 1 /** $MirOS: src/bin/pax/file_subs.c,v 1.1 2 2007/02/17 04:52:40tg Exp $ */1 /** $MirOS: src/bin/pax/file_subs.c,v 1.13 2008/10/29 17:34:48 tg Exp $ */ 2 2 /* $OpenBSD: file_subs.c,v 1.30 2005/11/09 19:59:06 otto Exp $ */ 3 3 /* $NetBSD: file_subs.c,v 1.4 1995/03/21 09:07:18 cgd Exp $ */ 4 4 5 5 /*- 6 * Copyright (c) 2007 Thorsten Glaser 6 * Copyright (c) 2007, 2008 7 * Thorsten Glaser <tg@mirbsd.de> 7 8 * Copyright (c) 1992 Keith Muller. 8 9 * Copyright (c) 1992, 1993 … … 56 57 57 58 __SCCSID("@(#)file_subs.c 8.1 (Berkeley) 5/31/93"); 58 __RCSID("$MirOS: src/bin/pax/file_subs.c,v 1.1 2 2007/02/17 04:52:40tg Exp $");59 __RCSID("$MirOS: src/bin/pax/file_subs.c,v 1.13 2008/10/29 17:34:48 tg Exp $"); 59 60 60 61 #ifndef __GLIBC_PREREQ … … 185 186 * must exist; 186 187 * Return: 187 * 0 if ok, -1 otherwise 188 * fd+2 if data should be extracted, 189 * 0 if ok, 1 if we could not make the link, -1 otherwise 188 190 */ 189 191 190 192 int 191 lnk_creat(ARCHD *arcn )193 lnk_creat(ARCHD *arcn, int *fdp) 192 194 { 193 195 struct stat sb; 196 int rv; 194 197 195 198 /* … … 209 212 } 210 213 211 return(mk_link(arcn->ln_name, &sb, arcn->name, 0)); 214 rv = mk_link(arcn->ln_name, &sb, arcn->name, 0); 215 if (fdp != NULL && rv == 0 && sb.st_size == 0 && arcn->skip > 0) { 216 /* request to write out file data late (broken archive) */ 217 if (pmode) 218 set_pmode(arcn->name, 0600); 219 if ((*fdp = open(arcn->name, O_WRONLY | O_TRUNC)) == -1) { 220 rv = errno; 221 syswarn(1, rv, "Unable to re-open %s", arcn->name); 222 if (pmode) 223 set_pmode(arcn->name, sb.st_mode); 224 } 225 rv = 0; 226 } else if (fdp != NULL) 227 *fdp = -1; 228 return (rv); 212 229 } 213 230 branches/freewrt_1_0/tools/paxmirabilis/src/ftree.c
r2715 r3816 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 branches/freewrt_1_0/tools/paxmirabilis/src/gen_subs.c
r2715 r3816 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 } branches/freewrt_1_0/tools/paxmirabilis/src/options.c
r2715 r3816 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.27 2008/10/29 17:00:07 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 … … 383 381 * verbose operation mode 384 382 */ 385 vflag = 1;383 vflag++; 386 384 flg |= VF; 387 385 break; … … 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(); … … 1218 1219 * verbose operation mode 1219 1220 */ 1220 vflag = 1;1221 vflag++; 1221 1222 break; 1222 1223 case 'z': … … 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 } branches/freewrt_1_0/tools/paxmirabilis/src/pax.1
r2715 r3816 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. branches/freewrt_1_0/tools/paxmirabilis/src/pax.h
r2715 r3816 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 branches/freewrt_1_0/tools/paxmirabilis/src/sel_subs.c
r2715 r3816 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 *); branches/freewrt_1_0/tools/paxmirabilis/src/tables.c
r2715 r3816 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]); &he
