1 .\" Copyright (c) 2007 Joseph Koshy. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" This software is provided by Joseph Koshy ``as is'' and
13 .\" any express or implied warranties, including, but not limited to, the
14 .\" implied warranties of merchantability and fitness for a particular purpose
15 .\" are disclaimed. in no event shall Joseph Koshy be liable
16 .\" for any direct, indirect, incidental, special, exemplary, or consequential
17 .\" damages (including, but not limited to, procurement of substitute goods
18 .\" or services; loss of use, data, or profits; or business interruption)
19 .\" however caused and on any theory of liability, whether in contract, strict
20 .\" liability, or tort (including negligence or otherwise) arising in any way
21 .\" out of the use of this software, even if advised of the possibility of
46 .Op Fl a Ar position-after
47 .Op Fl b Ar position-before
49 .Op Fl i Ar position-before
77 .Op Fl a Ar position-after
78 .Op Fl b Ar position-before
82 .Op Fl i Ar position-before
122 utility creates and maintains groups of files combined into an
124 Once an archive has been created, new files can be added to it, and
125 existing files can be extracted, deleted or replaced.
127 Files are named in the archive by their last file name component,
128 so if a file referenced by a path containing a
130 is archived, it will be named by the last component of the path.
131 Similarly when matching paths listed on the command line against
132 file names stored in the archive, only the last component of the
133 path will be compared.
137 is for the creation and maintenance of libraries suitable for use
140 although it is not restricted to this purpose.
143 utility can create and manage an archive symbol table (see
145 used to speed up link editing operations.
146 If a symbol table is present in an archive, it will be
147 kept up-to-date by subsequent operations on the archive.
151 utility is used to add an archive symbol table
152 to an existing archive.
156 utility supports the following options:
157 .Bl -tag -width indent
158 .It Fl a Ar member-after
159 When used with option
161 this option specifies that the archive members specified by
164 are moved to after the archive member named by argument
166 When used with option
168 this option specifies that the files specified by arguments
170 are added after the archive member named by argument
172 .It Fl b Ar member-before
173 When used with option
175 this option specifies that the archive members specified by
178 are moved to before the archive member named by argument
180 When used with option
182 this option specifies that the files specified by arguments
184 are added before the archive member named by argument
187 Suppress the informational message printed when a new archive is
194 Prevent extracted files from replacing like-named files
197 Delete the members named by arguments
199 from the archive specified by argument
201 The archive's symbol table, if present, is updated to reflect
202 the new contents of the archive.
204 When used in combination with the
208 option, insert 0's instead of the real mtime, uid and gid values
209 and 0644 instead of file mode from the members named by arguments
211 This ensures that checksums on the resulting archives are reproducible
212 when member contents are identical.
217 options are specified on the command line, the final one takes precedence.
219 Synonymous with option
221 .It Fl i Ar member-before
222 Synonymous with option
225 This option is accepted but ignored.
227 This option is accepted for compatibility with GNU
231 Move archive members specified by arguments
234 If a position has been specified by one of the
239 options, the members are moved to before or after the specified
241 If no position has been specified, the specified members are moved
242 to the end of the archive.
243 If the archive has a symbol table, it is updated to reflect the
244 new contents of the archive.
246 Read and execute MRI librarian commands from standard input.
247 The commands understood by the
249 utility are described in the section
250 .Sx "MRI Librarian Commands" .
252 Preserve the original modification times of members when extracting
255 Write the contents of the specified archive members named by
259 If no members were specified, the contents of all the files in the
260 archive are written in the order they appear in the archive.
262 Append the files specified by arguments
264 to the archive specified by argument
266 without checking if the files already exist in the archive.
267 The archive symbol table will be updated as needed.
268 If the file specified by the argument
270 does not already exist, a new archive will be created.
272 Replace (add) the files specified by arguments
274 in the archive specified by argument
276 creating the archive if necessary.
277 Replacing existing members will not change the order of members within
279 If a file named in arguments
281 does not exist, existing members in the archive that match that
282 name are not changed.
283 New files are added to the end of the archive unless one of the
290 The archive symbol table, if it exists, is updated to reflect the
291 new state of the archive.
293 Add an archive symbol table (see
295 to the archive specified by argument
301 option alone is equivalent to invoking
304 Do not generate an archive symbol table.
306 List the files specified by arguments
308 in the order in which they appear in the archive, one per line.
309 If no files are specified, all files in the archive are listed.
311 Use only the first fifteen characters of the archive member name or
312 command line file name argument when naming archive members.
314 Conditionally update the archive or extract members.
317 option, files named by arguments
319 will be replaced in the archive if they are newer than their
323 option, the members specified by arguments
325 will be extracted only if they are newer than the corresponding
326 files in the file system.
328 When used in combination with the
332 option, insert the real mtime, uid and gid, and file mode values
333 from the members named by arguments
339 options are specified on the command line, the final one takes precedence.
341 Provide verbose output.
350 gives a file-by-file description of the archive modification being
351 performed, which consists of three white-space separated fields:
352 the option letter, a dash
359 displays the description as above, but the initial letter is an
361 if the file is added to the archive, or an
363 if the file replaces a file already in the archive.
366 option, the name of the file enclosed in
370 characters is written to standard output preceded by a single newline
371 character and followed by two newline characters.
372 The contents of the named file follow the file name.
377 displays eight whitespace separated fields:
378 the file permissions as displayed by
380 decimal user and group IDs separated by a slash (
382 the file size in bytes, the file modification time in
385 .Dq "%b %e %H:%M %Y" ,
386 and the name of the file.
388 Print a version string and exit.
390 Extract archive members specified by arguments
392 into the current directory.
393 If no members have been specified, extract all members of the archive.
394 If the file corresponding to an extracted member does not exist it
396 If the file corresponding to an extracted member does exist, its owner
397 and group will not be changed while its contents will be overwritten
398 and its permissions will set to that entered in the archive.
399 The file's access and modification time would be that of the time
400 of extraction unless the
402 option was specified.
404 This option is accepted but ignored.
406 .Ss "MRI Librarian Commands"
409 option is specified, the
411 utility will read and execute commands from its standard input.
412 If standard input is a terminal, the
414 utility will display the prompt
416 before reading a line, and will continue operation even if errors are
418 If standard input is not a terminal, the
420 utility will not display a prompt and will terminate execution on
421 encountering an error.
423 Each input line contains a single command.
424 Words in an input line are separated by whitespace characters.
425 The first word of the line is the command, the remaining words are
426 the arguments to the command.
427 The command word may be specified in either case.
428 Arguments may be separated by commas or blanks.
430 Empty lines are allowed and are ignored.
431 Long lines are continued by ending them with the
439 characters start a comment.
440 Comments extend till the end of the line.
442 When executing an MRI librarian script the
444 utility works on a temporary copy of an archive.
445 Changes to the copy are made permanent using the
449 Commands understood by the
452 .Bl -tag -width indent
453 .It Ic addlib Ar archive | Ic addlib Ar archive Pq Ar member Oo Li , Ar member Oc Ns ...
454 Add the contents of the archive named by argument
456 to the current archive.
457 If specific members are named using the arguments
459 then those members are added to the current archive.
460 If no members are specified, the entire contents of the archive
461 are added to the current archive.
462 .It Ic addmod Ar member Oo Li , Ar member Oc Ns ...
463 Add the files named by arguments
465 to the current archive.
467 Discard all the contents of the current archive.
468 .It Ic create Ar archive
469 Create a new archive named by the argument
471 and makes it the current archive.
472 If the named archive already exists, it will be overwritten
476 .It Ic delete Ar module Oo Li , Ar member Oc Ns ...
477 Delete the modules named by the arguments
479 from the current archive.
480 .It Ic directory Ar archive Po Ar member Oo Li , Ar member Oc Ns ... Pc Op Ar outputfile
481 List each named module in the archive.
482 The format of the output depends on the verbosity setting set using
486 Output is sent to standard output, or to the file specified by
490 Exit successfully from the
493 Any unsaved changes to the current archive will be discarded.
494 .It Ic extract Ar member Oo Li , Ar member Oc Ns ...
495 Extract the members named by the arguments
497 from the current archive.
499 Display the contents of the current archive in verbose style.
500 .It Ic open Ar archive
501 Open the archive named by argument
503 and make it the current archive.
504 .It Ic replace Ar member Oo Li , Ar member Oc Ns ...
505 Replace named members in the current archive with the files specified
508 The files must be present in the current directory and the named
509 modules must already exist in the current archive.
511 Commit all changes to the current archive.
513 Toggle the verbosity of the
518 To create a new archive
520 containing three files
526 .Dl "ar -rc ex.a ex1.o ex2.o ex3.o"
528 To add an archive symbol table to an existing archive
538 .D1 "ar -d ex.a ex1.o"
540 To verbosely list the contents of archive
545 To create a new archive
551 using MRI librarian commands, use the following script:
552 .Bd -literal -offset indent
553 create ex.a * specify the output archive
554 addmod ex1.o ex2.o * add modules
555 save * save pending changes
556 end * exit the utility
567 .Sh STANDARDS COMPLIANCE
570 utility's support for the
586 options is believed to be compliant with
591 command first appeared in AT&T UNIX Version 1.
594 .An "Kai Wang" Aq kaiw@FreeBSD.org