Mercurial > hg > toybox
annotate toys/pending/cpio.c @ 1087:b73a61542297 draft
I've finally gotten 'cpio' into a shape where it could be useable.
This version can archive and extract directories, sockets, FIFOs, devices,
symlinks, and regular files.
Supported options are -iot, -H FMT (which is a dummy right now).
It only writes newc, and could read newc or newcrc.
This does NOT implement -d, which essentially is equivalent to
mkdir -p $(dirname $FILE)
for every file that needs it.
Hard links are not supported, though it would be easy to add them given
a hash table or something like that.
I also have not implemented the "<n> blocks" output on stderr.
If desired, I can add it pretty simply.
There is one assumption this makes: that the mode of a file, as mode_t,
is bitwise equivalent to the mode as defined for the cpio format.
This is true of Linux, but is not mandated by POSIX.
If it is compiled for a system where that is false, the archives will
not be portable.
author | Isaac Dunham <ibid.ag@gmail.com> |
---|---|
date | Mon, 14 Oct 2013 11:15:22 -0500 |
parents | |
children | 46d83f3c7546 |
rev | line source |
---|---|
1087
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
1 /* cpio.c - a basic cpio |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
2 * |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
3 * Written 2013 AD by Isaac Dunham; this code is placed under the |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
4 * same license as toybox or as CC0, at your option. |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
5 USE_CPIO(NEWTOY(cpio, "H:iot", TOYFLAG_BIN)) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
6 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
7 config CPIO |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
8 bool "cpio" |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
9 default n |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
10 help |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
11 usage: cpio { -i | -o | -t } [-H fmt] |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
12 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
13 copy files into and out of an archive |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
14 -i extract from archive into file system (stdin is an archive) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
15 -o create archive (stdin is a list of files, stdout is an archive) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
16 -t list files (stdin is an archive, stdout is a list of files) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
17 -H fmt Write archive in specified format: |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
18 newc SVR4 new character format (default) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
19 */ |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
20 #define FOR_cpio |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
21 #include "toys.h" |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
22 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
23 GLOBALS( |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
24 char * fmt; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
25 ) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
26 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
27 /* Iterate through a list of files, read from stdin. |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
28 * No users need rw. |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
29 */ |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
30 void loopfiles_stdin(void (*function)(int fd, char *name)) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
31 { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
32 int fd; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
33 char *name = toybuf; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
34 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
35 while (name != NULL){ |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
36 memset(toybuf, 0, sizeof(toybuf)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
37 name = fgets(toybuf, sizeof(toybuf) - 1, stdin); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
38 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
39 if (name != NULL) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
40 if (toybuf[strlen(name) - 1] == '\n' ) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
41 toybuf[strlen(name) - 1 ] = '\0'; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
42 fd = open(name, O_RDONLY); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
43 if (fd > 0) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
44 function(fd, name); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
45 close(fd); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
46 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
47 errno = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
48 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
49 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
50 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
51 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
52 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
53 struct newc_header { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
54 char c_magic[6]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
55 char c_ino[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
56 char c_mode[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
57 char c_uid[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
58 char c_gid[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
59 char c_nlink[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
60 char c_mtime[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
61 char c_filesize[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
62 char c_devmajor[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
63 char c_devminor[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
64 char c_rdevmajor[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
65 char c_rdevminor[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
66 char c_namesize[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
67 char c_check[8]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
68 }; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
69 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
70 void write_cpio_member(int fd, char *name, struct stat buf) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
71 { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
72 char ahdr[sizeof(struct newc_header) + 1]; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
73 struct newc_header *hdr = (struct newc_header *)ahdr; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
74 size_t out = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
75 unsigned int n = 0x00000000, nlen = strlen(name) + 1; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
76 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
77 memset(hdr, '0', sizeof(struct newc_header)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
78 if (S_ISDIR(buf.st_mode) || S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
79 || S_ISFIFO(buf.st_mode) || S_ISSOCK(buf.st_mode)) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
80 buf.st_size = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
81 snprintf((char *)(hdr), sizeof(struct newc_header)+1, |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
82 "070701%08X%08X" "%08X%08X" |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
83 "%08X%08X%08X" |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
84 "%08X%08X" "%08X%08X%08X00000000", |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
85 (unsigned int)(buf.st_ino), buf.st_mode, buf.st_uid, buf.st_gid, |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
86 buf.st_nlink, (uint32_t)(buf.st_mtime), (uint32_t)(buf.st_size), |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
87 major(buf.st_dev), minor(buf.st_dev), |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
88 major(buf.st_rdev), minor(buf.st_rdev), nlen); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
89 write(1, hdr, sizeof(struct newc_header)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
90 write(1, name, nlen); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
91 if ((nlen + 2) % 4) write(1, &n, 4 - ((nlen + 2) % 4)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
92 if (S_ISLNK(buf.st_mode)) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
93 ssize_t llen = readlink(name, toybuf, sizeof(toybuf) - 1); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
94 if (llen > 0) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
95 toybuf[llen] = '\0'; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
96 write(1, toybuf, buf.st_size); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
97 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
98 } else if (buf.st_size) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
99 for (; (lseek(fd, 0, SEEK_CUR) < (uint32_t)(buf.st_size));) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
100 out = read(fd, toybuf, sizeof(toybuf)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
101 if (out > 0) write(1, toybuf, out); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
102 if (errno || out < sizeof(toybuf)) break; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
103 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
104 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
105 if (buf.st_size % 4) write(1, &n, 4 - (buf.st_size % 4)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
106 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
107 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
108 void write_cpio_call(int fd, char *name) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
109 { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
110 struct stat buf; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
111 if (lstat(name, &buf) == -1) return; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
112 write_cpio_member(fd, name, buf); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
113 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
114 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
115 //convert hex to uint; mostly to allow using bits of non-terminated strings |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
116 unsigned int htou(char * hex) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
117 { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
118 unsigned int ret = 0, i = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
119 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
120 for (;(i < 8 && hex[i]);) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
121 ret *= 16; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
122 switch(hex[i]) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
123 case '0': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
124 break; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
125 case '1': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
126 case '2': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
127 case '3': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
128 case '4': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
129 case '5': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
130 case '6': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
131 case '7': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
132 case '8': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
133 case '9': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
134 ret += hex[i] - '1' + 1; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
135 break; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
136 case 'A': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
137 case 'B': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
138 case 'C': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
139 case 'D': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
140 case 'E': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
141 case 'F': |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
142 ret += hex[i] - 'A' + 10; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
143 break; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
144 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
145 i++; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
146 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
147 return ret; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
148 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
149 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
150 /* Read one cpio record. |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
151 * Returns 0 for last record, |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
152 * 1 for "continue". |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
153 */ |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
154 int read_cpio_member(int fd, int how) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
155 { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
156 uint32_t nsize, fsize; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
157 mode_t mode = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
158 int pad, ofd = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
159 struct newc_header hdr; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
160 char *name; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
161 dev_t dev = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
162 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
163 xreadall(fd, &hdr, sizeof(struct newc_header)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
164 nsize = htou(hdr.c_namesize); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
165 name = xmalloc(nsize); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
166 xreadall(fd, name, nsize); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
167 if (!strcmp("TRAILER!!!", name)) return 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
168 fsize = htou(hdr.c_filesize); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
169 mode += htou(hdr.c_mode); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
170 pad = 4 - ((nsize + 2) % 4); // 2 == sizeof(struct newc_header) % 4 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
171 if (pad < 4) xreadall(fd, toybuf, pad); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
172 pad = 4 - (fsize % 4); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
173 if (how & 1) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
174 if (S_ISDIR(mode)) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
175 ofd = mkdir(name, mode); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
176 } else if (S_ISLNK(mode)) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
177 memset(toybuf, 0, sizeof(toybuf)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
178 if (fsize < sizeof(toybuf)) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
179 pad = readall(fd, toybuf, fsize); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
180 if (pad < fsize) error_exit("short archive"); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
181 pad = 4 - (fsize % 4); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
182 fsize = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
183 if (symlink(toybuf, name)) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
184 perror_msg("could not write link %s", name); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
185 toys.exitval |= 1; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
186 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
187 } else { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
188 perror_msg("link too long: %s", name); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
189 toys.exitval |= 1; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
190 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
191 } else if (S_ISBLK(mode)||S_ISCHR(mode)||S_ISFIFO(mode)||S_ISSOCK(mode)) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
192 dev = makedev(htou(hdr.c_rdevmajor),htou(hdr.c_rdevminor)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
193 ofd = mknod(name, mode, dev); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
194 } else { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
195 ofd = creat(name, mode); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
196 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
197 if (ofd == -1) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
198 error_msg("could not create %s", name); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
199 toys.exitval |= 1; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
200 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
201 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
202 errno = 0; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
203 if (how & 2) puts(name); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
204 while (fsize) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
205 int i; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
206 memset(toybuf, 0, sizeof(toybuf)); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
207 i = readall(fd, toybuf, (fsize>sizeof(toybuf)) ? sizeof(toybuf) : fsize); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
208 if (i < 1) error_exit("archive too short"); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
209 if (ofd > 0) writeall(ofd, toybuf, i); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
210 fsize -= i; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
211 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
212 if (pad < 4) xreadall(fd, toybuf, pad); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
213 return 1; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
214 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
215 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
216 void read_cpio_archive(int fd, int how) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
217 { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
218 for(;;) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
219 if (!read_cpio_member(fd, how)) return; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
220 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
221 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
222 |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
223 void cpio_main(void) |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
224 { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
225 switch (toys.optflags & (FLAG_i | FLAG_o | FLAG_t)) { |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
226 case FLAG_o: |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
227 loopfiles_stdin(write_cpio_call); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
228 write(1, "07070100000000000000000000000000000000000000010000000000000000" |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
229 "000000000000000000000000000000000000000B00000000TRAILER!!!\0\0\0", 124); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
230 break; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
231 case FLAG_i: |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
232 read_cpio_archive(0, 1); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
233 case FLAG_t: |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
234 case (FLAG_t | FLAG_i): |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
235 read_cpio_archive(0, 2); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
236 break; |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
237 default: |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
238 error_exit("must use one of -iot"); |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
239 } |
b73a61542297
I've finally gotten 'cpio' into a shape where it could be useable.
Isaac Dunham <ibid.ag@gmail.com>
parents:
diff
changeset
|
240 } |