--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
--- /dev/null
+Sat Sep 28 14:34:47 CEST 2002
+
+ * Release 0.23.0.
+ * This file is no longer being updated. Please see the NEWS file instead.
+
+Wed Sep 11 16:11:55 CEST 2002
+
+ * atool: "s/cwd/getcwd/g"
+ Remove use Cwd;
+
+Sun Sep 8 11:34:34 CEST 2002
+
+ * atool:
+ (runcmds) Check for cpio format.
+ (stripext) Strip cpio extension.
+ (formatext) Format cpio extension.
+ (findformat) Identify cpio archives.
+ (shellexecute) Overcome POSIX bug by setting @_ to ().
+ (readconfig) Read path_cat and path_find.
+
+Sat Jul 13 19:43:23 CEST 2002
+
+ * Release 0.19.0.
+ * atool:
+ New option --save-outdir.
+ (multiarchivecmd) Honor $::opt_save_outdir.
+ * atool.1: Documented --save-outdir, and added example about this.
+
+Sun Jul 7 14:40:43 CEST 2002
+
+ * atool: (runcmds) Add -r to rar.
+
+
+Thu Jul 4 08:54:20 CEST 2002
+
+ * TODO: Cleaned up. Added information about a rules format.
+
+Thu Jul 4 08:45:02 CEST 2002
+
+ * atool.1: Added some formats to list of supported ones.
+ * README: New section supported formats (referencing man page).
+
+Wed Jul 3 15:11:47 CEST 2002
+
+ * Makefile:
+ (PREFIX) New variable. Now defaults to /usr/local instead of /usr.
+ (BINDIR, MANDIR) Use PREFIX.
+ * debian/rules: Set PREFIX=/usr.
+ * atool.spec: Fixed to handle new PREFIX.
+
+Tue Jul 2 21:34:45 CEST 2002
+
+ * Release 0.18.0.
+ * README: Added info about rpm and cpio requirement.
+ * atool:
+ ($::cfg_path_rpm) New variable.
+ ($::cfg_path_rpm2cpio) New variable.
+ ($::cfg_path_cpio) New variable.
+ (runcmds) Handle rpm archives.
+ (stripext) Ditto.
+ (formatext) Ditto.
+ (findformat) Ditto.
+ (readconfig) Load variables mentioned above.
+
+Sat Jun 29 11:30:29 CEST 2002
+
+ * atool:
+ Changed author mail in help and version messages.
+ (quote) New subroutine. Used almost everywhere.
+ (cmdexec) Rewrote to use shell_execute instead.
+ (shell_execute) New subroutine.
+ (findformat) Use the safer three argument version of open.
+ Use $::errmsg instead of $! after call to backticks.
+ (backticks) Cleaned up a little. Put error message in $::errmsg.
+ (readconfig) Use the safer three argument version of open.
+ (unlink_directory) Don't chmod on directories.
+
+Wed May 15 13:47:34 CEST 2002
+
+ * atool.1: (EXAMPLES) Added adiff example.
+
+Wed Apr 24 09:46:37 CEST 2002
+
+ * atool:
+ ($::cfg_show_extracted) New variable.
+ (multiarchivecmd) Print if show_extracted.
+ (readconfig) Handle show_extracted.
+ * atool.1:
+ (CONFIGURATION) Documented show_extracted.
+
+Sun Apr 14 23:56:53 CEST 2002
+
+ * Release 0.17.0.
+ * atool:
+ ($::cfg_path_unarj) New variable.
+ (runcmds)
+ Handle arj archives.
+ Return return-value of singlearchivecmd.
+ (singlearchivecmd) Return $outdir.
+ (multiarchivecmd)
+ Take a new argument, $needcwd.
+ Change directories correctly if needcwd.
+ (stripext, formatext, findformat) Handle arj format.
+ (readconfig) Handle path_unarj.
+ * atool.1: Document path_unace and path_unarj.
+ * README: (Requirements) Added information about lha and unarj.
+
+Mon Mar 4 12:29:16 CET 2002
+
+ * atool: s/root files/files in root/.
+
+Sun Feb 10 23:06:50 CET 2002
+
+ * Makefile: (install) Use ln -s -f instead of ln -s.
+
+Sat Feb 9 12:24:36 CET 2002
+
+ * Release 0.16.0.
+ * atool:
+ ($::cfg_path_unace) New variable.
+ (runcmds) Handle ace format.
+ (stripext) Handle lha, lzh and ace extensions.
+ (formatext) Ditto.
+ (findformat) Ditto. Also fix rar extension.
+ (readconfig) Read path_unace.
+ * README: Add info for unace and URLs for other programs.
+
+Thu Feb 7 11:51:04 CET 2002
+
+ * Makefile:
+ (debian) Add -b.
+ (rpm) Build with -bb instead of -ba.
+
+Tue Jan 29 12:06:58 CET 2002
+
+ * atool.1: (args_diff) Improved documentation.
+ * Makefile: (clean) Remove more.
+
+Wed Jan 9 12:37:49 CET 2002
+
+ * atool:
+ ($::cfg_args_diff) New variable.
+ (main) Use cfg_args_diff arguments.
+ (readconfig) Parse variable.
+ * atool.1:
+ (args_diff) Added documentation.
+ (path_syslog) Updated wording.
+
+Sat Dec 22 12:15:49 CET 2001
+
+ * Release 0.15.0.
+ * atool.spec: New file.
+ * Makefile:
+ (dist) Added atool.spec and TOOL to distribution.
+ (rpm) New target.
+ (debian) Added -sd option.
+ (install) Change owner of created directories.
+ * debian/docs: Added TODO.
+
+Fri Nov 30 11:14:14 CET 2001
+
+ * atool: (multiarchivecmd)
+ Set mode on directories prior to moving, if necessary.
+ Restore mode once moved.
+
+Sat Nov 17 15:39:43 CET 2001
+
+ * Release 0.14.0.
+ * atool:
+ (runcmds) Cleaned up code (creating outdir).
+ (find_comparable_file) New function.
+ (main) Better handling of adiff command.
+ (unlink_directory) Die if chdir '..' fails.
+ (cmdexec) Improved error messages for abnormal exit
+ ($::cfg_path_compress) Updated.
+ ($::cfg_path_lha) New variable.
+ (runcmds) Handle lha archives.
+ (findformat) Find lha archives.
+ (readconfig) Read path_lha.
+ * atool.1: Document path_lha.
+
+Wed Oct 31 15:38:56 CET 2001
+
+ * atool: Better check for adiff removal confirmation.
+
+Fri Oct 26 10:32:59 CEST 2001
+
+ * Release 0.13.0.
+ * atool:
+ (unlink_recursively) New function
+ (main) Ask when deleting files for adiff, use unlink_recursively.
+ (main, readconfig) Remove path_rm variable.
+ (cmdexec) Take an additional argument, ignore_return.
+ * atool.1: Remove path_rm variable.
+
+Fri Oct 26 00:34:23 CEST 2001
+
+ * atool:
+ (path_diff, path_rm) New configuration variables.
+ (getmode) New command "diff".
+ (main) Added code for new command "diff".
+ (main) Added new option -d, --diff.
+ (runcmds) Returns output directory.
+ (multiarchivecmd) Returns output directory.
+ * atool.1:
+ Added documentation about new configuration variables.
+ Added documentation about new options.
+
+Thu Oct 25 15:08:33 CEST 2001
+
+ * atool.1: Fixed documentation for --help and --version
+ options.
+
+Tue Sep 18 17:41:14 CEST 2001
+
+ * Release 0.12.0.
+ * README, atool.1, debian/changelog, debian/copyright,
+ debian/control: New email adress of author.
+
+Mon Aug 27 16:57:40 CEST 2001
+
+ * TODO: New file.
+ * README: Moved To Do stuff into TODO document.
+
+Sun Aug 19 00:47:36 CEST 2001
+
+ * atool: (cmdexec) Set SIG{__WARN__} prior to execution,
+ and unset after execution.
+
+Mon Aug 13 22:56:41 CEST 2001
+
+ * Release 0.11.0.
+ * atool:
+ Added missing prototype for findformat and stripext.
+ Handle --each option in add mode.
+ (formatext) New function.
+ * atool.1:
+ Updated documentation for --each option.
+ Added example with apack and --each.
+
+Tue Aug 7 12:51:27 CEST 2001
+
+ * atool: (multiarchivecmd) Changed wording `refuse' to `refusing'.
+
+Mon Jul 23 17:09:32 CEST 2001
+
+ * Release 0.10.0.
+ * README, atool.1: Moved `Known Bugs' section from README file
+ to the man-page. Added a note about extracting compressed files
+ without valid extensions.
+
+Sun Jul 22 13:46:19 CEST 2001
+
+ * atool:
+ (findformat) Fixed bug causing gzip, bzip, bzip2 and compress'd
+ files not to be identified correctly.
+
+Thu Jul 19 18:12:35 CEST 2001
+
+ * atool:
+ Added new option, -e, --each.
+ Many changes to accomodate for new --each option.
+ * atool.1:
+ Fixed some omissions in the man-page.
+ Added documentation about --each.
+ Added example section.
+
+Mon Jul 16 11:48:51 CEST 2001
+
+ * Version 0.9.0.
+ * atool:
+ Added new options, -v, --verbose and --verbosity to control
+ verbosity of atool.
+ Improved verbosity control (fixes #99028). Fixed some bugs
+ regarding verbosity level.
+ Changed behaviour of apack on compressed files.
+ Now uses file's -z option to identify more formats.
+ When identifying using file, now print result of identification.
+ Fixed typo in --help about -V for --explain.
+ Added option --config. Read configuration first after options
+ have been parsed.
+ * README:
+ Now refers to the man-page for usage information.
+ * atool.1:
+ Updated for new options.
+ Included some text previously in README document.
+
+Sun Jul 15 11:15:04 CEST 2001
+
+ * atool:
+ Added somewhat better error messages when a subprocess fails.
+ Remove the temporary directory on exit if possible.
+ Now refuses to overwrite existing files when creating (non-zip
+ and non-rar) archives (unless --force specified).
+
+Thu Jul 12 11:54:52 CEST 2001
+
+ * atool: Will only identify format of regular files.
+
+Thu Jul 5 15:06:26 CEST 2001
+
+ * Version 0.8.0.
+ * atool: Now exit after --version.
+
+Sun Jul 1 11:21:53 CEST 2001
+
+ * atool:
+ (findformat) Lowercase filenames before checking format.
+ Add option terminator `--' to `file' command line.
+ (getmode) Consider --extract-to to be a separate command.
+ (makeoutdir) Fixed random number generation.
+
+Sat Jun 30 00:05:42 CEST 2001
+
+ * atool: Adding missing backslash in help text.
+
+Wed Jun 20 17:00:47 CEST 2001
+
+ * atool: New subroutine "backticks", used instead of `` when
+ identifying file type using "file".
+ * atool: New subroutine "readconfig" to read a configuration
+ file. Called to read /etc/atool.conf and ~/.atoolrc.
+ * atool: Added option use_gzip_for_z.
+ * README: Updated to document configuration options.
+
+Wed Apr 25 10:11:16 CEST 2001 Oskar Liljeblad <
[email protected]>
+
+ * atool: Added support for identify some file formats
+ using file(1).
+
+Tue Apr 24 21:14:49 CEST 2001 Oskar Liljeblad <
[email protected]>
+
+ * Makefile: Include NEWS file in distribution.
+
+Mon Apr 16 13:35:14 CEST 2001 Oskar Liljeblad <
[email protected]>
+
+ * Version 0.7.0.
+ * atool.1: Added .war extension for Jar archives.
+
+Sat Apr 7 16:00:17 CEST 2001 Oskar Liljeblad <
[email protected]>
+
+ * atool: Fixed commands for tar archive. The 'f' option
+ to tar was missing, causing output to be written to stdout
+ and input read from stdin.
+
+Thu Apr 5 14:00:03 CEST 2001 Oskar Liljeblad <
[email protected]>
+
+ * atool: Added -F as short option alias for --format.
+ * atool (parsefmt): Fixed recognition of manual formats.
+
+Wed Apr 4 17:08:14 CEST 2001 Oskar Liljeblad <
[email protected]>
+
+ * atool (parsefmt): Recognize .war as a JAR archive.
+ * atool (stripext): Strip .tar.Z, .tZ, .Z, and .war.
+
+2001-04-04 Oskar Liljeblad <
[email protected]>
+
+ * Version 0.6.0.
+ * atool: Complete rewrite. See NEWS file for changes.
+ * NEWS: New file.
+ * debian/docs: Added NEWS.
+
+2001-03-28 Oskar Liljeblad <
[email protected]>
+
+ * atool loops when you try to extract to a directory
+ that doesn't exist. This is fixed now.
+ * atool: Fixed commands for .tar archives
+ ("f" was missing in options for all commands).
+
+2001-03-28 Oskar Liljeblad <
[email protected]>
+
+ * Version 0.5.0 released because of version mistake
+ (by me) on Freshmeat - 0.3.0 was released as 0.4.0.
+
+2001-03-27 Oskar Liljeblad <
[email protected]>
+
+ * Version 0.4.0.
+ * debian/*: New files, for making Debian packages
+ of atool.
+ * atool: Included more license text from COPYING.
+ Fixed help text for -X command.
+ Added prototypes for subroutines without them.
+ * README: Included more license text from COPYING.
+ Minor format changes.
+ * atool.1: New man page.
+ * Makefile: Updated for Debian package generation.
+ New rule "debian".
+ Now installs man page.
+
+2001-03-26 Oskar Liljeblad <
[email protected]>
+
+ * Added forward function declarations so that the warnings
+ "main::foo() called too early to check prototype" no longer
+ appear when using Perl 5.6.
+
+2001-03-24 Oskar Liljeblad <
[email protected]>
+
+ * Version 0.3.0 released.
+ * Use exec instead of system where possible.
+
+2001-03-22 Oskar Liljeblad <
[email protected]>
+
+ * Fixes in last release introduced new bugs when extracting files
+ from multi-file archives. "Use of uninitialized value .." would
+ we printed, along with another bogus error. Hopefully these bugs
+ are fixed now.
+ * Added support for jar archives.
+ * Added use_jar_program variable.
+ * --quiet (-q) option is now listed in --help.
+ * README: Better documentation for configuration variables in
+ atool.
+ * Code cleanup: Simplified generation of command lines for tar/zip.
+ * (Internal) New distdiff rule in Makefile for comparing tars of
+ atool.
+ * (Internal) README: Added more things to do.
+
+2001-03-21 Oskar Liljeblad <
[email protected]>
+
+ * Version 0.2.0 relesed.
+ * When extracting single compressed files (foo.gz), a temporary
+ extraction subdirectory would be created even though it was not
+ needed. This is now fixed.
+ * Display a message when `list' command is tried on single
+ compressed files (foo.gz etc).
+
+2001-03-17 Oskar Liljeblad <
[email protected]>
+
+ * Version 0.1.0: First public release.
--- /dev/null
+# Makefile.in - Makefile for atool
+#
+# Copyright (C) 2001, 2002, 2003, 2004, 2005 Oskar Liljeblad
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+# Location of source code files
+srcdir = @srcdir@
+
+# Root of installation tree (architecture-independent files)
+prefix = @prefix@
+
+# Root of installation tree (architecture-dependent files)
+exec_prefix = @exec_prefix@
+
+# Path where the atool executables are installed
+bindir = @bindir@
+
+# Path where the atool manpages are installed
+mandir = @mandir@
+
+# Directory in archive created by `make dist'
+distdir = @PACKAGE_TARNAME@-@PACKAGE_VERSION@
+
+# Files created by the configure script
+autoconf_targets = atool Makefile atool.1 atool.spec
+
+.PHONY: all clean distclean maintclean install debian rpm
+
+all: $(autoconf_targets)
+
+$(autoconf_targets): %: $(srcdir)/%.in config.status
+ ./config.status $@
+
+$(srcdir)/configure: $(srcdir)/configure.ac
+ cd $(srcdir) && autoconf
+
+config.status: $(srcdir)/configure
+ ./config.status --recheck
+
+clean:
+ rm -f $(srcdir)/debian/atool.{postinst.debhelper,prerm.debhelper}
+ rm -f $(srcdir)/debian/{atool.substvars,files,substvars,build-stamp}
+ rm -rf $(srcdir)/debian/atool
+
+distclean: clean
+ rm -f acat adiff als apack aunpack
+ rm -f config.log Makefile
+ rm -f atool atool.1 atool.spec
+ rm -rf autom4te.cache
+ rm -f config.status
+
+maintclean: distclean
+ rm -f $(srcdir)/configure
+
+install: all
+ install -d $(DESTDIR)$(bindir)
+ install -m 755 atool $(DESTDIR)$(bindir)
+ ln -s -f atool $(DESTDIR)$(bindir)/aunpack
+ ln -s -f atool $(DESTDIR)$(bindir)/apack
+ ln -s -f atool $(DESTDIR)$(bindir)/acat
+ ln -s -f atool $(DESTDIR)$(bindir)/als
+ ln -s -f atool $(DESTDIR)$(bindir)/adiff
+ install -d $(DESTDIR)$(mandir)/man1
+ install -m 644 atool.1 $(DESTDIR)$(mandir)/man1
+ ln -s -f atool.1 $(DESTDIR)$(mandir)/man1/aunpack.1
+ ln -s -f atool.1 $(DESTDIR)$(mandir)/man1/apack.1
+ ln -s -f atool.1 $(DESTDIR)$(mandir)/man1/acat.1
+ ln -s -f atool.1 $(DESTDIR)$(mandir)/man1/als.1
+ ln -s -f atool.1 $(DESTDIR)$(mandir)/man1/adiff.1
+
+dist:
+ rm -rf $(distdir)
+ mkdir -p $(distdir)
+ cp -L $(srcdir)/{COPYING,ChangeLog,NEWS,README,TODO} $(distdir)
+ cp -L $(srcdir)/{atool.1.in,atool.in,atool.spec.in} $(distdir)
+ cp -L $(srcdir)/{Makefile.in,configure.ac,configure} $(distdir)
+ mkdir -p $(distdir)/debian
+ cp -a $(srcdir)/debian/{changelog,control,copyright,rules} $(distdir)/debian
+ chmod a-s $(distdir)
+ fakeroot tar cvfz $(distdir).tar.gz $(distdir)
+ rm -rf $(distdir)
+
+debian:
+ cd $(srcdir) && dpkg-buildpackage -rfakeroot -us -uc -sd -b
+
+rpm: atool.spec
+ rpm -bb --clean atool.spec
--- /dev/null
+2005-07-25: atool 0.30.0 released.
+ Added support for 7-Zip archives (.7z) using p7zip (suggested by Meino
+ Christian Cramer).
+ Added support for ALZip archives (.alz) using unalz.
+ Added support for Debian package archives (.deb) files (contributed by
+ Joao Lourenco).
+ Fixed some typos in the manual page (reported by Stephane Jourdois).
+ Added file matches for LHA SFX archives.
+ Updated documentation.
+ Got rid of year ranges in copyright.
+
+2004-07-05: atool 0.29.0 released.
+ Added support for ar archive (.a) files (suggested by Wojtek Sczygiol).
+ Improved and cleaned up handling of compressed files (single file
+ archives), resulting in some bugs fixed.
+ Deal with compressed files (.gz, .bz2, ..) differently, fixing some bugs.
+ These files are now extracted to current directory.
+ Implemented new options 'decompress_to_cwd'.
+
+2004-06-18: atool 0.28.0 released.
+ 'make install' will now build everything before installing.
+ Use detected perl path in atool executable (reported by Ed Avis).
+ Fixed extraction of files from LHA archives (reported by Goetz Waschk and
+ Matthew Mueller).
+
+2003-11-14: atool 0.27.0 released.
+ Support for autoconf has been added (based on files from Hisham Muhammad,
+ thanks).
+ Added support for ARC files (suggested by Ed Avis).
+ Added support for using the arj command for ARJ archives (previously only
+ unarj was supported).
+ Cleaned up and improved the manual page and README document.
+ Fixed RAR identification from file(1) output.
+ Now uses tar --bzip2 option instead of -j. The use_tar_j_option has been
+ renamed to use_tar_bzip2_option (patch submitted by Ed Avis, thanks).
+ Renamed the use_rar_for_unrar option to use_rar_for_unpack (old options
+ will still work).
+ Bumped copyright year.
+ Removed the distdiff make target.
+
+2003-05-23: atool 0.26.0 released.
+ Added a new configuration option, use_rar_for_unrar (always use rar
+ instead of unrar when possible).
+ Added a new configuration option, strip_unknown_ext (strip unknown
+ extensions). Patch submitted by Götz Waschk - thanks!
+ Tried to make atool more portable by using File::Spec more.
+ Some minor bug fixes for --simulate mode.
+ Cleaned up error messages.
+
+2002-11-08: atool 0.25.0 released.
+ Implemented a new option keep_compressed to control whether the original
+ file should be kept after packing/unpacking compressed files.
+ Cleaned up code for handling compressed files.
+ Now refuses to compress multiple files into one.
+ Don't pass -r option to unrar.
+ Cleaned up and simplified the code a little (remove exec argument).
+ Use unrar instead of rar when not creating RAR archives. A new option,
+ path_unrar was added. (Requested by Götz Waschk.)
+ Use cpio for archives that file(1) reports as "ASCII cpio archive".
+ Replaced 'refuse to overwrite' wording with 'refusing to overwrite'.
+ Updated manual page:
+ Replaced 'single-file-compressor' wording with 'file compressor'.
+ Clarified meaning of PATH value to -X option.
+
+2002-10-09: atool 0.24.0 released.
+ If PAGER is set, use that for default pager instead.
+ Debian and RPM packages now include symlinks to the manpage for aunpack,
+ apack etc too. These symlinks are also installed during make install.
+ Build fixes for RPM package from Götz Waschk (thanks).
+ Don't set root:root owner when installing files in Makefile.
+
+2002-09-28: atool 0.23.0 released.
+ Added new feature: If no file arguments are specified with apack,
+ filenames are read from standard in.
+ Added new option: -0, --null to specify that filenames read from standard
+ in are separated by null-bytes.
+ Fixed tab stop in --help message.
+ Exit with non-zero return code if any command failed.
+ Cleaned up code (add parens around subroutine calls) to prevent weird
+ bugs.
+
+2002-09-17: atool 0.22.0 released.
+ Fixed use_gzip_for_z configuration option name typo (was
+ cfg_use_gzip_for_z).
+ New option use_find_cpio_print0 to make find use -print0 and cpio -0.
+ Added support for lzop archives.
+
+2002-09-16: atool 0.21.0 released.
+ Use POSIX::getcwd instead of Cwd::cwd (fixes warnings with perl 5.8).
+ Fixed some bugs for Perl 5.005 compatibility (reported by Nicholas
+ Piper).
+ Use sysopen instead of three argument open to open some files.
+ Use POSIX::isprint instead of /[[:print:]]/.
+ Added --subdir (-D) option to always extract to subdirectory.
+
+2002-09-08: atool 0.20.0 released.
+ Added support for cpio archives.
+ Fixed bugs with --save-outdir (wouldn't save right directory), and
+ updated manpage.
+ Fixed help message ("current directory" => "specified directory").
+
+2002-07-13: atool 0.19.0 released.
+ Added PREFIX variable to Makefile (patch submitted by Dave Dribin).
+ Updated man page with supported archive formats.
+ Always run rar with the -r (recursive) option.
+ Documented how to make aunpack change into the directory where files were
+ extracted to (feature requested by Brian Hall).
+
+2002-07-02: atool 0.18.0 released.
+ Added support for rpm archives (patch submitted by João Lourenço -
+ thanks!).
+ Added configuration option `show_extracted' to always show what file was
+ extracted. This is also the default behavior now.
+ Added adiff example to manpage.
+ Running atool on files with names beginning with <, >, +, | or other
+ similar characters could potentially have very bad effects on atool (such
+ as files disappearing). This is fixed now.
+ Updated the author's email address in the help and version messages.
+ Improved error messages by quoting all filenames mentioned.
+ No longer change mode on directories before removing them (now considered
+ to be unsafe by myself, despite the fact that I wrote the code originally
+ :).
+ Atool can now be used on files with newline and delete characters in
+ their names. (As a result of this, atool now uses the POSIX perl module.)
+
+2002-04-14: atool 0.17.0 released.
+ Added support for extraction of arj archives.
+ Fixed symlink creation during make install (patch from Brian Hall).
+ Fixed wording ("files in root" instead of "root files").
+ Fixed adiff on compressed files (would have no effect, and would leave an
+ Unpack dir).
+
+2002-02-09: atool 0.16.0 released.
+ Added new option `args_diff' to control diff arguments (previously `-ru'
+ was hardcoded in).
+ Updated wordings in the README.
+ Reformatted NEWS file. :)
+ Improved Makefile somewhat.
+ Fixed identification and some extension-related issues with LHA and RAR.
+ Added support for ace archives (extraction and listing only).
+ Mention URL for some archiver programs in the README.
+
+2001-12-22: atool 0.15.0 released.
+ Fixed a minor bug that would prevent atool from extracting archives with
+ one non-writable root directory properly (reported by Matthew Mueller).
+ Added files for making RPM packages of atool.
+ Added TODO document.
+
+2001-11-17: atool 0.14.0 released.
+ Added support for .lha archives (with lha command).
+ Fixed and improved the adiff command. (It will no longer ask before
+ deleting files.)
+ Changed default path for the compress command to 'compress'.
+ Improved error messages.
+ Some very minor bug fixes.
+
+2001-10-26: atool 0.13.0 released.
+ New command adiff that generates a diff between two archives.
+ Documentation fixes.
+
+2001-09-18: atool 0.12.0 released.
+ Improved error messages when the program to execute does not exist (no
+ more Perl warnings).
+ The author has changed email-address to
[email protected].
+
+2001-08-13: atool 0.11.0 released.
+ Improved error messages.
+ The --each option can now be used with the add command. (This can be used
+ to create multiple archives at a time.)
+
+2001-08-01: atool 0.10.0 released.
+ New option -e, --each to extract or list multiple archives in one
+ command.
+ Fixed a bug causing gzip, bzip, bzip2 and compress'd files not to be
+ identified correctly.
+ Added sections `Examples' and `Known Bugs' to the manual page.
+
+2001-07-16: atool 0.9.0 released.
+ Rethought the verbosity options. New options: -v, --verbose and -V,
+ --verbosity. Default verbosity level can now be set in configuration
+ file.
+ Changed behaviour of apack on compressed (gzip, bzip2, ..) files (didn't
+ work before).
+ Now file's -z option is used to identify more formats.
+ Included more information in the manual page (about configuration etc).
+ New option --config to load a specific configuration file.
+ The temporary extraction directory is now removed on exit, if it is
+ empty.
+ Now refuses to overwrite existing files when creating archives.
+ Minor bug fixes, error message improvements and typo corrections.
+
+2001-07-05: atool 0.8.0 released.
+ Added support for configuration files. System-wide (/etc/atool.conf) and
+ user (~/.atoolrc) configuration files are supported.
+ Added support for identifying files using file(1). See the README file
+ for details.
+ Symbolic links that refers to non-existant files will no longer be
+ overwritten when extracting files (these symlinks were previously
+ considered to be non-existant themselves).
+ The NEWS file is included again.
+ Added option (use_gzip_for_z) to control whether to use gzip or
+ uncompress to decompress .Z files.
+ Some minor bug fixes.
+
+2001-04-16: atool 0.7.0 released.
+ Fixed all commands for tar archives (output would be written to stdout
+ and input read from stdin by default),
+ When extracting tar.Z archives, extension wouldn't be removed from output
+ directory. This has been fixed now.
+ Manual format (with --format) wouldn't work at all. This is fixed now.
+ Added -F as an alias for --format.
+ Recognize .war as a JAR archive.
+
+2001-04-04: atool 0.6.0 released.
+ Added this NEWS document.
+ Complete rewrite resulting in cleaner and better code.
+ Added support for rar archives.
+ Added support for .Z (compress) compressed files and .tar.Z archives.
+ New option "-p, --page", to send output through pager.
+ New option "-E, --explain" to have atool explain what is being done.
+ New option "-S, --simulate" to have atool simulate commands.
+ Changed "-X, --extract-here" command to "-X, --extract-to" that requires
+ a PATH argument.
+ The temporary extraction directory is now named "Unpack-XXXX", instead of
+ "atool-unpack-XXXX".
+ Added configuration options for setting path of programs to use.
+ Added configuration options for controlling name of temporary extraction
+ directory.
+ Implemented a command line generation engine so that /bin/sh is used only
+ when necessary.
+ Now uses strict.
+
+2001-03-28: atool 0.5.0 released.
+ Rereleased with new version number (0.3.0 was released as 0.4.0 on
+ Freshmeat).
+
+2001-03-27: atool 0.4.0 released.
+ Added forward function declarations to fix "X called to early to check
+ prototype" messages generated by Perl 5.6.
+ Added files for making Debian packages of atool.
+ Fixed help text for -X command.
+ Added prototypes for functions without them.
+ Added manpage for atool.
+ Added more license text from COPYING to the atool source and README file.
+
+2001-03-24: atool 0.3.0 released.
+ Fixed "Use of uninitialized value" messages when extracting from
+ archives.
+ Added support for jar archives, and use_jar_program configuration
+ variable.
+ The "-q, --quiet" option is now listed in help message.
+ Configuration variables are now better documented in the README.
+ Some cleanup of the atool code.
+ Use exec instead of system where possible.
+
+2001-03-21: atool 0.2.0 released.
+ Now creates temporary extraction directory only when necessary.
+ Display a message when list command is run on compressed files.
+
+2001-03-17: atool 0.1.0 released.
+ First public release.
--- /dev/null
+atool - Introduction
+====================
+
+atool is a script for managing file archives of various types (tar,
+tar+gzip, zip etc).
+
+The main command is aunpack which extracts files from an archive. Did you
+ever extract files from an archive, not checking whether the files were
+located in a subdirectory or in the top directory of the archive, resulting
+in files scattered all over the place? aunpack overcomes this problem by
+first extracting to a new directory. If there was only a single file in the
+archive, that file is moved to the original directory. aunpack also
+prevents local files from being overwritten by mistake.
+
+The other commands provided are apack (to create archives), als (to list
+files in archives), and acat (to extract files to standard out). As atool
+invokes external programs to handle the archives, not all commands may be
+supported for a certain type of archives.
+
+atool identifies archives by their file extension. Sometimes this is not
+possible - for instance rar archives usually have varying numeric file
+extensions. In those cases when atool can't identify the format, file is
+used instead. (atool can be configured not to use file.)
+
+atool is written in Perl by Oskar Liljeblad and is free software (GNU
+General Public License).
+
+Copyright and License
+=====================
+
+atool is Copyright (C) 2001, 2002, 2003, 2004, 2005 Oskar Liljeblad
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc., 51
+Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+The source code of this project may contain files from other projects, and
+files generated by other projects, including:
+
+ * GNU Autoconf (http://www.gnu.org/software/autoconf/)
+
+Such files are licensed under the terms of the GNU General Public License
+or a license compatible with the GNU GPL (as listed on
+http://www.gnu.org/licenses/license-list.html). See each file for copyright
+details.
+
+Requirements
+============
+
+The following programs are required to run atool:
+
+ * Perl 5.004 or later
+
+ atool is written in Perl. The modules File::Spec, File::Basename,
+ Getopt::Long and POSIX must be available (they probably are by default).
+
+ site:</i http://www.perl.org/
+
+ package:<c perl
+
+The following programs are optional for running atool:
+
+ * file
+
+ file is used to determine file types, and is found in most unices by
+ default. This program is necessary unless you choose to disable the
+ use_file option.
+
+ site</i: ftp://ftp.astron.com/pub/file/
+
+ package<c file
+
+ * tar (GNU tar)
+
+ tar is required if you want to use atool with tar archives.
+ Implementations other than GNU's will work with atool as well, but see
+ the Installation section below if you don't use GNU tar 1.13.18 or
+ later.
+
+ site:</i http://www.gnu.org/software/tar/tar.html
+
+ package:<c tar
+
+ * gzip (GNU zip)
+
+ gzip is required if you want to use atool with gzip compressed archives.
+
+ site:</i http://www.gzip.org/
+
+ package:<c gzip
+
+ * bzip
+
+ bzip is required if you want to use atool with bzip compressed archives.
+ Note that bzip is obsoleted by bzip2.
+
+ * bzip2
+
+ bzip2 is required if you want to use atool with bzip2 compressed
+ archives.
+
+ site:</i http://www.bzip.org/
+
+ package:<c bzip2
+
+ * lzop
+
+ lzop is required if you want to use atool with lzop compressed archives.
+
+ site:</i http://www.lzop.org/
+
+ package:<c lzop
+
+ * zip/unzip (Info-ZIP Zip/Unzip)
+
+ Zip is required if you want to use atool with zip archives.
+ Implementations other than Info-ZIP's might work with atool as well.
+
+ site:</i http://www.info-zip.org
+
+ packages:zip, <c unzip
+
+ * rar (Eugene Roshal's RAR and UnRAR)
+
+ RAR is required if you want to use atool with rar archives.
+ Implementations other than Eugene Roshal's might work with atool as
+ well.
+
+ site:</i http://www.rarsoft.com/
+
+ package:rar, <c unrar
+
+ * lha (LHa for UNIX)
+
+ LHa is required if you want to use atool with lha, lharc and similar
+ archives.
+
+ site:</i http://www.infor.kanazawa-it.ac.jp/~ishii/lhaunix/
+
+ package:<c lha
+
+ * unace (UnAce for Linux)
+
+ UnAce is required if you want to use atool with ace archives.
+
+ site:</i http://www.winace.com
+
+ package:<c unace
+
+ * arj
+
+ Arj is required if you want to use atool with arj archives.
+
+ site:</i http://arj.sourceforge.net
+
+ package:<c arj
+
+ * Red Hat Package Manager
+
+ The Red Hat Package Manager is required if you want to use atool with
+ rpm archives.
+
+ site:</i http://www.rpm.org/
+
+ package:<c rpm
+
+ * cpio (GNU cpio)
+
+ cpio is required if you want to use atool with cpio archives. Other
+ implmentations than GNU's might work as well.
+
+ site:</i http://www.gnu.org/software/cpio/
+
+ package:<c cpio
+
+ * arc
+
+ arc is required if you want to use atool with ARC archives (all commands
+ supported).
+
+ site:</i http://sources.isc.org/archiver/arc-5.21.txt
+
+ package:<c arc
+
+ * nomarch
+
+ nomarch is required if you want to use atool to list and extract files
+ from ARC archives.
+
+ site:</i http://rus.members.beeb.net/nomarch.html
+
+ package:<c nomarch
+
+ * p7zip
+
+ p7zip is required if you want to use atool with 7z archives.
+
+ site:</i http://p7zip.sourceforge.net/
+
+ package:<c p7zip
+
+ * unalz
+
+ unalz is required if you want to use atool with alzip archives.
+
+ site:</i http://www.kipple.pe.kr/win/unalz/
+
+package:<c unalz
+
+Building
+========
+
+To build all files, simply run
+
+ ./configure
+
+The configure script accepts a few options - use the following command to
+show them:
+
+ ./configure --help
+
+Installation
+============
+
+Installing atool is a matter of copying the atool file to some appropriate
+directory for executable files, usually /usr/local/bin. After that,
+symbolic links for apack, aunpack, als and acat to atool should be created
+in the same directory.
+
+All this can be done automaticly by running
+
+ make install
+
+It is possible to create a system wide configuration file overriding
+default values found in the top of the atool script (see below).
+
+Usage and Configuration
+=======================
+
+A list of options that atool accepts can be displayed by running atool with
+the --help option:
+
+ atool --help
+
+Please see the manual page for atool for full use and configuration
+information. This document can usually be viewed this way:
+
+ man ./atool.1
+
+Supported formats
+=================
+
+Please see the supplied manual page, as described above.
+
+Homepage
+========
+
+Web site and file area for atool is hosted on Savannah:
+
+ http://www.nongnu.org/atool/
+
+The latest version of atool should always be available on this site.
+
+Feedback
+========
+
+The author of atool and this document, Oskar Liljeblad, can be reached by
+e-mail:
+
+
+Please send bug reports, suggestions, ideas or comments in general to me -
+I would like to hear from you if you like (or don't like) atool.
+
+Known bugs and missing features
+===============================
+
+Please see the KNOWN BUGS section of the atool.1 manual page.
+
+Things to do
+============
+
+Please see the TODO document.
+
+-
--- /dev/null
+add option to assume format with -F in some situations (like tar.gz)?
+add option to always assume -e? and add some option for the reverse (-s, --single)
+assume -e when passing a single directory as argument?
+
+change back error messages to:
+ cannot foo `bar': No such file or directory
+ make function to format error message?
+
+have autoconf generate files in debian subdir as well?
+
+in readconfig, add datatype checking to options (bool/str/int/..)
+
+add 'atest': test archive integrity
+add compression level control arguments: store (0) or 1-9
+make sure atool has non-zero rc when acat can't find a file (.arc files and possibly other)
+
+improve error message when some program doesn't exist (now gets unnecessary lines)
+
+complete arepack!!
+arepack to repack archives?
+ arepack existing.tar existing.zip? OK done
+ arepack SOURCE DEST OK done
+ arepack -F DESTFORMAT -e SOURCE1 SOURCE2.. dest format
+ arepack -e FORMAT SOURCE DEST source format? ??
+
+tests:
+ does gzip support --?
+ does tar support -z?
+ does tar support -I?
+ does tar support --?
+ does zip treat *?[]\ chars in filenames specially?
+
+use "--" with gzip and others?
+
+Reasons to rewrite in C:
+ - use manual ZIP code so that we can extract archive with '../foo' files too!
+ tar fails entirely when the archive contains '../xxx' members.
+ - the option --save-outdir in extract-to mode could be implemented
+ easier.
+ - multiple commands per action more easily (same with perl tho)
+ - always identify format using magic values, ignoring extension (fast!)
+ - i18n much easier (and faster)
+
+Bugs
+ implement list command for single compressed archives? only gzip supports -l
+ consider:
+ apack dummy.tar.gz /etc/hostname
+ mkdir etc
+ aunpack dummy.tar.gz
+ Archive is now extracted with file as dummy/etc/hostname
+ Should it be dummy/hostname or etc-1/hostname instead?
+
+Other formats
+ add support for SEA arc.
+ add support for szip (hard because its interface is different from gzip)
+ make an ACE archive (using winace stuff), test ACE extraction!
+ add support for DEB files
+ list: dpkg-deb -c FILE.deb
+ extract: dpkg-deb -x FILE.deb $outdir/CONTENTS
+ dpkg-deb -e FILE.deb $outdir/DEBIAN
+ JAR/ZIP:
+ Implement 'use_jar_for_zip' - use jar for zip archives (fastjar) - test
+ Rename 'use_zip_for_jar' - use zip for jar archives - test
+ Enable add command for jar archives!
+
+
+Other features
+ make a script to detect system settings and configure atool appropriately
+ Make it possible to send additional arguments to RAR etc. engine configurable via command line?
+ especially adiff diff -ruN (note the N) option
+
+--------------------------------------------------------------------------------
+
+libarchive:
+ OpenArchive(fd)->archive
+ CloseArchive(archive)
+ GetType(archive)
+
+ BeginJob(archive)->job
+ PerformJob(job)
+ EndJob(job)
+
+ GetError(job)
+ ErrorManger(job,callback)
+ ProgressManager(job,callback)
+
+ CreateArchive(file)->archive
+
+ FileDescriptor
+ close()
+ read(data,amount)
+ write(data,amount)
+ seek(pos,whence)
+
+ FileIterator(job,fileselector,filecallback)
+
+ DeleteFile(job,fh)
+ ExtractFile(job,fh,outfd)
+ ReplaceFile(job,fh,infile)
+
+ AddFile(job,filename,extfile)
+
+---
+
+verbosity levels:
+ 0 default, quiet
+ 1 verbose, print filenames
+ 2 very verbose, print long list format
+
+extract: what to when local file exists, only when archive contains one file
+(and not in interactive mode)
+ * (m)ove to subdirectory
+ * (r)ename
+ * move files to subdir, rename directory
+ * for interactive mode only: (o)verwrite
+
+how to extract single compressed file
+ * delete original file afterwards
+ * keep original file
+ * don't extract at all (refuse)
+
+add:
+ * apack: create new archive (refuse if existing exists)
+ * apack -a: add to existing archives (create if necessary)
+
+---
+
+MAJOR options:
+
+ aunpack -X -x [DIR] extract to dir
+ apack -A -a add files to archive (or create)
+ apack -C -c create only
+ als -L -l list files in archive
+ acat -P -c/-p print file (to standard out) in archive
+
+ adiff -D -d print difference between two archives
+ afind -F -f find files in archive (emulate find) [?]
+
+ arepack -R -r extract and pack archives
+
+
+
+als ARCHIVE1..
+ -l -l (long) like ls
+ -f -f (classify) like ls
+ -m[TYPE] from all archives, list only files matching (remaining args are matches)
+
+prev: als -e *.tar now: als *.tar
+prev: als foo.tar f* now: als foo.tar -m f*
+
+aunpack ARCHIVE1..
+ -X DIR where to extract to (otherwise be smart)
+ -m[TYPE] from all archives, extract only files matching (remaining args are matches)
+
+apack ARCHIVE FILE1..
+ -a add files if archive already exists (without -a, refuse to overwrite existing)
+ -e all arguments are files (or dirs) to compress individually
+ -F FORMAT force file format
+
+ -f allow overwriting of archives (clobber). NOTE: for safety, this implies
+
+
+--------------------------------------------------------------------------------
+
+New rules format:
+
+# This document shows how a future rules file format for atool could look. It
+# was written to outline what was necessary for such a format. It is quite
+# possible this format will never become a reality due to its complexity.
+
+# use ; to separate commands!
+
+# rules and configuration files are the same
+
+noinclude # don't include default rules/configuration file!
+ # (otherwise /etc/atool.rules will be included first)
+ # useful if you want to make your own rules completely
+
+set path_zip "foobar" # example of variable set in a configuration file
+ # (can only be done after option declared in format)
+
+# the extract command defined here also handles extract-in (only outdir changes)
+# the create command refuses to create an existing archive
+# the add command will turn into a create command if the archive doesn't exist
+# the print command outputs a file in the archive to standard out
+
+# variable namespace:
+# read-only variables - $outdir, $archive, $args
+# format-local variables - declared with 'variable'
+# options - declared with option
+
+# FIXME: what about about special exit codes (zip)? CHECK atool
+
+format {
+ name { zip jar } # a name for users to use in -F option (force format)
+ extension { .zip .jar } # possible file extensions (ignored?)
+ magic { PK\003\004 } # magic bytes (kinda regex?)
+ option string path_zip "zip"
+ option string path_unzip "unzip"
+ command extract { $path_unzip "-d" $outdir $archive $args }
+ command add,create { $path_zip "-r" $archive $args }
+ command print { $path_unzip "-p" $archive $args }
+ command list { $path_unzip "-l" $archive $args }
+ command common {
+ [ $verbosity > 1 ] "-v" # this format means: add "-v" only if $verbosity > 1
+ [ $verbosity < 0 ] "-qq" # (the first string after [] applies, or block if { } )
+ [ $verbosity == 0 ] "-q"
+ }
+ multiarchive true # specifies that this archive may contain multiple files
+ needs_cwd false # specifies that this archive doesn't need to cwd to outdir on extract
+ # (technically we could autodetect this by seeing of $outdir is referenced
+ # in the extract command)
+}
+
+format {
+ name { lha lzh }
+ extension { .lha .lzh }
+ magic { "..-lh[01234567 d]-" "..-lz[45s]-" } # what about >20 byte x ; 2 string -lh6-
+ option string path_lha "lha"
+ command common { $path_lha }
+ command extract { "x" $archive $args $outdirslash } # outdirslash = outdir that ends in slash
+ command add,create { "a" $archive $args }
+ command print { "p" $archive $args }
+ command list {
+ "a"
+ [ $verbosity >= 3 ] "v"
+ [ $verbosity = 2 ] "l"
+ [ $verbosity <= 1 ] "lq"
+ }
+ multiarchive true
+ needs_cwd false
+}
+
+format {
+ name { tar[+.]gz(ip)? }
+ extension { .tgz .tar.gz }
+ option string path_tar "tar" # this one assume tar supports -z
+ variable string opts
+ command common { $path_tar [ $verbosity >= 1 ] [ $opts = "v" ] } # a conditional
+ command print { xO ++ $opts ++ zf } # ++ means concatenate
+ command extract { x ++ $opts ++ zf -C $outdir } # -C works on Sun too
+ command list { t ++ $opts ++ zf }
+ command create { c ++ $opts ++ zf } # tar can append (-r), but not tar+gz
+ command common { $archive $args }
+ multiarchive true
+ needs_cwd false
+}
+
+format {
+ disabled # do not use this format at all
+ name { tar[+.]gz(ip)? }
+ extension { .tgz .tar.gz }
+ option string path_tar "tar" # this one does NOT assume tar supports -z
+ option string path_gzip "gzip"
+ variable string opts
+ command common { [ $verbosity >= 1 ] [ $opts = "v" ] }
+ command print { $path_gzip -cd $archive | $path_tar xO ++ $opts $args }
+ command extract { $path_gzip -cd $archive | $path_tar x ++ $opts $args }
+ command list { $path_gzip -cd $archive | $path_tar t ++ $opts $args }
+ command create { $path_tar c ++ $opts $args | $path_gzip > $archive }
+ multiarchive true
+ needs_cwd false
+ create_only true # FIXME: maybe not necessary? (see create/add above)
+}
+
+
+--------
+
+TODO.v2:
+
+better extraction semantics, cleaner code
+
+ * always use change to directory for extraction, never specify dir on cmd command-line?
+ use ../for instead of absolute dir
+ merges extract-to and extract
+
+ * core support for multiple commands per mode (think debian)
+
+ * better control of user arguments to external command (@args)
+
+ * better solution than multiarchivecmd - cleaned up
+
+ * more general commands:
+ test
+
+ * more general options
+ compression level
+
+ * stripext only based on format! (e.g. unpack gz then strip .gz, not .tar.gz)
+
+want aunpack -e to be default!
--- /dev/null
+.\" -*- nroff -*-
+.\" atool.1 - Manual page for atool.
+.\"
+.\" Copyright (C) 2001, 2002, 2003, 2004, 2005 Oskar Liljeblad
+.\"
+.\" This program is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU Library General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License along
+.\" with this program; if not, write to the Free Software Foundation,
+.\" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+.\"
+.TH ATOOL "1" "July 5, 2005" "atool"
+.\" Read this file with groff -man -Tascii atool.1
+.SH NAME
+atool \- A script for managing file archives of various types
+.SH SYNOPSIS
+.B atool
+.RI [ OPTION ]... " ARCHIVE " [ FILE ]...
+.br
+.B aunpack
+.RI [ OPTION ]... " ARCHIVE " [ FILE ]...
+.br
+.B apack
+.RI [ OPTION ]... " ARCHIVE " [ FILE ]...
+.br
+.B als
+.RI [ OPTION ]... " ARCHIVE " [ FILE ]...
+.br
+.B acat
+.RI [ OPTION ]... " ARCHIVE " [ FILE ]...
+.br
+.B adiff
+.RI [ OPTION ]... " ARCHIVE " "" ARCHIVE
+.SH DESCRIPTION
+This manual page document describes the \fBatool\fP commands.
+These commands are used for managing file archives of various
+types, such as tar and Zip archives. Each command can be
+executed individually or by giving the appropriate options
+to \fBatool\fP (see \fBOPTIONS\fP below).
+.PP
+\fBaunpack\fP extracts files from an archive. Often one wants
+to extract all files in an archive to a single subdirectory.
+However, some archives contain multiple files in their root
+directories. The aunpack program overcomes this problem by
+first extracting files to a unique (temporary) directory, and
+then moving its contents back if possible. This also prevents
+local files from being overwritten by mistake.
+.PP
+\fBapack\fP creates archives (or compresses files). If no file
+arguments are specified, filenames to add are read from standard in.
+.PP
+\fBals\fP lists files in an archive.
+.PP
+\fBacat\fP extracts files in an archive to standard out.
+.PP
+\fBadiff\fP generates a diff between two archives using
+diff(1).
+.PP
+Unless the \fB\-\-format\fP (\fB\-f\fP) option is provided,
+the archive format is determined by the archive file extension. I.e.
+an extension ".tar.gz" or ".tgz" means tar+gzip format. Note that
+the extensions are checked in the order listed in the section
+\fBARCHIVE TYPES\fP below, which is why a file with extension ".tar.gz"
+is considered to a be tar+gzip archive, not a gzip compressed file.
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+.TP
+.B \-l, \-\-list
+List files in archive.
+This option is automaticly assumed when \fBals\fP is executed.
+.TP
+.B \-x, \-\-extract
+Extract files from archive.
+This option is automaticly assumed when \fBaunpack\fP is executed.
+.TP
+.B \-X, \-\-extract-to\fR=\fIPATH\fR
+Extract files from archive to the specified directory. When
+unpacking compressed files, PATH may refer to either a filename
+or an existing directory.
+.TP
+.B \-a, \-\-add
+Create archive.
+This option is automaticly assumed when \fBapack\fP is executed.
+.TP
+.B \-c, \-\-cat
+Extract a file from archive to standard out (displaying it on
+screen).
+This option is automaticly assumed when \fBacat\fP is executed.
+.TP
+.B \-d, \-\-diff
+Extract two archives and use diff(1) to generate differencies
+between them.
+This option is automaticly assumed when \fBadiff\fP is executed.
+.TP
+.B \-e, \-\-each
+For each argument, execute the specified command. This can be used
+to quickly extract, list or create multiple archives (see \fBEXAMPLES\fR
+below). This option can not be used with the cat command.
+.TP
+.B \-F, \-\-format\fR=\fIEXTENSION\fR
+Specify archive format manually (see \fBARCHIVE TYPES\fR below).
+.TP
+.B \-S, \-\-simulate
+Run atool in simulation mode. No changes to the filesystem
+(i.e. writes) will be made, and all commands that would be
+executed are displayed instead. This option can't be combined
+with \fB\-\-explain\fP (since it implies that already).
+
+Note that it is not guaranteed that the commands printed in
+simulation mode will be the same as those executed in non-
+simulation mode. This is because some operations depend on
+what files archives contain, and atool can at this time
+only determine that by extracting archives.
+.TP
+.B \-E, \-\-explain
+Display commands executed by atool. This option can't be combined
+with \fB\-\-simulate\fP.
+.TP
+.B \-p, \-\-page
+Run output through a pager, usually \fBpager\fP unless the environment
+variable \fBPAGER\fP is set.
+.TP
+.B \-f, \-\-force
+When extracting from files, allow overwriting of local files.
+When creating an archive, allow the archive file to be overwritten
+if it already exists. Note that it is possible to add files to
+existing RAR and Zip archives (this is not possible for many
+other formats).
+.TP
+.B \-D, \-\-subdir
+When extracting archives, always create a new directory for
+the archive even if the archive only contains one file in
+its root directory.
+.TP
+.B \-0, \-\-null
+If no file arguments are specified when creating or adding files
+to archives, the list of files will be read from standard in.
+Normally these filenames are separated by newline, but with this
+option they are separated by null-bytes. This is useful with the
+GNU find -print0 option.
+.TP
+.B \-q, \-\-quiet
+Decrease verbosity level by one. This is subtracted from the
+default verbosity level, or the level specified
+with \fB\-\-verbosity\fP. This option may be specified more than
+once to make atool even less verbose.
+.TP
+.B \-v, \-\-verbose
+Increase verbosity level by one. This is added to the
+default verbosity level, or the level specified
+with \fB\-\-verbosity\fP. This option may be specified more than
+once to make atool even more verbose.
+.TP
+.B \-V, \-\-verbosity\fR=\fILEVEL\fR
+Specify verbosity level. The default level is 1,
+which means "normal verbosity" - e.g. when creating and
+extracting from archives, files will be listed.
+.TP
+.B \-\-config\fR=\fIFILE\fR
+Load configuration from the specified file. When using this
+option, the system-wide and user-wide configuration files
+will not be loaded. If the specified file does not exist or
+can not be read, atool will terminate with an error message.
+.TP
+.B \-\-save\-outdir\fR=\fIFILE\fR
+When extracting files, save the name of the directory which
+the archive was extracted to to the specified file. If the
+command was not `extract', or the archive was not extracted to
+a new directory, then nothing will be written to the specified
+file. If multiple archives were specified (with -e), then
+only the last directory that files were extracted to will be
+written to FILE.
+
+This option is used internally (see \fBEXAMPLES\fR below).
+.TP
+.B \-\-help
+Show summary of options.
+.TP
+.B \-\-version
+Output version information and exit.
+.SH ARCHIVE TYPES
+Unless the \-f (\-\-format) option is provided, the archive format
+is determined by the archive file extension. I.e. an extension
+".tar.gz" or ".tgz" means tar+gzip format. Note that the extensions
+are checked in the other listed above, which is why a file
+with extension ".tar.gz" is considered to a tar+gzip archive,
+not a gzip archive.
+.PP
+The diff command is supported whenever the extract command is
+supported.
+.PP
+The supported archive types are:
+.TP
+.RI \fBtar+gzip\fP " " ( .tar.gz ", " .tgz )
+All commands are supported.
+.TP
+.RI \fBtar+bzip\fP " " ( .tar.bz ", " .tbz )
+All commands are supported.
+.TP
+.RI \fBtar+bzip2\fP " " ( .tar.bz2 ", " .tbz2 )
+All commands are supported.
+.TP
+.RI \fBtar+compress\fP " " ( .tar.Z ", " .tZ )
+All commands are supported.
+.TP
+.RI \fBtar\fP " " ( .tar )
+All commands are supported.
+.TP
+.RI \fBzip\fP " " ( .zip )
+All commands are supported.
+.TP
+.RI \fBjar\fP " " ( .jar ", " .war )
+List, extract, and add commands are supported.
+Cat is supported if use_jar_program is disabled.
+.TP
+.RI \fBrar\fP " " ( .rar )
+All commands are supported.
+.TP
+.RI \fBlha\fP " " ( .lha ", " .lzh )
+All commands are supported.
+.TP
+.RI \fB7z\fP " " ( .7z )
+Extract, list and add commands are supported.
+.TP
+.RI \fBalzip\fP " " ( .alz )
+Extract command is supported.
+.TP
+.RI \fBace\fP " " ( .ace )
+Extract and list commands are supported.
+.TP
+.RI \fBar\fP " " ( .a )
+All commands are supported.
+.TP
+.RI \fBarj\fP " " ( .arj )
+List, extract and add commands are supported.
+.TP
+.RI \fBarc\fP " " ( .arc )
+All command are supported.
+(Note that arc outputs an extra newline when the cat command is used.)
+.TP
+.RI \fBrpm\fP " " ( .rpm )
+Extract and list commands are supported.
+.TP
+.RI \fBdeb\fP " " ( .deb )
+Extract and list commands are supported.
+.TP
+.RI \fBgzip\fP " " ( .gz )
+Cat, extract, and add commands are supported.
+.TP
+.RI \fBbzip\fP " " ( .bz )
+Cat, extract, and add commands are supported.
+.TP
+.RI \fBbzip2\fP " " ( .bz2 )
+Cat, extract, and add commands are supported.
+.TP
+.RI \fBcompress\fP " " ( .Z )
+Cat, extract, and add commands are supported.
+.SH CONFIGURATION
+Since version 0.8.0, atool can read custom configuration files.
+First, hardcoded defaults in the atool program file are evaluated.
+Then system-wide configuration values are loaded from
+\fI/etc/atool.conf\fR if that file exists. Finally, per-user
+configuration values are loaded from \fI.atoolrc\fR in the current
+user's home directory.
+.PP
+The format of the configuration files is simple:
+.IP
+variable value
+.PP
+Here \fBvariable\fR is a variable listed below, and \fBvalue\fR is the
+value to associate the variable with. \fBvariable\fR and \fBvalue\fR
+should be separated with at least one whitespace (space, tab etc). Empty
+lines and lines beginning with # are discarded.
+.PP
+A value of `1' means that the option is enabled, and `0'
+that it is disabled. Strings should not be quoted, as they start at
+the first non-whitespace character and end at the end of the line.
+.PP
+The options are:
+.TP
+.B use_tar_bzip2_option \fR(default: 1)\fR
+Enable this if you use GNU tar and it supports the \fB\--bzip2\fP option
+for filtering bzip2'ed files through bzip2. Versions 1.13.6
+or later of GNU tar support \fB\--bzip2\fP. Therefore, if you use
+GNU tar earlier than 1.13.6, you will need to disable this option.
+
+This used to be \fBuse_tar_j_option\fP but using --bzip2 is more portable.
+.TP
+.B use_tar_z_option \fR(default: 1)\fR
+Enable this if you use GNU tar and it supports the \fB-z\fP option
+for filtering gzipped files through gzip. You will need to disable
+this and \fIuse_tar_j_option\fR if you don't use GNU tar.
+
+Disabling these two options doesn't mean that atool can't
+extract bzip2/gzip files. If disabled, atool use a pipe to
+send output from bzip2/gzip to tar instead.
+
+If possible, these options should be enabled since error
+management is better when filtering is done by tar.
+.TP
+.B use_gzip_for_z \fR(default: 1)\fR
+Enable this if you want to use gzip instead of uncompress when
+decompressing compress'ed files (`.Z' files).
+.TP
+.B use_rar_for_unpack \fR(default: 0)\fR
+Enable this if you want to always use rar instead of unrar
+when possible. This makes atool use the rar command
+(path_rar) even when listing and extracting RAR files.
+.TP
+.B use_arc_for_unpack \fR(default: 0)\fR
+Enable this if you want to always use arc instead of nomarch
+when possible. This makes atool use the arc command
+(path_arc) even when listing and extracting ARC files.
+.TP
+.B use_arj_for_unpack \fR(default: 0)\fR
+Enable this if you want to always use arj instead of unarj
+when possible. This makes atool use the arj command
+(path_arj) even when listing and extracting ARJ files.
+.TP
+.B use_find_cpio_print0 \fR(default: 1)\fR
+Enable this if find supports the -print0 option and cpio supports
+the -0 option. Without it, it is impossible/harder to make cpio
+archives of files with newline characters in their names.
+.TP
+.B strip_unknown_ext \fR(default: 1)\fR
+Certain types of files are actually archives, but their extensions
+doesn't tell so. Examples are Open Office documents (Zip files) and
+Gnumeric documents (gzip'ed files). Since the extensions of those
+filenames are unknown to atool, they would not be stripped with
+this option set to 0. The output file in that case would be something
+like Unpack-XYZW. Setting this option to 1 will cause the extension
+to be stripped instead.
+.TP
+.B use_jar \fR(default: 0)\fR
+Enable this if you want to use jar for managing jar
+archives. If you disable this option, zip will be
+used (which should work just as well, and probably be
+faster too).
+
+This option is disabled by default since extracting
+files to standard out (`cat') is not supported by jar.
+.TP
+.B use_file \fR(default: 1)\fR
+Enable this if you want atool to identify file types
+using file(1) for those files with an unrecognized
+extension (or none at all).
+
+Note that tar-archives compressed with a file compressor
+(such as gzip, bzip2 and so on) can't be identified this way.
+For this reason, files packed with gzip and other file
+compressors are not identified either.
+.TP
+.B tmpdir_name \fR(default: Unpack-%04d)\fR
+atool extracts to a temporary directory created in the current
+directory so that no files are overwritten. This variable
+controlls what name that temporary directory should have.
+
+The `%d' string in this variable will be replaced with a random
+number between 0 and 9999. It is possible change the format
+of this number by using something else than `%d' - see printf(3).
+.TP
+.B path_pager \fR(default: pager)\fR
+.TP
+.B path_jar \fR(default: jar)\fR
+.TP
+.B path_tar \fR(default: tar)\fR
+.TP
+.B path_zip \fR(default: zip)\fR
+.TP
+.B path_unzip \fR(default: unzip)\fR
+.TP
+.B path_gzip \fR(default: gzip)\fR
+.TP
+.B path_bzip \fR(default: bzip)\fR
+.TP
+.B path_bzip2 \fR(default: bzip2)\fR
+.TP
+.B path_compress \fR(default: compress)\fR
+.TP
+.B path_lzop \fR(default: lzop)\fR
+.TP
+.B path_rar \fR(default: rar)\fR
+.TP
+.B path_unrar \fR(default: unrar)\fR
+.TP
+.B path_7z \fR(default: 7z)\fR
+.TP
+.B path_unalz \fR(default: unalz)\fR
+.TP
+.B path_lha \fR(default: lha)\fR
+.TP
+.B path_unace \fR(default: unace)\fR
+.TP
+.B path_ar \fR(default: ar)\fR
+.TP
+.B path_arj \fR(default: arj)\fR
+.TP
+.B path_unarj \fR(default: unarj)\fR
+.TP
+.B path_arc \fR(default: arc)\fR
+.TP
+.B path_nomarch \fR(default: nomarch)\fR
+.TP
+.B path_rpm \fR(default: rpm)\fR
+.TP
+.B path_rpm2cpio \fR(default: rpm2cpio)\fR
+.TP
+.B path_dpkg_deb \fR(default: dpkg-deb)\fR
+.TP
+.B path_cpio \fR(default: cpio)\fR
+.TP
+.B path_file \fR(default: file)\fR
+.TP
+.B path_find \fR(default: find)\fR
+.TP
+.B path_xargs \fR(default: xargs)\fR
+.TP
+.B path_cat \fR(default: cat)\fR
+.TP
+.B path_diff \fR(default: diff)\fR
+These are all paths to the corresponding programs. It is usually
+best to leave them as is, because that way their locations can be
+looked up from the PATH variable.
+.TP
+.B args_diff \fR(default: -ru)\fR
+This variable specifies command line arguments to pass to the
+diff command (as specified by path_diff) when using adiff. Space
+characters separate arguments in this string.
+.TP
+.B path_syscfg \fR(default: /etc/atool.conf)\fR
+(This variable can only be set in the atool program file.)
+This variable specifies the directory where the system-wide
+configuration file is located.
+.TP
+.B path_usercfg \fR(default: .atoolrc)\fR
+(This variable can only be set in the atool program file
+and system-wide configuration file.)
+This variable specifies where the user configuration file
+is located. Note that if this filename is relative (i.e. doesn't
+being with `/'), it will be relative to the current user's home
+directory (as determined by the HOME environment variable).
+.TP
+.B default_verbosity \fR(default: 1)\fR
+This is the default verbosity of atool. By using -q and -v
+options, the verbosity level can be raised and lowered.
+Level 1 means "normal verbosity" - e.g. when creating and
+extracting from archives, files will be listed.
+.TP
+.B show_extracted \fR(default: 1)\fR
+If this is set to 1, the aunpack command will always show
+what file or directory that was extracted. Otherwise
+that will only be printed if the archive was extracted to
+an unexpected location (as a result of local files already
+existing or the archive having multiple files in its root
+directory).
+
+This can be quite useful in combinatiaon with `default_verbosity 0'.
+Note that this option will have no effect when the -X option is used
+with aunpack, and it has no effect on compressed files.
+.TP
+.B keep_compressed \fR(default: 1)\fR
+When compressing a file with gzip or bzip2, the original (uncompressed)
+file is usually deleted once it has been compressed. I.e. if you
+compress a file "test" you will end up with only one file, "test.gz".
+With this option set to 1, you will make atool keep the original file
+as well. The original behaviour is achieved by setting this option to 0.
+
+This option also has an equivalent effect on uncompressing compressed
+files. When set to 1, the original (compressed) file will be kept.
+Otherwise it will be deleted.
+
+Note however that this option has no effect when packing up a compressed
+file with the -X option (for specifying an output directory or file). In
+that case the original file is always kept.
+.TP
+.B decompress_to_cwd \fR(default: 1)\fR
+When decompressing a file with commands such as gzip or bzip2, the
+decompressed file is usually placed in the same directory as the
+compressed file. With this option set to 1, the decompressed file is
+instead placed in the current working directory.
+
+Note that this option has no effect when -X is used.
+
+.SH ENVIRONMENT VARIABLES
+.B PAGER
+The default pager to use when the -p/--page option is specified.
+.SH EXAMPLES
+To extract all files from archive `foobar.tar.gz' to a subdirectory
+(or the current directory if it only contains one file):
+.br
+ \fBaunpack foobar.tar.gz\fP
+.PP
+To extract all files from all `.tar.gz' archives in the
+current directory:
+.br
+ \fBaunpack -e *.tar.gz\fP
+.PP
+To create a zip archive of two files `foo' and `bar':
+.br
+ \fBapack myarchive.zip foo bar\fP
+.PP
+To display the file `baz' in the archive `myarchive.zip'
+through a pager:
+.br
+ \fBacat -p myarchive.zip baz\fP
+.PP
+To list contents of the rar archive `stuff.rar':
+.br
+ \fBals stuff.rar\fP
+.PP
+To create three archives, `dir1.tar.gz', `dir2.tar.gz' and `dir3.tar.gz',
+so that the first one contains all files in dir1, the second all
+in dir2 and the third all dir3:
+.br
+ \fBapack -e -F .tar.gz dir1 dir2 dir3\fP
+.PP
+To show all differences between version 2.4.17 and 2.4.18 of the kernel:
+.br
+ \fBadiff linux-2.4.17.tar.gz linux-2.4.18.tar.gz\fP
+.PP
+Here's a shell function that will make the aunpack command change into the
+directory where files were extracted:
+.br
+ \fBaunpack () {\fP
+.br
+ \fB TMP=`mktemp /tmp/aunpack.XXXXXXXXXX`\fP
+.br
+ \fB atool -x --save-outdir=$TMP "$@"\fP
+.br
+ \fB DIR="`cat $TMP`"\fP
+.br
+ \fB [ "$DIR" != "" -a -d "$DIR" ] && cd "$DIR"\fP
+.br
+ \fB rm $TMP\fP
+.br
+ \fB}\fP
+.br
+If you don't have the mktemp program, you can replace the second line with
+(note however that this is not entirely safe)
+.br
+ \fB TMP="/tmp/atool_outdir.$$"\fP
+.PP
+.SH KNOWN BUGS
+Trying to extract gzip and other compressed files without the .gz (or .bz2
+etc) extension won't work:
+.PP
+ aunpack: foo: format not known, identifying using file
+ aunpack: foo: format is `gzip'
+ gzip: foo: unknown suffix -- ignored
+.PP
+This last error above is generated by \fBgzip -d foo\fP.
+.PP
+If you find a bug not listed here, please report it to <@PACKAGE_BUGREPORT@>.
+.SH REPORTING BUGS
+Report bugs to <\
[email protected]\fP>.
+.SH AUTHOR
+The author of \fBatool\fP and this manual page is Oskar Liljeblad <\
[email protected]\fP>.
+.SH COPYRIGHT
+Copyright \(co 2001, 2002, 2003, 2004, 2005 Oskar Liljeblad
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--- /dev/null
+#! @PERL@ -w
+#
+# atool - A script for managing file archives of various types.
+#
+# Copyright (C) 2001, 2002, 2003, 2004, 2005 Oskar Liljeblad
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See the atool(1) manual page for usage details.
+#
+# This file uses tab stops with a length of two.
+#
+
+use File::Basename;
+use File::Spec;
+use Getopt::Long;
+use POSIX;
+use locale;
+use strict;
+
+# Subroutine prototypes (needed for perl 5.6)
+sub runcmds($$;@); #
+sub getmode(); #
+sub multiarchivecmd($$$$@); #
+sub singlearchivecmd($$$$@); #
+sub maketarcmd($$$$@); #
+sub cmdexec($@); #
+sub parsefmt($$); #
+sub makeoutdir(); #
+sub makeoutfile(); #
+sub explain($); #
+sub extract(@); #
+sub shquotemeta($); #
+sub tailslash($); #
+sub de($); #
+sub makespec(@); #
+sub backticks(@); #
+sub readconfig($$); #
+sub formatext($); #
+sub stripext($); #
+sub findformat($$); #
+sub unlink_directory($); #
+sub find_comparable_file($); #
+sub makeabsolute($); #
+sub quote($); #
+sub shell_execute(@); #
+sub save_outdir($); #
+sub handle_empty_add(@); #
+
+# Configuration options and their built-in defaults
+$::cfg_args_diff = '-ru'; # arguments to pass to diff program
+$::cfg_default_verbosity = 1; # default verbosity level
+$::cfg_keep_compressed = 1; # keep compressed file after pack/unpack
+$::cfg_decompress_to_cwd = 1; # decompress to current directory
+$::cfg_path_7z = '7z'; # 7z program
+$::cfg_path_ar = 'ar'; # ar program
+$::cfg_path_arc = 'arc'; # arc program
+$::cfg_path_arj = 'arj'; # arj program
+$::cfg_path_bzip = 'bzip'; # bzip program
+$::cfg_path_bzip2 = 'bzip2'; # bzip2 program
+$::cfg_path_cat = 'cat'; # cat program
+$::cfg_path_compress = 'compress'; # compress program
+$::cfg_path_cpio = 'cpio'; # cpio program
+$::cfg_path_diff = 'diff'; # diff program
+$::cfg_path_file = 'file'; # file program
+$::cfg_path_find = 'find'; # find program
+$::cfg_path_gzip = 'gzip'; # gzip program
+$::cfg_path_jar = 'jar'; # jar program
+$::cfg_path_lha = 'lha'; # lha program
+$::cfg_path_lzop = 'lzop'; # lzop program
+$::cfg_path_nomarch = 'nomarch'; # nomarch program
+$::cfg_path_pager = 'pager'; # pager program
+$::cfg_path_rar = 'rar'; # rar program
+$::cfg_path_rpm = 'rpm'; # rpm program
+$::cfg_path_rpm2cpio = 'rpm2cpio'; # rpm2cpio program
+$::cfg_path_dpkg_deb = 'dpkg-deb'; # dpkg-deb program
+$::cfg_path_tar = 'tar'; # tar program
+$::cfg_path_unace = 'unace'; # unace program
+$::cfg_path_unalz = 'unalz'; # unalz program
+$::cfg_path_unarj = 'unarj'; # unarj program
+$::cfg_path_unrar = 'unrar'; # unrar program
+$::cfg_path_unzip = 'unzip'; # unzip program
+$::cfg_path_xargs = 'xargs'; # xargs program
+$::cfg_path_zip = 'zip'; # zip program
+$::cfg_path_usercfg = '.@PACKAGE_NAME@rc'; # user configuration file
+$::cfg_path_syscfg = '/etc/@
[email protected]'; # system-wide configuration file
+$::cfg_show_extracted = 1; # always show extracted file/directory
+$::cfg_strip_unknown_ext = 1; # strip unknown extensions
+$::cfg_tmpdir_name = 'Unpack-%04d'; # extraction directory name
+$::cfg_use_arc_for_unpack = 0; # use arc to unpack arc files?
+$::cfg_use_arj_for_unpack = 0; # use arj to unpack arj files?
+$::cfg_use_file = 1; # use file(1) for unknown extensions?
+$::cfg_use_find_cpio_print0 = 1; # use -print0/-0 find/cpio options?
+$::cfg_use_gzip_for_z = 1; # use gzip to decompress .Z files?
+$::cfg_use_jar = 0; # use jar or zip for .jar archives?
+$::cfg_use_rar_for_unpack = 0; # use rar to unpack rar files?
+$::cfg_use_tar_bzip2_option = 1; # does tar support --bzip2?
+$::cfg_use_tar_z_option = 1; # does tar support -z?
+
+# Global variables
+$::basename = quote(File::Basename::basename($0));
+@::rmdirs = ();
+$::up = File::Spec->updir();
+$::cur = File::Spec->curdir();
+
+# Parse arguments
+Getopt::Long::config('bundling');
+Getopt::Long::GetOptions(
+ 'l|list' => \$::opt_cmd_list,
+ 'x|extract' => \$::opt_cmd_extract,
+ 'X|extract-to=s' => \$::opt_cmd_extract_to,
+ 'a|add' => \$::opt_cmd_add,
+ 'c|cat' => \$::opt_cmd_cat,
+ 'd|diff' => \$::opt_cmd_diff,
+ 'r|repack' => \$::opt_cmd_repack,
+ 'q|quiet' => sub { $::opt_verbosity--; },
+ 'v|verbose' => sub { $::opt_verbosity++; },
+ 'V|verbosity=i' => \$::opt_verbosity,
+ 'config=s' => \$::opt_config,
+ 'help' => \$::opt_cmd_help,
+ 'version' => \$::opt_cmd_version,
+ 'F|format=s' => \$::opt_format,
+ 'f|force' => \$::opt_force,
+ 'p|page' => \$::opt_use_pager,
+ 'e|each' => \$::opt_each,
+ 'E|explain' => \$::opt_explain,
+ 'S|simulate' => \$::opt_simulate,
+ 'save-outdir=s' => \$::opt_save_outdir,
+ 'D|subdir' => \$::opt_extract_subdir,
+ '0|null' => \$::opt_null,
+) or exit 1;
+
+# Display --version
+if ($::opt_cmd_version) {
+ print
+"@PACKAGE_NAME@ @PACKAGE_VERSION@\
+Written by Oskar Liljeblad.\
+\
+Copyright (C) 2005 Oskar Liljeblad\
+This is free software; see the source for copying conditions. There is NO\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+ exit;
+}
+
+# Display --help
+if ($::opt_cmd_help) {
+ print
+"Usage: @PACKAGE_NAME@ [OPTION]... ARCHIVE [FILE]...\
+ @PACKAGE_NAME@ -e [OPTION]... [ARCHIVE]...
+Managing file archives of various types.\
+\
+Commands:\
+ -l, --list list files in archive (als)\
+ -x, --extract extract files from archive (aunpack)\
+ -X, --extract-to=PATH extract archive to specified directory\
+ -a, --add create archive (apack)\
+ -c, --cat extract file to standard out (acat)\
+ -d, --diff generate a diff between two archives (adiff)\
+ --help display this help and exit\
+ --version output version information and exit\
+\
+Options:\
+ -e, --each execute command above for each file specified
+ -F, --format=EXT override archive format (see below)\
+ -D, --subdir always create subdirectory when extracting\
+ -f, --force allow overwriting of local files\
+ -q, --quiet decrease verbosity level by one\
+ -v, --verbose increase verbosity level by one\
+ -V, --verbosity=LEVEL specify verbosity (0, 1 or 2)\
+ -p, --page send output through pager\
+ -0, --null filenames from standard in are null-byte separated\
+ -E, --explain explain what is being done by @PACKAGE_NAME@\
+ -S, --simulate simulation mode - no filesystem changes are made\
+ --config=FILE load configuration defaults from file\
+\
+Archive format (for --format) may be specified either as a\
+file extension (\"tar.gz\") or as \"tar+gzip\".\
+\
+Report bugs to Oskar Liljeblad <oskar\@osk.mine.nu>.\
+";
+ exit;
+}
+
+# Read configuration files
+if (defined $::opt_config) {
+ readconfig($::opt_config, 0);
+} else {
+ readconfig($::cfg_path_syscfg, 1);
+ if ($::cfg_path_usercfg !~ /^\//) {
+ readconfig(File::Spec->catfile($ENV{HOME}, $::cfg_path_usercfg), 1);
+ } else {
+ readconfig($::cfg_path_usercfg, 1);
+ }
+}
+
+# Verify option integrity
+$::opt_verbosity += $::cfg_default_verbosity;
+if ($::opt_explain && $::opt_simulate) {
+ die "$::basename: --explain and --simulate options are mutually exclusive\n"; #OK
+}
+
+my $mode = getmode();
+
+if (defined $::opt_save_outdir && $mode eq 'extract-to') {
+ die "$::basename: --save-outdir cannot be used in extract-to mode\n";
+}
+if ($::opt_extract_subdir && $mode ne 'extract') {
+ die "$::basename: --subdir can only be used in extract mode\n";
+}
+
+if ($mode eq 'diff') {
+ die "$::basename: missing archive argument\n" if (@ARGV < 2); #OK
+ my $use_pager = $::opt_use_pager;
+ $::opt_verbosity--;
+ $::opt_use_pager = 0;
+
+ my $outfile1 = makeoutdir() || exit 1;
+ my $outfile2 = makeoutdir() || exit 1;
+ $::opt_cmd_extract_to = $outfile1;
+ exit 1 if (!runcmds('extract-to', $ARGV[0]));
+ $::opt_cmd_extract_to = $outfile2;
+ exit 1 if (!runcmds('extract-to', $ARGV[1]));
+
+ my $match1 = find_comparable_file($outfile1);
+ my $match2 = find_comparable_file($outfile2);
+
+ my @cmd = ($::cfg_path_diff, split(/ /, $::cfg_args_diff), $match1, $match2);
+ push @cmd, ['|'], get_pager_program() if $use_pager;
+ my $allok = cmdexec(1, @cmd);
+
+ foreach my $file ($outfile1,$outfile2) {
+ if (-e $file && -d $file) {
+ #if (-e $file) {
+ #print "$::basename: remove `$file'? ";
+ #select((select(STDOUT), $| = 1)[0]);
+ #my $line = <STDIN>;
+ #if (defined $line && $line =~ /^y/) {
+ #if (-d $file) {
+ unlink_directory($file);
+ #} else {
+ #unlink $file;
+ #}
+ #}
+ }
+ }
+
+ exit ($allok ? 0 : 1);
+}
+elsif ($mode eq 'repack') {
+ #FIXME: what if --each!
+ die "$::basename: missing archive arguments\n" if (@ARGV < 1); #OK
+ die "$::basename: missing archive argument\n" if (@ARGV < 2); #OK
+ die "$::basename: cannot repack to same archive\n"
+ if ($ARGV[0] eq $ARGV[1]
+ || File::Spec->canonpath($ARGV[0]) eq File::Spec->canonpath($ARGV[1]));
+ die "$::basename: ".quote($ARGV[1]).": destination file exists\n" if -e $ARGV[1];
+
+ my $outdir = makeoutdir() || exit 1;
+ $::opt_cmd_extract_to = $outdir;
+ exit 1 if (!runcmds('extract-to', $ARGV[0])); #OK?????
+ my $newarchive = File::Spec->catdir($::up, $ARGV[1]);
+ chdir($outdir) || die "$::basename: ".quote($outdir).": cannot change to - $!\n"; #OK?????
+ exit 1 if (!runcmds('add', $newarchive, $::cur));
+ chdir($::up) || die "$::basename: ".$::up.": cannot change to - $!\n"; #OK?????
+ unlink_directory($outdir);
+}
+elsif ($::opt_each) {
+ my $allok = 1;
+ if ($mode eq 'cat') {
+ die "$::basename: --each can not be used with cat or add command\n"; #OK
+ }
+ if ($mode eq 'add') {
+ if (!defined $::opt_format) {
+ die "$::basename: specify a format with -F when using --each in add mode\n";
+ }
+ my $format = findformat($::opt_format, 1);
+ for (my $c = 0; $c < @ARGV; $c++) {
+ my $archive = File::Spec->canonpath($ARGV[$c]) . formatext($format);
+ warn quote($archive).":\n" if $::opt_verbosity > 1;
+ runcmds($mode, $archive, $ARGV[$c]) or $allok = 0;
+ }
+ } else {
+ for (my $c = 0; $c < @ARGV; $c++) {
+ warn quote($ARGV[$c]).":\n" if $::opt_verbosity > 1;
+ runcmds($mode, $ARGV[$c]) or $allok = 0;
+ }
+ }
+ exit ($allok ? 0 : 1);
+}
+else {
+ die "$::basename: missing archive argument\n" if (@ARGV == 0); #OK
+ runcmds($mode, shift @ARGV, @ARGV) || exit 1;
+}
+
+# runcmds(mode, archive, args)
+# Execute an @PACKAGE_NAME@ command. This is where it all happens.
+# If mode is 'extract', returns the directory (or only file)
+# which was extracted.
+sub runcmds($$;@) {
+ my ($mode, $archive, @args) = @_;
+
+ my $format;
+ if (defined $::opt_format) {
+ $format = findformat($::opt_format, 1);
+ } else {
+ $format = findformat($archive, 0);
+ }
+ return undef if !defined $format;
+
+ my @cmd;
+ my $outdir;
+ if ($format eq 'tar+bzip2') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($::cfg_use_tar_bzip2_option) {
+ push @cmd, maketarcmd($archive, $outdir, $mode, 'f', '--bzip2'), @args;
+ } else {
+ push @cmd, $::cfg_path_bzip2, '-cd', $archive, ['|'] if $mode ne 'add';
+ push @cmd, maketarcmd(undef, $outdir, $mode, ''), @args;
+ push @cmd, ['|'], $::cfg_path_bzip2, ['>'], $archive if $mode eq 'add';
+ }
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 1, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'tar+gzip') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($::cfg_use_tar_z_option) {
+ push @cmd, maketarcmd($archive, $outdir, $mode, 'zf'), @args;
+ } else {
+ push @cmd, $::cfg_path_gzip, '-cd', $archive, ['|'] if $mode ne 'add';
+ push @cmd, maketarcmd(undef, $outdir, $mode, ''), @args;
+ push @cmd, ['|'], $::cfg_path_gzip, ['>'], $archive if $mode eq 'add';
+ }
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 1, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'tar+bzip') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ push @cmd, $::cfg_path_bzip, '-cd', $archive, ['|'] if $mode ne 'add';
+ push @cmd, maketarcmd(undef, $outdir, $mode, ''), @args;
+ push @cmd, ['|'], $::cfg_path_bzip, ['>'], $archive if $mode eq 'add';
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 1, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'tar+compress') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($::cfg_use_gzip_for_z) {
+ push @cmd, $::cfg_path_gzip, '-cd', $archive, ['|'] if $mode ne 'add';
+ } else {
+ push @cmd, $::cfg_path_compress, '-cd', $archive, ['|'] if $mode ne 'add';
+ }
+ push @cmd, maketarcmd(undef, $outdir, $mode, ''), @args;
+ push @cmd, ['|'], $::cfg_path_compress, ['>'], $archive if $mode eq 'add';
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 1, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'tar+lzop') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ push @cmd, $::cfg_path_lzop, '-Ucd', $archive, ['|'] if $mode ne 'add';
+ push @cmd, maketarcmd(undef, $outdir, $mode, ''), @args;
+ push @cmd, ['|'], $::cfg_path_lzop, ['>'], $archive if $mode eq 'add';
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 1, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'tar') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ push @cmd, maketarcmd($archive, $outdir, $mode, 'f'), @args;
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 1, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'jar' && $::cfg_use_jar) {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ my $opts = '';
+ if ($mode eq 'add') {
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return undef;
+ }
+ $opts .= 'v' if $::opt_verbosity >= 1;
+ push @cmd, $::cfg_path_jar;
+ push @cmd, "x$opts", '-C', $outdir if $mode eq 'extract';
+ push @cmd, "x$opts", '-C', $::opt_cmd_extract_to if $mode eq 'extract-to';
+ push @cmd, "t$opts" if $mode eq 'list';
+ push @cmd, "c$opts" if $mode eq 'add';
+ push @cmd, $archive, @args;
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 1, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'jar' || $format eq 'zip') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($mode eq 'add') {
+ push @cmd, $::cfg_path_zip, '-r';
+ } else {
+ push @cmd, $::cfg_path_unzip;
+ push @cmd, '-p' if $mode eq 'cat';
+ push @cmd, '-l' if $mode eq 'list';
+ push @cmd, '-d', $outdir if $mode eq 'extract';
+ push @cmd, '-d', $::opt_cmd_extract_to if $mode eq 'extract-to';
+ }
+ push @cmd, '-v' if $::opt_verbosity > 1;
+ push @cmd, '-qq' if $::opt_verbosity < 0;
+ push @cmd, '-q' if $::opt_verbosity == 0;
+ push @cmd, $archive, @args;
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'rar') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($mode eq 'add' || $::cfg_use_rar_for_unpack) {
+ push @cmd, $::cfg_path_rar;
+ } else {
+ push @cmd, $::cfg_path_unrar;
+ }
+ push @cmd, 'a' if $mode eq 'add';
+ push @cmd, 'vt' if $mode eq 'list' && $::opt_verbosity >= 3;
+ push @cmd, 'v' if $mode eq 'list' && $::opt_verbosity == 2;
+ push @cmd, 'l' if $mode eq 'list' && $::opt_verbosity <= 1;
+ push @cmd, 'x' if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, '-ierr', 'p' if $mode eq 'cat';
+ push @cmd, '-r' if ($mode eq 'add');
+ push @cmd, $archive, @args;
+ push @cmd, tailslash($outdir) if $mode eq 'extract';
+ push @cmd, tailslash($::opt_cmd_extract_to) if $mode eq 'extract-to';
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ }
+ elsif ($format eq '7z') {
+ # 7z has the -so option for writing data to stdout, but it doesn't
+ # write data to terminal even if the file is designed to be
+ # read in a terminal...
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($mode eq 'cat') {
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return undef;
+ }
+ push @cmd, $::cfg_path_7z;
+ push @cmd, 'a' if $mode eq 'add';
+ push @cmd, 'l' if $mode eq 'list';
+ push @cmd, 'x', '-o'.$outdir if $mode eq 'extract';
+ push @cmd, 'x', '-o'.$::opt_cmd_extract_to if $mode eq 'extract-to';
+ push @cmd, $archive, @args;
+ return multiarchivecmd($archive, $outdir, $mode, 1, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'alzip') {
+ if ($mode eq 'cat' || $mode eq 'add' || $mode eq 'list') {
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return undef;
+ }
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ push @cmd, $::cfg_path_unalz;
+ push @cmd, $archive;
+ push @cmd, $outdir if $mode eq 'extract';
+ push @cmd, $::opt_cmd_extract_to if $mode eq 'extract-to';
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'lha') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ push @cmd, $::cfg_path_lha;
+ push @cmd, 'a' if $mode eq 'add';
+ push @cmd, 'v' if $mode eq 'list' && $::opt_verbosity >= 3;
+ push @cmd, 'l' if $mode eq 'list' && $::opt_verbosity == 2;
+ push @cmd, 'lq' if $mode eq 'list' && $::opt_verbosity <= 1;
+ push @cmd, 'xw='.tailslash($outdir) if $mode eq 'extract';
+ push @cmd, 'xw='.tailslash($::opt_cmd_extract_to) if $mode eq 'extract-to';
+ push @cmd, 'p' if $mode eq 'cat';
+ push @cmd, $archive, @args;
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'ace') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ push @cmd, $::cfg_path_unace;
+ if ($mode eq 'add' || $mode eq 'cat') {
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return undef;
+ }
+ push @cmd, 'v', '-c' if $mode eq 'list' && $::opt_verbosity >= 3;
+ push @cmd, 'v' if $mode eq 'list' && $::opt_verbosity == 2;
+ push @cmd, 'l' if $mode eq 'list' && $::opt_verbosity <= 1;
+ push @cmd, 'x' if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, $archive, @args;
+ push @cmd, tailslash($outdir) if $mode eq 'extract';
+ push @cmd, tailslash($::opt_cmd_extract_to) if $mode eq 'extract-to';
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ }
+ elsif ($format eq 'arj') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($mode eq 'cat') {
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return undef;
+ }
+ if ($mode eq 'add' || $::cfg_use_arj_for_unpack) {
+ push @cmd, $::cfg_path_arj;
+ push @cmd, 'a' if $mode eq 'add';
+ push @cmd, 'v' if $mode eq 'list' && $::opt_verbosity == 2;
+ push @cmd, 'l' if $mode eq 'list' && $::opt_verbosity <= 1;
+ push @cmd, 'x' if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, $archive, @args;
+ push @cmd, tailslash($outdir) if $mode eq 'extract';
+ push @cmd, tailslash($::opt_cmd_extract_to) if $mode eq 'extract-to';
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ } else {
+ push @cmd, $::cfg_path_unarj;
+ # XXX: cat mode might work for arj archives, but it extract to stderr!
+ push @cmd, 'v' if $mode eq 'list' && $::opt_verbosity == 2;
+ push @cmd, 'l' if $mode eq 'list' && $::opt_verbosity <= 1;
+ push @cmd, 'x' if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, $archive if ($mode ne 'extract' && $mode ne 'extract-to');;
+ # we call makeabsolute here because needcwd=1 to the multiarchivecmd call
+ push @cmd, makeabsolute($archive) if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, @args;
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 0, 1, \@args, @cmd);
+ }
+ }
+ elsif ($format eq 'arc') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($mode eq 'add' || $::cfg_use_arc_for_unpack) {
+ push @cmd, $::cfg_path_arc;
+ push @cmd, 'a' if $mode eq 'add';
+ push @cmd, 'v' if $mode eq 'list' && $::opt_verbosity >= 3;
+ push @cmd, 'l' if $mode eq 'list' && $::opt_verbosity == 2;
+ push @cmd, 'ln' if $mode eq 'list' && $::opt_verbosity <= 1;
+ push @cmd, 'x' if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, 'p' if $mode eq 'cat';
+ } else {
+ push @cmd, $::cfg_path_nomarch;
+ push @cmd, '-lvU' if $mode eq 'list' && $::opt_verbosity >= 2;
+ push @cmd, '-lU' if $mode eq 'list' && $::opt_verbosity <= 1;
+ push @cmd, '-p' if $mode eq 'cat';
+ }
+ push @cmd, $archive if ($mode ne 'extract' && $mode ne 'extract-to');
+ # we call makeabsolute here because needcwd=1 to the multiarchivecmd call
+ push @cmd, makeabsolute($archive) if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, @args;
+ @cmd = handle_empty_add(@cmd) if ($mode eq 'add' && @args == 0);
+ return multiarchivecmd($archive, $outdir, $mode, 0, 1, \@args, @cmd);
+ }
+ elsif ($format eq 'rpm') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($mode eq 'list') {
+ push @cmd, $::cfg_path_rpm;
+ push @cmd, '-qlp';
+ push @cmd, '-v' if $::opt_verbosity >= 1;
+ push @cmd, $archive, @args;
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ }
+ elsif ($mode eq 'extract' || $mode eq 'extract-to') {
+ push @cmd, $::cfg_path_rpm2cpio;
+ push @cmd, makeabsolute($archive);
+ push @cmd, ['|'];
+ push @cmd, $::cfg_path_cpio, '-imd', '--quiet', @args;
+ return multiarchivecmd($archive, $outdir, $mode, 0, 1, \@args, @cmd);
+ }
+ else { # add and cat
+ # FIXME: I guess cat could work too, but it would require that we
+ # extracted to a temporary dir, read and printed it, then removed it.
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return undef;
+ }
+ }
+ elsif ($format eq 'deb') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($mode eq 'list' || $mode eq 'extract' || $mode eq 'extract-to') {
+ push @cmd, $::cfg_path_dpkg_deb;
+ push @cmd, '-c' if $mode eq 'list';
+ push @cmd, '-x' if $mode eq 'extract' || $mode eq 'extract-to';
+ push @cmd, $archive;
+ push @cmd, $outdir if $mode eq 'extract';
+ push @cmd, $::opt_cmd_extract_to if $mode eq 'extract-to';
+ push @cmd, @args;
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ }
+ # FIXME: I guess cat could work too, but it would require that we
+ # extracted to a temporary dir, read and printed it, then removed it.
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return undef;
+ }
+ elsif ($format eq 'ar') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ my $v = ($::opt_verbosity >= 1 ? 'v' : '');
+ push @cmd, $::cfg_path_ar;
+ push @cmd, 'rc'.$v if $mode eq 'add';
+ push @cmd, 'x'.$v if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, 't'.$v if $mode eq 'list';
+ # Don't use v(erbose) with cat command because ar would add "\n<member data>\n\n" to output
+ push @cmd, 'p' if $mode eq 'cat';
+ push @cmd, makeabsolute($archive), @args;
+ return multiarchivecmd($archive, $outdir, $mode, 1, 1, \@args, @cmd);
+ }
+ elsif ($format eq 'cpio') {
+ return undef if ($mode eq 'extract' && !defined ($outdir = makeoutdir()));
+ if ($mode eq 'list') {
+ push @cmd, $::cfg_path_cat, $archive, ['|'];
+ push @cmd, $::cfg_path_cpio, '-t';
+ push @cmd, '-v' if $::opt_verbosity >= 1;
+ return multiarchivecmd($archive, $outdir, $mode, 0, 0, \@args, @cmd);
+ }
+ elsif ($mode eq 'extract' || $mode eq 'extract-to') {
+ push @cmd, $::cfg_path_cat, makeabsolute($archive), ['|'];
+ push @cmd, $::cfg_path_cpio, '-i';
+ push @cmd, '-v' if $::opt_verbosity >= 1;
+ return multiarchivecmd($archive, $outdir, $mode, 0, 1, \@args, @cmd);
+ }
+ elsif ($mode eq 'add') {
+ if (@args == 0) {
+ push @cmd, $::cfg_path_cpio;
+ push @cmd, '-0' if $::opt_null;
+ push @cmd, '-o';
+ push @cmd, '-v' if $::opt_verbosity >= 1;
+ push @cmd, ['>'], $archive;
+ } else {
+ push @cmd, $::cfg_path_find, @args;
+ push @cmd, '-print0' if $::cfg_use_find_cpio_print0;
+ push @cmd, ['|'], $::cfg_path_cpio;
+ push @cmd, '-0' if $::cfg_use_find_cpio_print0;
+ push @cmd, '-o';
+ push @cmd, '-v' if $::opt_verbosity >= 1;
+ push @cmd, ['>'], $archive;
+ }
+ return multiarchivecmd($archive, $outdir, $mode, 1, 1, \@args, @cmd);
+ }
+ else { # cat
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return undef;
+ }
+ }
+ elsif ($format eq 'bzip2') {
+ return singlearchivecmd($archive, $::cfg_path_bzip2, $format, $mode, @args);
+ }
+ elsif ($format eq 'bzip') {
+ return singlearchivecmd($archive, $::cfg_path_bzip, $format, $mode, @args);
+ }
+ elsif ($format eq 'gzip') {
+ return singlearchivecmd($archive, $::cfg_path_gzip, $format, $mode, @args);
+ }
+ elsif ($format eq 'compress') {
+ if ($::cfg_use_gzip_for_z && $mode ne 'add') {
+ return singlearchivecmd($archive, $::cfg_path_gzip, $format, $mode, @args);
+ } else {
+ return singlearchivecmd($archive, $::cfg_path_compress, $format, $mode, @args);
+ }
+ }
+ elsif ($format eq 'lzop') {
+ return singlearchivecmd($archive, $::cfg_path_lzop, $format, $mode, '-U', @args);
+ }
+
+ return undef;
+}
+
+# de(value):
+# Return 1 if value defined and is non-zero, 0 otherwise.
+sub de($) {
+ my ($value) = @_;
+ return defined $value && $value ? 1 : 0;
+}
+
+# getmode()
+# Identify the execution mode, and return it.
+# Possible modes are 'cat', 'extract', 'list', 'add' or 'extract-to'.
+sub getmode() {
+ my $mode;
+ if (de($::opt_cmd_list)
+ + de($::opt_cmd_cat)
+ + de($::opt_cmd_extract)
+ + de($::opt_cmd_add)
+ + de($::opt_cmd_extract_to)
+ + de($::opt_cmd_diff)
+ + de($::opt_cmd_repack) > 1) {
+ die "$::basename: only one command may be specified\n"; #OK
+ }
+ $mode = 'cat' if ($::basename eq 'acat');
+ $mode = 'extract' if ($::basename eq 'aunpack');
+ $mode = 'list' if ($::basename eq 'als');
+ $mode = 'add' if ($::basename eq 'apack');
+ $mode = 'diff' if ($::basename eq 'adiff');
+ $mode = 'repack' if ($::basename eq 'arepack');
+ $mode = 'add' if ($::opt_cmd_add);
+ $mode = 'cat' if ($::opt_cmd_cat);
+ $mode = 'list' if ($::opt_cmd_list);
+ $mode = 'extract' if ($::opt_cmd_extract);
+ $mode = 'extract-to' if ($::opt_cmd_extract_to);
+ $mode = 'diff' if ($::opt_cmd_diff);
+ $mode = 'repack' if ($::opt_cmd_repack);
+ if (!defined $mode) {
+ die "$::basename: don't know what to do - no command specified\n"; #OK
+ }
+ return $mode;
+}
+
+# singlearchivecmd(archive, command, format, mode, args)
+# Execute a command for single-file archives.
+# The command parameter specifies what command to execute.
+# If mode is 'extract-to', returns the directory (or only file)
+# which was extracted.
+sub singlearchivecmd($$$$@) {
+ my ($archive, $cmd, $format, $mode, @args) = @_;
+ my $outfile;
+ my $reason;
+ my @cmd;
+ push @cmd, $cmd;
+ push @cmd, '-v' if $::opt_verbosity > 1;
+
+ if ($mode eq 'list') {
+ warn "$::basename: ".quote($archive).": $mode command not supported for $format archives\n";
+ return;
+ }
+ elsif ($mode eq 'cat') {
+ push @cmd, '-c', '-d', $archive, @args;
+ }
+ elsif ($mode eq 'add') {
+ if (@args > 1) {
+ warn "$::basename: cannot add more than one file with this format\n";
+ return;
+ }
+ if (!$::opt_force && (-e $archive || -l $archive)) {
+ warn "$::basename: ".quote($archive).": refusing to overwrite existing file\n";
+ return;
+ }
+ #if (!$::cfg_keep_compressed && stripext($archive) ne $args[0]) {
+ # warn "$::basename: ".quote($archive).": cannot create a $format archive with this name (use -X)\n";
+ # return;
+ #}
+ push @cmd, '-c', @args, ['>'], $archive;
+ }
+ elsif ($mode eq 'extract') {
+ $outfile = stripext($archive);
+ if ($::cfg_decompress_to_cwd) {
+ $outfile = basename($outfile);
+ }
+ if (-e $outfile) {
+ $outfile = makeoutfile();
+ $reason = 'local file exists';
+ }
+ push @cmd, '-c', '-d', $archive, @args, ['>'], $outfile;
+ }
+ elsif ($mode eq 'extract-to') {
+ $outfile = $::opt_cmd_extract_to;
+ if (-d $outfile) {
+ my $base = File::Basename::basename($archive);
+ $outfile = File::Spec->catfile($outfile, stripext($base));
+ }
+ push @cmd, '-c', '-d', $archive, @args, ['>'], $outfile;
+ }
+
+ push @cmd, ['|'], get_pager_program() if $::opt_use_pager;
+ cmdexec(0, @cmd) || return;
+
+ if ($mode eq 'extract' || $mode eq 'extract-to') {
+ if ($::cfg_show_extracted && !$::opt_simulate) {
+ my $archivebase = File::Basename::basename($archive);
+ my $rmsg = defined $reason ? " ($reason)" : '';
+ warn quote($archivebase).": extracted to `".quote($outfile)."'$rmsg\n";
+ }
+ }
+
+ if (!$::cfg_keep_compressed) {
+ if ($mode eq 'extract') {
+ warn 'unlink ', quote($archive), "\n" if ($::opt_explain || $::opt_simulate);
+ if (!$::opt_simulate) {
+ unlink($archive) || warn "$::basename: ".quote($archive).": cannot remove - $!\n";
+ }
+ }
+ elsif ($mode eq 'add') {
+ warn 'unlink ', quote($args[0]), "\n" if ($::opt_explain || $::opt_simulate);
+ if (!$::opt_simulate) {
+ unlink($args[0]) || warn "$::basename: ".quote($args[0]).": cannot remove - $!\n";
+ }
+ }
+ }
+
+ return $outfile;
+}
+
+# maketarcmd(opts):
+# Create (partial) command line arguments for a tar command.
+# The parameter opts specifies additional arguments to add.
+sub maketarcmd($$$$@) {
+ my ($archive, $outdir, $mode, $opts, @rest) = @_;
+ $opts .= 'v' if $::opt_verbosity >= 1;
+ my @cmd = ($::cfg_path_tar);
+ push @cmd, "xO$opts" if $mode eq 'cat';
+ push @cmd, "x$opts" if ($mode eq 'extract' || $mode eq 'extract-to');
+ push @cmd, "t$opts" if $mode eq 'list';
+ push @cmd, "c$opts" if $mode eq 'add';
+ push @cmd, $archive if defined $archive;
+ push @cmd, '-C', $outdir if $mode eq 'extract';
+ push @cmd, '-C', $::opt_cmd_extract_to if $mode eq 'extract-to';
+ push @cmd, @rest;
+ return @cmd;
+}
+
+# cmdexec(ignore_return, cmdspec)
+# Execute a command specification.
+# The cmdspec parameter is a list of string arguments building
+# the command line. If there's a list reference instead of a
+# string, it is a shell meta character/string which shouldn't
+# be quoted.
+sub cmdexec($@) {
+ my ($ignret, @cmd) = @_;
+
+ if ($::opt_explain || $::opt_simulate) {
+ my $spec = join(' ', map { ref $_ ? @{$_} : shquotemeta $_ } @cmd);
+ explain quote($spec)."\n";
+ return 1 if ($::opt_simulate);
+ }
+
+ my $cmds = makespec(@cmd);
+ if (!shell_execute(@cmd)) {
+ warn "$::basename: ".quote($cmds).": cannot execute - $::errmsg\n";
+ return 0;
+ }
+
+ if ($? & 0xFF != 0) {
+ warn "$::basename: ".quote($cmds).": abnormal exit (exit code $?)\n";
+ return 0;
+ }
+
+ if (!$ignret && $? >> 8 != 0) {
+ warn "$::basename: ".quote($cmds).": non-zero return-code\n";
+ return 0;
+ }
+
+ return 1;
+}
+
+# makespec(@)
+# Make a command specification when printing errors.
+sub makespec(@) {
+ my (@cmd) = @_;
+ my $spec = $cmd[0].' ..';
+ my $lastref = 0;
+ foreach (@cmd, '') {
+ if ($lastref) {
+ $spec .= " | $_ ..";
+ $lastref = 0;
+ }
+ $lastref = 1 if (ref);
+ }
+ return $spec;
+}
+
+# makeoutfile()
+# Make a unique output file for extraction command.
+sub makeoutfile() {
+ my $file;
+ do {
+ $file = sprintf $::cfg_tmpdir_name, int rand 10000;
+ } while (-e $file);
+ return $file;
+}
+
+# makeoutdir()
+# Make a temporary (unique) output directory for extraction command.
+sub makeoutdir() {
+ my $dir;
+ do {
+ $dir = sprintf $::cfg_tmpdir_name, int rand 10000;
+ } while (-e $dir);
+
+ if (!$::opt_simulate) {
+ if (!mkdir($dir, 0700)) {
+ warn "$::basename: ".quote($dir).": cannot create directory - $!\n";
+ return undef;
+ }
+ push @::rmdirs, $dir;
+ }
+ return $dir;
+}
+
+# explain($)
+# Print on screen if $::opt_explain is true.
+sub explain($) {
+ my ($msg) = @_;
+ print STDERR $msg if ($::opt_explain || $::opt_simulate);
+}
+
+# tailslash($)
+# If specified filename does not end with a slash,
+# add one and return the new filename.
+sub tailslash($) {
+ my ($file) = @_;
+ return ($file =~ /\/$/ ? $file : "$file/");
+}
+
+# shquotemeta($)
+# A more sophisticated quotemeta for bourne shells.
+# (This should be used for printing only.)
+sub shquotemeta($) {
+ my ($str) = @_;
+ $str =~ s/([^A-Za-z0-9_.+,\/:=@%^-])/\\$1/g;
+ return $str;
+}
+
+# multiarchivecmd(archive, outdir, mode, create, argref, cmdspec)
+# Execute a command for multi-file archives.
+# The `create' argument controls whether the archive
+# will be created (1) or just added to (0) if mode is "add".
+# If mode is 'extract', returns the directory (or only file)
+# which was extracted.
+# If needcwd is true, the outdir must be changed to.
+sub multiarchivecmd($$$$@) {
+ my ($archive, $outdir, $mode, $create, $needcwd, $argref, @cmd) = @_;
+ my @args = @{$argref};
+
+ if ($mode eq 'cat' && @args == 0) {
+ die "$::basename: missing file argument\n"; #OK
+ }
+
+ if ($mode eq 'add' && $create && !$::opt_force && (-e $archive || -l $archive)) {
+ warn "$::basename: ".quote($archive).": refusing to overwrite existing file\n";
+ return undef;
+ }
+
+ push @cmd, ['|'], get_pager_program() if $::opt_use_pager;
+
+ my $olddir = undef;
+ if ($needcwd && !$::opt_simulate) {
+ $olddir = getcwd();
+ if ($mode eq 'extract' && !chdir($outdir)) {
+ warn "$::basename: ".quote($outdir).": cannot change to - $!\n";
+ return undef;
+ }
+ if ($mode eq 'extract-to' && !chdir($::opt_cmd_extract_to)) {
+ warn "$::basename: ".quote($::opt_cmd_extract_to).": cannot change to - $!\n";
+ return undef;
+ }
+ }
+
+ if ($mode ne 'extract') {
+ cmdexec(0, @cmd) || return undef;
+ if (defined $olddir && !chdir($olddir)) {
+ warn "$::basename: ".quote($olddir).": cannot change to - $!\n";
+ return undef;
+ }
+ # XXX: can't save outdir with extract-to.
+ return 1;
+ }
+
+ if (!cmdexec(0, @cmd)) {
+ if (defined $olddir && !chdir($olddir)) {
+ warn "$::basename: ".quote($olddir).": cannot change to - $!\n";
+ }
+ return undef;
+ }
+
+ return undef if $::opt_simulate;
+
+ if (defined $olddir && !chdir($olddir)) {
+ warn "$::basename: ".quote($olddir).": cannot change to - $!\n";
+ return undef;
+ }
+
+ if (!opendir(DIR, $outdir)) {
+ warn "$::basename: ".quote($outdir).": cannot list - $!\n";
+ return undef;
+ }
+ my @files = grep !/^\.\.?$/, readdir DIR;
+ closedir DIR;
+
+ my $archivebase = File::Basename::basename($archive);
+ my $reason;
+ my $adddir = 0;
+ if (@files == 0) {
+ warn quote($archivebase).": archive is empty\n";
+ rmdir $outdir;
+ return undef;
+ } elsif ($::opt_extract_subdir) {
+ $reason = 'forced';
+ } elsif (@files == 1) {
+ my $fromfile = File::Spec->catfile($outdir, $files[0]);
+ if ($::opt_force || (!-l $files[0] && !-e $files[0])) {
+
+ # If the file is a directory, it can only be moved if writable
+ my $oldmode = undef;
+ if (!-l $fromfile && -d $fromfile) {
+ my @statinfo = stat($fromfile);
+ if (!@statinfo) {
+ warn quote($fromfile).": cannot get file info - $!\n";
+ return undef;
+ }
+ $oldmode = $statinfo[2];
+ if (!chmod(0700, $fromfile)) {
+ warn quote($fromfile).": cannot change mode - $!\n";
+ return undef;
+ }
+ }
+
+ if (!rename $fromfile, $files[0]) {
+ warn quote($fromfile).": cannot rename - $!\n";
+ return undef;
+ }
+ rmdir $outdir;
+
+ # If we changed mode previously, restore that mode now
+ if (defined $oldmode) {
+ if (!chmod($oldmode, $files[0])) {
+ warn quote($files[0]).": cannot change mode - $!\n";
+ return undef;
+ }
+ }
+
+ if ($::cfg_show_extracted) {
+ my $file = ($files[0] =~ /\// ? dirname($files[0]) : $files[0]);
+ warn quote($archivebase).": extracted to `".quote($file)."'\n" ;
+ }
+
+ save_outdir($files[0]);
+ return $files[0];
+ }
+ $reason = 'local file exists';
+ $adddir = 1 if (!-l $files[0] && -d $files[0]);
+ } else {
+ $reason = 'multiple files in root';
+ }
+
+ my $localoutdir = stripext($archivebase);
+ if (!-e $localoutdir) {
+ if (!rename $outdir, $localoutdir) {
+ warn quote($outdir).": cannot rename - $!\n";
+ return undef;
+ }
+ $outdir = $localoutdir;
+ }
+
+ warn quote($archivebase).": extracted to `".quote($outdir)."' ($reason)\n";
+ save_outdir($adddir ? File::Spec->catfile($outdir, $files[0]) : $outdir);
+ return $outdir;
+}
+
+# stripext(file)
+# Strip extension from the specified file.
+sub stripext($) {
+ my ($file) = @_;
+ return $file if ($file =~ s/(\.tar\.bz2|\.tbz2)$//);
+ return $file if ($file =~ s/(\.tar\.bz|\.tbz)$//);
+ return $file if ($file =~ s/(\.tar\.gz|\.tgz)$//);
+ return $file if ($file =~ s/(\.tar\.Z|\.tZ)$//);
+ return $file if ($file =~ s/\.tar$//);
+ return $file if ($file =~ s/\.bz2$//);
+ return $file if ($file =~ s/\.bz$//);
+ return $file if ($file =~ s/\.gz$//);
+ return $file if ($file =~ s/\.zip$//);
+ return $file if ($file =~ s/\.7z$//);
+ return $file if ($file =~ s/\.alz$//);
+ return $file if ($file =~ s/\.jar$//);
+ return $file if ($file =~ s/\.war$//);
+ return $file if ($file =~ s/\.Z$//);
+ return $file if ($file =~ s/\.rar$//);
+ return $file if ($file =~ s/\.(lha|lzh)$//);
+ return $file if ($file =~ s/\.ace$//);
+ return $file if ($file =~ s/\.arj$//);
+ return $file if ($file =~ s/\.a$//);
+ return $file if ($file =~ s/\.rpm$//);
+ return $file if ($file =~ s/\.deb$//);
+ return $file if ($file =~ s/\.cpio$//);
+ return $file if ($::cfg_strip_unknown_ext && $file =~ s/\.[^.]+$//);
+ return $file;
+}
+
+# formatext(format)
+# Return the usual extension for the specified file format
+sub formatext($) {
+ my ($format) = @_;
+ return '.tar.lzo' if $format eq 'tar+lzop';
+ return '.tar.bz2' if $format eq 'tar+bzip2';
+ return '.tar.bz' if $format eq 'tar+bzip';
+ return '.tar.gz' if $format eq 'tar+gzip';
+ return '.tar.Z' if $format eq 'tar+compress';
+ return '.tar' if $format eq 'tar';
+ return '.bz2' if $format eq 'bzip2';
+ return '.7z' if $format eq '7z';
+ return '.alz' if $format eq 'alzip';
+ return '.bz' if $format eq 'bzip';
+ return '.gz' if $format eq 'gzip';
+ return '.lzo' if $format eq 'lzop';
+ return '.zip' if $format eq 'zip';
+ return '.jar' if $format eq 'jar';
+ return '.Z' if $format eq 'compress';
+ return '.rar' if $format eq 'rar';
+ return '.ace' if $format eq 'ace';
+ return '.a' if $format eq 'ar';
+ return '.arj' if $format eq 'arj';
+ return '.lha' if $format eq 'lha';
+ return '.rpm' if $format eq 'rpm';
+ return '.deb' if $format eq 'deb';
+ return '.cpio' if $format eq 'cpio';
+ die "$::basename: ".quote($format).": don't know file extension for format\n";
+}
+
+# findformat(spec, manual)
+# Figure out format from specified file/string.
+# If manual is 0, spec is a filename, otherwise
+# it is a format description string.
+sub findformat($$) {
+ my ($file, $manual) = @_;
+ my $spec = lc $file;
+ my @fileoutput = (
+ ['tar+bzip2', qr/^(GNU|POSIX) tar archive \(bzip2 compressed data(\W|$)/],
+ ['tar+gzip', qr/^(GNU|POSIX) tar archive \(gzip compressed data(\W|$)/],
+ ['tar+bzip', qr/^(GNU|POSIX) tar archive \(bzip compressed data(\W|$)/],
+ ['tar+compress', qr/^(GNU|POSIX) tar archive \(compress'd data(\W|$)/],
+ ['tar', qr/^(GNU|POSIX) tar archive(\W|$)/],
+ ['zip', qr/^Zip archive data(\W|$)/],
+ ['rar', qr/^RAR archive data(\W|$)/],
+ ['lha', qr/^LHa \(2\.x\) archive data /],
+ ['lha', qr/^LHa 2\.x\? archive data /],
+ ['lha', qr/^LHarc 1\.x archive data /],
+ ['lha', qr/^MS-DOS executable .*, LHA's SFX$/],
+ ['7z', qr/^7z archive data, version .*$/],
+ ['ar', qr/^current ar archive(\W|$)/],
+ ['arj', qr/^ARJ archive data(\W|$)/],
+ ['arc', qr/^ARC archive data(\W|$)/],
+ ['cpio', qr/^cpio archive$/],
+ ['cpio', qr/^ASCII cpio archive /],
+ ['rpm', qr/^RPM v/],
+ ['deb', qr/^Debian binary package(\W|$)/],
+ ['bzip2', qr/ \(bzip2 compressed data(\W|$)/],
+ ['bzip', qr/ \(bzip compressed data(\W|$)/],
+ ['gzip', qr/ \(gzip compressed data(\W|$)/],
+ ['compress', qr/ \(compress'd data(\W|$)/],
+ ['lzop', qr/^lzop compressed data /],
+ #['bzip2', qr/^bzip2 compressed data(\W|$)/],
+ #['bzip', qr/^bzip compressed data(\W|$)/],
+ #['gzip', qr/^gzip compressed data(\W|$)/],
+ #['compress', qr/^compress'd data(\W|$)/],
+ );
+ my @fileextensions = (
+ ['tar+bzip', qr/(\.tar\.bz|\.tbz)$/],
+ ['tar+bzip2', qr/(\.tar\.bz2|\.tbz2)$/],
+ ['tar+compress', qr/(\.tar\.[zZ]|\.t[zZ])$/],
+ ['tar+gzip', qr/(\.tar\.gz|\.tgz)$/],
+ ['tar+lzop', qr/(\.tar\.lzo|\.tzo)$/],
+ ['7z', qr/\.7z$/],
+ ['alzip', qr/\.alz$/],
+ ['arc', qr/\.arc$/],
+ ['ace', qr/\.ace$/],
+ ['arj', qr/\.arj$/],
+ ['bzip', qr/\.bz$/],
+ ['bzip2', qr/\.bz2$/],
+ ['compress', qr/\.[zZ]$/],
+ ['cpio', qr/\.cpio$/],
+ ['gzip', qr/\.gz$/],
+ ['jar', qr/\.(jar|war)$/],
+ ['lha', qr/\.(lha|lzh)$/],
+ ['lzop', qr/\.lzo$/],
+ ['rar', qr/\.rar$/],
+ ['rpm', qr/\.rpm$/],
+ ['deb', qr/\.deb$/],
+ ['tar', qr/\.tar$/],
+ ['zip', qr/\.zip$/],
+ ['ar', qr/\.a$/],
+ );
+
+ if ($manual) {
+ $spec =~ tr/+/./;
+ $spec =~ s/^\.*/\./;
+ $spec =~ s/lzop/lzo/;
+ $spec =~ s/bzip2/bz2/;
+ $spec =~ s/bzip/bz/;
+ $spec =~ s/gzip/gz/;
+ $spec =~ s/7zip/7z/;
+ $spec =~ s/alzip/alz/;
+ $spec =~ s/compress/Z/;
+ $spec =~ s/^ar$/a/;
+ }
+ foreach my $formatinfo (@fileextensions) {
+ my ($format, $regex) = @{$formatinfo};
+ return $format if ($spec =~ $regex);
+ }
+
+ if (!$manual && $::cfg_use_file) {
+ if (!-e $file) {
+ warn "$::basename: ".quote($file).": no such file and cannot identify format from extension\n";
+ return;
+ }
+ if (!sysopen(TMP, $file, O_RDONLY)) {
+ warn "$::basename: ".quote($file).": cannot open - $!\n";
+ return;
+ }
+ close TMP;
+ if (!-f $file) {
+ warn "$::basename: ".quote($file).": not a regular file\n";
+ return;
+ }
+ if ($::opt_verbosity >= 1) {
+ warn "$::basename: ".quote($file).": format not known, identifying using file\n";
+ }
+ my @cmd = ($::cfg_path_file, '-b', '-L', '-z', '--', $file);
+ $spec = backticks(@cmd);
+ if (!defined $spec) {
+ warn "$::basename: $::errmsg\n";
+ return;
+ }
+ if ($? & 0xFF != 0) {
+ warn "$::basename: ".quote($::cfg_path_file).": abnormal exit\n";
+ return;
+ }
+ if ($? >> 8 != 0) {
+ warn "$::basename: ".quote($file).": unknown file format\n";
+ return;
+ }
+ chomp $spec;
+ foreach my $formatinfo (@fileoutput) {
+ my ($format, $regex) = @{$formatinfo};
+ if ($spec =~ $regex) {
+ warn "$::basename: ".quote($file).": format is `$format'\n" if $::opt_verbosity >= 1;
+ return $format;
+ }
+ }
+ warn "$::basename: ".quote($file).": unsupported file format `$spec'\n";
+ return;
+ }
+ warn "$::basename: ".quote($file).": unrecognized file format\n";
+ return;
+}
+
+# backticks(cmdargs, ..)
+# An implementation of the backtick (qx//) operator.
+# The difference is that command STDERR output will still
+# be printed on STDERR, and the shell isn't used to parse
+# the command line.
+sub backticks(@) {
+ if (!pipe(IN,OUT)) {
+ $::errmsg = "pipe failed - $!";
+ return;
+ }
+ my $child = fork;
+ if (!defined $child) {
+ $::errmsg = "fork failed - $!";
+ return;
+ }
+ if ($child == 0) {
+ close IN || exit 1;
+ close STDOUT || exit 1;
+ open(STDOUT, '>&OUT') || exit 1;
+ close OUT || exit 1;
+ $SIG{__WARN__} = sub {};
+ exec(@_) || exit 1;
+ }
+ close OUT;
+ my $text = join('', <IN>);
+ close IN;
+ if (waitpid($child,0) != $child) {
+ $::errmsg = "waitpid failed - $!";
+ return;
+ }
+ return $text;
+}
+
+# readconfig(file)
+# Read and parse the specified configuration file.
+# If the file does not exist, just return.
+# If there is an error in the configuration file,
+# the program will be terminated. This could be a
+# problem when there are errors in the system-wide
+# configuration file.
+sub readconfig($$) {
+ my ($file, $failok) = @_;
+ my %optionmap = (
+ 'args_diff' => \$::cfg_args_diff,
+ 'default_verbosity' => \$::cfg_default_verbosity,
+ 'keep_compressed' => \$::cfg_keep_compressed,
+ 'decompress_to_cwd' => \$::cfg_decompress_to_cwd,
+ 'path_7z' => \$::cfg_path_7z,
+ 'path_ar' => \$::cfg_path_ar,
+ 'path_arc' => \$::cfg_path_arc,
+ 'path_arj' => \$::cfg_path_arj,
+ 'path_bzip' => \$::cfg_path_bzip,
+ 'path_bzip2' => \$::cfg_path_bzip2,
+ 'path_cat' => \$::cfg_path_cat,
+ 'path_compress' => \$::cfg_path_compress,
+ 'path_cpio' => \$::cfg_path_cpio,
+ 'path_diff' => \$::cfg_path_diff,
+ 'path_file' => \$::cfg_path_file,
+ 'path_find' => \$::cfg_path_find,
+ 'path_gzip' => \$::cfg_path_gzip,
+ 'path_jar' => \$::cfg_path_jar,
+ 'path_lha' => \$::cfg_path_lha,
+ 'path_lzop' => \$::cfg_path_lzop,
+ 'path_nomarch' => \$::cfg_path_nomarch,
+ 'path_pager' => \$::cfg_path_pager,
+ 'path_rar' => \$::cfg_path_rar,
+ 'path_rpm' => \$::cfg_path_rpm,
+ 'path_rpm2cpio' => \$::cfg_path_rpm2cpio,
+ 'path_dpkg_deb' => \$::cfg_path_dpkg_deb,
+ 'path_tar' => \$::cfg_path_tar,
+ 'path_unace' => \$::cfg_path_unace,
+ 'path_unalz' => \$::cfg_path_unalz,
+ 'path_unarj' => \$::cfg_path_unarj,
+ 'path_unrar' => \$::cfg_path_unrar,
+ 'path_unzip' => \$::cfg_path_unzip,
+ 'path_usercfg' => \$::cfg_path_usercfg,
+ 'path_xargs' => \$::cfg_path_xargs,
+ 'path_zip' => \$::cfg_path_zip,
+ 'show_extracted' => \$::cfg_show_extracted,
+ 'strip_unknown_ext' => \$::cfg_strip_unknown_ext,
+ 'tmpdir_name' => \$::cfg_tmpdir_name,
+ 'use_arc_for_unpack' => \$::cfg_use_arc_for_unpack,
+ 'use_arj_for_unpack' => \$::cfg_use_arc_for_unpack,
+ 'use_file' => \$::cfg_use_file,
+ 'use_find_cpio_print0' => \$::cfg_use_find_cpio_print0,
+ 'use_gzip_for_z' => \$::cfg_use_gzip_for_z,
+ 'use_jar' => \$::cfg_use_jar,
+ 'use_rar_for_unpack' => \$::cfg_use_rar_for_unpack,
+ 'use_rar_for_unrar' => [ 'use_rar_for_unpack', \$::cfg_use_rar_for_unpack ],
+ 'use_tar_bzip2_option' => \$::cfg_use_tar_bzip2_option,
+ 'use_tar_j_option' => [ 'use_tar_bzip2_option', \$::cfg_use_tar_bzip2_option ],
+ 'use_tar_z_option' => \$::cfg_use_tar_z_option,
+ );
+ return if ($failok && !-e $file);
+ sysopen(FILE, $file, O_RDONLY) || die "$::basename: ".quote($file).": cannot open for reading - $!\n"; #OK
+ while (<FILE>) {
+ chomp;
+ next if /^\s*(#(.*))?$/;
+ my ($var,$val) = /^(.*?)\s+([^\s].*)$/;
+ my $varref = undef;
+ if (exists $optionmap{$var}) {
+ if (ref $optionmap{$var} eq 'ARRAY') {
+ my ($newopt,$newref) = @{$optionmap{$var}};
+ warn quote($file).": $var is obsolete (use $newopt)\n";
+ ${$newref} = $val;
+ } else {
+ ${$optionmap{$var}} = $val;
+ }
+ }
+ else {
+ die "$::basename: ".quote($file).":$.: unrecognized directive\n";
+ }
+ }
+ close(FILE);
+}
+
+# Remove a directory recursively. This function used to change
+# the mode on the directories is traverses, but I now consider
+# that to be unsafe (what if there's a bug in @PACKAGE_NAME@ and it
+# removes a file it shouldn't?).
+sub unlink_directory($) {
+ my ($dir) = @_;
+ die "$::basename: internal error 1 - please report this bug\n"
+ if ($dir eq '/' || $dir eq $ENV{HOME});
+# chmod 0700, $dir || die "$::basename: cannot chmod `".quote($dir)."': $!\n";
+ chdir $dir || die "$::basename: ".quote($dir).": cannot change to - $!\n";
+ opendir(DIR, $::cur) || die "$::basename: ".quote($dir).": cannot list - $!\n";
+ my @files = readdir(DIR);
+ closedir(DIR);
+ foreach my $file (@files) {
+ next if $file eq $::cur || $file eq $::up;
+ if (!-d $file) {
+ unlink $file || die "$::basename: ".quote($file).": cannot remove - $!\n";
+ } else {
+ unlink_directory($file);
+ }
+ }
+ chdir $::up || die "$::basename: $::up: cannot change to - $!\n";
+ rmdir $dir || die "$::basename: ".quote($dir).": cannot remove - $!\n";
+}
+
+# find_comparable_file(dir)
+# Assuming that the contents of some archive has been extracted to dir,
+# this function will determine the main file or directory in this
+# archive - the file or directory which will be compared when this
+# archive is compared to some other.
+sub find_comparable_file($) {
+ my ($dir) = @_;
+ my $result = $dir;
+ if (opendir(DIR, $dir)) {
+ my (@files) = map { readdir(DIR) } 0..3;
+ if (@files == 3 && $files[0] eq $::cur && $files[1] eq $::up) {
+ $result = File::Spec->catfile($dir, $files[2]);
+ }
+ closedir(DIR);
+ }
+ return $result;
+}
+
+# makeabsolute(file)
+# Return the absolute version of file.
+sub makeabsolute($) {
+ my ($file) = @_;
+ return $file if (substr($file, 0, 1) eq '/');
+ return File::Spec->catfile(getcwd(), $file);
+}
+
+# quote(string)
+# Quote a style like the GNU fileutils would do (`locale'
+# quoting style).
+sub quote($) {
+ my ($in) = @_;
+ my $out = '';
+ for (my $c = 0; $c < length($in); $c++) {
+ my $ch = substr($in, $c, 1);
+ if ($ch eq "\b") {
+ $out .= "\\b";
+ } elsif ($ch eq "\f") {
+ $out .= "\\f";
+ } elsif ($ch eq "\n") {
+ $out .= "\\n";
+ } elsif ($ch eq "\r") {
+ $out .= "\\r";
+ } elsif ($ch eq "\t") {
+ $out .= "\\t";
+ } elsif (ord($ch) == 11) { # Vertical Tab, \v
+ $out .= "\\v";
+ } elsif ($ch eq "\\") {
+ $out .= "\\\\";
+ } elsif ($ch eq "'") {
+ $out .= "\\'";
+ } elsif (!POSIX::isprint($ch)) {
+ $out .= sprintf('\\%03o', ord($ch));
+ } else {
+ $out .= $ch;
+ }
+ }
+ return $out;
+}
+
+# shell_execute(@)
+# Execute a command with pipes and output redirection like the
+# shell does. Only difference is we do it without the shell.
+# This reason for this is because we don't have to quote
+# meta-characters - some meta-characters like LF and DEL are
+# unquotable!
+sub shell_execute(@) {
+ my (@cmdspec) = @_;
+
+ my @cmds = ();
+ my $start = 0;
+ my $redir_out = undef;
+ for (my $c = 0; $c < @cmdspec; $c++) {
+ if (ref $cmdspec[$c]) {
+ push @cmds, [ @cmdspec[$start..$c-1] ];
+ $start = $c+1;
+ $redir_out = $cmdspec[$c+1] if (${$cmdspec[$c]}[0] eq '>');
+ }
+ }
+ push @cmds, [ @cmdspec[$start..$#cmdspec] ] if !defined $redir_out;
+
+ $SIG{INT} = 'IGNORE';
+
+ my @ip = ();
+ my @op = ();
+ my @children = ();
+ for (my $c = 0; $c <= $#cmds; $c++) {
+ if ($c != $#cmds) {
+ @op = reverse POSIX::pipe();
+ if (!@op || !defined $op[0] || !defined $op[1]) {
+ $::errmsg = "pipe failed - $!";
+ return 0;
+ }
+ }
+ if ($c == $#cmds && defined $redir_out) {
+ @_ = (); # XXX: necessary to overcome POSIX autoload bug!
+ @op = (POSIX::open($redir_out, &POSIX::O_WRONLY | &POSIX::O_CREAT));
+ if (!@op || !defined $op[0]) {
+ $::errmsg = quote($redir_out).": cannot open for writing - $!";
+ return 0;
+ }
+ }
+ my $pid = fork();
+ die "fork failed - $!\n" if !defined $pid;
+ if ($pid == 0) {
+ $SIG{INT} = '';
+ if (@ip) {
+ die "dup2 failed - $!\n" if POSIX::dup2($ip[1], 0) < 0;
+ POSIX::close($_) foreach (@ip);
+ }
+ if (@op) {
+ die "dup2 failed - $!\n" if POSIX::dup2($op[0], 1) < 0;
+ POSIX::close($_) foreach (@op);
+ }
+ exec(@{$cmds[$c]}) || die ${$cmds[$c]}[0].": cannot execute - $!\n";
+ }
+ POSIX::close($op[0]) if ($c == $#cmds && defined $redir_out);
+ POSIX::close($_) foreach (@ip);
+ @ip = @op;
+ @op = ();
+ push @children, $pid;
+ }
+
+ foreach (@children) {
+ if (waitpid($_,0) < 0) {
+ $::errmsg = "waitpid failed - $!";
+ return 0;
+ }
+ }
+ $SIG{INT} = '';
+
+ return 1;
+}
+
+# Write dir to file indicated by $::opt_save_outdir.
+#
+sub save_outdir($) {
+ my ($dir) = @_;
+ if (defined $::opt_save_outdir && !-l $dir && -d $dir) {
+ if (!sysopen(TMP, $::opt_save_outdir, O_WRONLY)) {
+ warn die "$::basename: ".quote($::opt_save_outdir).": cannot open for writing - $!\n";
+ } else {
+ print TMP $dir, "\n";
+ close(TMP);
+ }
+ }
+}
+
+# Somewhat stupid subroutine to add xargs to the command line.
+#
+sub handle_empty_add(@) {
+ my @cmd = @_;
+ unshift @cmd, '--';
+ unshift @cmd, '-0' if ($::opt_null);
+ unshift @cmd, $::cfg_path_xargs;
+ return @cmd;
+}
+
+# Return a suitable pager command
+#
+sub get_pager_program {
+ return $ENV{PAGER} if (exists $ENV{PAGER});
+ return $::cfg_path_pager;
+}
+
+sub END {
+ map (rmdir, @::rmdirs) if !$::opt_simulate; # Errors are ignored
+}
--- /dev/null
+%define package @PACKAGE_TARNAME@
+%define version @PACKAGE_VERSION@
+%define release 1
+
+Summary: A script for managing file archives of various types.
+Name: %{package}
+Version: %{version}
+Release: %{release}
+License: GPL
+Group: Applications/Archiving
+Source: http://savannah.nongnu.org/download/%{package}/%{package}-%{version}.tar.gz
+URL: http://www.nongnu.org/%{package}/
+Packager: Oskar Liljeblad <
[email protected]>
+Vendor: Oskar Liljeblad <
[email protected]>
+BuildRoot: %{_tmppath}/%{package}-%{version}-%{release}-root
+BuildArch: noarch
+Requires: perl
+
+%description
+atool is a script for managing file archives of various types (tar,
+tar+gzip, zip etc).
+
+The main command is aunpack which extracts files from an archive. Did you
+ever extract files from an archive, not checking whether the files were
+located in a subdirectory or in the top directory of the archive, resulting
+in files scattered all over the place? aunpack overcomes this problem by
+first extracting to a new directory, and if there was only a single file in
+the archive, moving that file to the original directory. aunpack also
+prevents local files from being overwritten by mistake.
+
+The other commands provided are apack (to create archives), als (to list
+files in archives), and acat (to extract files to standard out).
+
+%prep
+%setup -q
+
+%build
+./configure --prefix=%{_prefix}
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%doc README ChangeLog COPYING NEWS TODO
+%{_prefix}/bin/*
+%{_prefix}/man/man1/*
--- /dev/null
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59 for atool 0.30.0.
+#
+# Report bugs to <
[email protected]>.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='atool'
+PACKAGE_TARNAME='atool'
+PACKAGE_VERSION='0.30.0'
+PACKAGE_STRING='atool 0.30.0'
+PACKAGE_BUGREPORT='
[email protected]'
+
+ac_unique_file="atool.in"
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PERL LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures atool 0.30.0 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of atool 0.30.0:";;
+ esac
+ cat <<\_ACEOF
+
+Report bugs to <
[email protected]>.
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd "$ac_popdir"
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+atool configure 0.30.0
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by atool $as_me 0.30.0, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_prog in perl perl5
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PERL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $PERL in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+
+if test -n "$PERL"; then
+ echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$PERL" && break
+done
+
+
+ ac_config_files="$ac_config_files atool atool.1 atool.spec Makefile"
+
+ ac_config_commands="$ac_config_commands acat-link"
+
+ ac_config_commands="$ac_config_commands adiff-link"
+
+ ac_config_commands="$ac_config_commands als-link"
+
+ ac_config_commands="$ac_config_commands apack-link"
+
+ ac_config_commands="$ac_config_commands aunpack-link"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g
+t quote
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[ `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output. A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by atool $as_me 0.30.0, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Configuration commands:
+$config_commands
+
+Report bugs to <
[email protected]>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+atool config.status 0.30.0
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "atool" ) CONFIG_FILES="$CONFIG_FILES atool" ;;
+ "atool.1" ) CONFIG_FILES="$CONFIG_FILES atool.1" ;;
+ "atool.spec" ) CONFIG_FILES="$CONFIG_FILES atool.spec" ;;
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "acat-link" ) CONFIG_COMMANDS="$CONFIG_COMMANDS acat-link" ;;
+ "adiff-link" ) CONFIG_COMMANDS="$CONFIG_COMMANDS adiff-link" ;;
+ "als-link" ) CONFIG_COMMANDS="$CONFIG_COMMANDS als-link" ;;
+ "apack-link" ) CONFIG_COMMANDS="$CONFIG_COMMANDS apack-link" ;;
+ "aunpack-link" ) CONFIG_COMMANDS="$CONFIG_COMMANDS aunpack-link" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@PERL@,$PERL,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+ # Run the commands associated with the file.
+ case $ac_file in
+ atool ) chmod a+x atool ;;
+ atool.1 ) chmod a+x atool ;;
+ atool.spec ) chmod a+x atool ;;
+ Makefile ) chmod a+x atool ;;
+ esac
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ acat-link ) ln -f -s atool acat ;;
+ adiff-link ) ln -f -s atool adiff ;;
+ als-link ) ln -f -s atool als ;;
+ apack-link ) ln -f -s atool apack ;;
+ aunpack-link ) ln -f -s atool aunpack ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
--- /dev/null
+AC_INIT(atool, 0.30.0,
[email protected])
+AC_PATH_PROGS(PERL, perl perl5)
+AC_CONFIG_SRCDIR(atool.in)
+AC_CONFIG_FILES([atool atool.1 atool.spec Makefile], [chmod a+x atool])
+AC_CONFIG_COMMANDS([acat-link], [ln -f -s atool acat])
+AC_CONFIG_COMMANDS([adiff-link], [ln -f -s atool adiff])
+AC_CONFIG_COMMANDS([als-link], [ln -f -s atool als])
+AC_CONFIG_COMMANDS([apack-link], [ln -f -s atool apack])
+AC_CONFIG_COMMANDS([aunpack-link], [ln -f -s atool aunpack])
+AC_OUTPUT
--- /dev/null
+atool (0.30.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Mon, 25 Jul 2005 09:02:05 +0200
+
+atool (0.29.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Mon, 5 Jul 2004 20:15:17 +0200
+
+atool (0.28.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Fri, 18 Jun 2004 16:30:25 +0200
+
+atool (0.27.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Fri, 14 Nov 2003 17:17:51 +0100
+
+atool (0.26.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Fri, 23 May 2003 15:57:07 +0200
+
+atool (0.25.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Fri, 8 Nov 2002 18:02:04 +0100
+
+atool (0.24.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Wed, 9 Oct 2002 12:21:02 +0200
+
+atool (0.23.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Sat, 28 Sep 2002 14:35:52 +0200
+
+atool (0.22.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Tue, 17 Sep 2002 22:11:00 +0200
+
+atool (0.21.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Mon, 16 Sep 2002 14:10:41 +0200
+
+atool (0.20.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Sun, 8 Sep 2002 11:42:00 +0200
+
+atool (0.19.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Sat, 13 Jul 2002 19:47:59 +0200
+
+atool (0.18.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Tue, 2 Jul 2002 21:33:19 +0200
+
+atool (0.17.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Sun, 14 Apr 2002 23:54:41 +0200
+
+atool (0.16.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Sat, 9 Feb 2002 12:47:02 +0100
+
+atool (0.15.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Sat, 22 Dec 2001 12:28:06 +0100
+
+atool (0.14.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Sat, 17 Nov 2001 17:08:36 +0100
+
+atool (0.13.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Fri, 26 Oct 2001 10:37:38 +0200
+
+atool (0.12.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Mon, 18 Sep 2001 17:43:05 +0200
+
+atool (0.11.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Mon, 13 Aug 2001 23:06:17 +0200
+
+atool (0.10.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Wed, 1 Aug 2001 10:36:57 +0200
+
+atool (0.9.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Thu, 5 Jul 2001 15:10:00 +0200
+
+atool (0.8.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Thu, 5 Jul 2001 15:10:00 +0200
+
+atool (0.7.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Mon, 16 Apr 2001 13:36:00 +0200
+
+atool (0.6.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Wed, 4 Apr 2001 14:10:00 +0200
+
+atool (0.5.0-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Oskar Liljeblad <
[email protected]> Wed, 28 Mar 2001 08:12:00 +0200
+
+atool (0.4.0-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Oskar Liljeblad <
[email protected]> Tue, 27 Mar 2001 13:01:18 +0200
+
+Local variables:
+mode: debian-changelog
+End:
--- /dev/null
+Source: atool
+Section: utils
+Priority: optional
+Maintainer: Oskar Liljeblad <
[email protected]>
+Build-Depends: cdbs, debhelper (>> 4.1.0)
+Standards-Version: 3.6.1.1
+
+Package: atool
+Architecture: all
+Depends: ${perl:Depends}
+Suggests: tar, unzip, bzip, bzip2, gzip, fastjar, lzop
+Description: A script for managing file archives of various types
+ atool is a script for managing file archives of various types (tar,
+ tar+gzip, zip etc).
+ .
+ The main command is aunpack which extracts files from an archive. Did you
+ ever extract files from an archive, not checking whether the files were
+ located in a subdirectory or in the top directory of the archive, resulting
+ in files scattered all over the place? aunpack overcomes this problem by
+ first extracting to a new directory. If there was only a single file in the
+ archive, that file is moved to the original directory. aunpack also
+ prevents local files from being overwritten by mistake.
+ .
+ The other commands provided are apack (to create archives), als (to list
+ files in archives), and acat (to extract files to standard out). As atool
+ invokes external programs to handle the archives, not all commands may be
+ supported for a certain type of archives.
--- /dev/null
+This package was debianized by Oskar Liljeblad <
[email protected]> on
+Tue, 27 Mar 2001 13:01:18 +0200.
+
+The source code can be obtained from http://www.nongnu.org/atool/.
+
+Upstream Author(s): Oskar Liljeblad <
[email protected]>
+
+Copyright:
+
+atool is Copyright (C) 2001, 2002, 2003, 2004, 2005 Oskar Liljeblad
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
--- /dev/null
+#! /usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk