From e66925ff9c2fca5df2b0a3e38dfbdc03e0cb9a12 Mon Sep 17 00:00:00 2001 From: jankratochvil <> Date: Thu, 26 Jan 2006 21:18:11 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create tag 'captive-1_1_7'. Sprout from master 2006-01-26 21:18:10 UTC lace 'Release: 1.1.7' Cherrypick from captive 2003-12-11 20:50:00 UTC short 'Workarounded cabextract memory leaks by captive memory tracker object.': src/install/acquire/cabextract/.vimrc src/install/acquire/cabextract/cabextract.c src/install/acquire/cabextract/cabextract.h Delete: src/install/acquire/cabextract/AUTHORS src/install/acquire/cabextract/COPYING src/install/acquire/cabextract/ChangeLog src/install/acquire/cabextract/INSTALL src/install/acquire/cabextract/Makefile.am src/install/acquire/cabextract/Makefile.in src/install/acquire/cabextract/NEWS src/install/acquire/cabextract/README src/install/acquire/cabextract/TODO src/install/acquire/cabextract/aclocal.m4 src/install/acquire/cabextract/cabextract.1 src/install/acquire/cabextract/cabextract.spec src/install/acquire/cabextract/cabextract.spec.in src/install/acquire/cabextract/cabinfo.c src/install/acquire/cabextract/config.h.in src/install/acquire/cabextract/configure src/install/acquire/cabextract/configure.in src/install/acquire/cabextract/debian/README.Debian src/install/acquire/cabextract/debian/changelog src/install/acquire/cabextract/debian/control src/install/acquire/cabextract/debian/copyright src/install/acquire/cabextract/debian/dirs src/install/acquire/cabextract/debian/docs src/install/acquire/cabextract/debian/rules src/install/acquire/cabextract/getopt.c src/install/acquire/cabextract/getopt.h src/install/acquire/cabextract/getopt1.c src/install/acquire/cabextract/install-sh src/install/acquire/cabextract/ja/cabextract.1 src/install/acquire/cabextract/magic.cabinet src/install/acquire/cabextract/missing src/install/acquire/cabextract/mkinstalldirs src/install/acquire/cabextract/mktime.c src/install/acquire/cabextract/stamp-h.in --- src/install/acquire/cabextract/.vimrc | 2 + src/install/acquire/cabextract/AUTHORS | 13 - src/install/acquire/cabextract/COPYING | 340 --- src/install/acquire/cabextract/ChangeLog | 261 --- src/install/acquire/cabextract/INSTALL | 182 -- src/install/acquire/cabextract/Makefile.am | 10 - src/install/acquire/cabextract/Makefile.in | 403 ---- src/install/acquire/cabextract/NEWS | 69 - src/install/acquire/cabextract/README | 32 - src/install/acquire/cabextract/TODO | 1 - src/install/acquire/cabextract/aclocal.m4 | 127 -- src/install/acquire/cabextract/cabextract.1 | 60 - src/install/acquire/cabextract/cabextract.c | 374 ++-- src/install/acquire/cabextract/cabextract.h | 69 + src/install/acquire/cabextract/cabextract.spec | 35 - src/install/acquire/cabextract/cabextract.spec.in | 35 - src/install/acquire/cabextract/cabinfo.c | 497 ----- src/install/acquire/cabextract/config.h.in | 89 - src/install/acquire/cabextract/configure | 2302 -------------------- src/install/acquire/cabextract/configure.in | 34 - .../acquire/cabextract/debian/README.Debian | 6 - src/install/acquire/cabextract/debian/changelog | 45 - src/install/acquire/cabextract/debian/control | 14 - src/install/acquire/cabextract/debian/copyright | 13 - src/install/acquire/cabextract/debian/dirs | 5 - src/install/acquire/cabextract/debian/docs | 3 - src/install/acquire/cabextract/debian/rules | 83 - src/install/acquire/cabextract/getopt.c | 1055 --------- src/install/acquire/cabextract/getopt.h | 169 -- src/install/acquire/cabextract/getopt1.c | 188 -- src/install/acquire/cabextract/install-sh | 251 --- src/install/acquire/cabextract/ja/cabextract.1 | 70 - src/install/acquire/cabextract/magic.cabinet | 6 - src/install/acquire/cabextract/missing | 198 -- src/install/acquire/cabextract/mkinstalldirs | 40 - src/install/acquire/cabextract/mktime.c | 541 ----- src/install/acquire/cabextract/stamp-h.in | 1 - 37 files changed, 277 insertions(+), 7346 deletions(-) create mode 100644 src/install/acquire/cabextract/.vimrc delete mode 100644 src/install/acquire/cabextract/AUTHORS delete mode 100644 src/install/acquire/cabextract/COPYING delete mode 100644 src/install/acquire/cabextract/ChangeLog delete mode 100644 src/install/acquire/cabextract/INSTALL delete mode 100644 src/install/acquire/cabextract/Makefile.am delete mode 100644 src/install/acquire/cabextract/Makefile.in delete mode 100644 src/install/acquire/cabextract/NEWS delete mode 100644 src/install/acquire/cabextract/README delete mode 100644 src/install/acquire/cabextract/TODO delete mode 100644 src/install/acquire/cabextract/aclocal.m4 delete mode 100644 src/install/acquire/cabextract/cabextract.1 create mode 100644 src/install/acquire/cabextract/cabextract.h delete mode 100644 src/install/acquire/cabextract/cabextract.spec delete mode 100644 src/install/acquire/cabextract/cabextract.spec.in delete mode 100644 src/install/acquire/cabextract/cabinfo.c delete mode 100644 src/install/acquire/cabextract/config.h.in delete mode 100755 src/install/acquire/cabextract/configure delete mode 100644 src/install/acquire/cabextract/configure.in delete mode 100644 src/install/acquire/cabextract/debian/README.Debian delete mode 100644 src/install/acquire/cabextract/debian/changelog delete mode 100644 src/install/acquire/cabextract/debian/control delete mode 100644 src/install/acquire/cabextract/debian/copyright delete mode 100644 src/install/acquire/cabextract/debian/dirs delete mode 100644 src/install/acquire/cabextract/debian/docs delete mode 100755 src/install/acquire/cabextract/debian/rules delete mode 100644 src/install/acquire/cabextract/getopt.c delete mode 100644 src/install/acquire/cabextract/getopt.h delete mode 100644 src/install/acquire/cabextract/getopt1.c delete mode 100755 src/install/acquire/cabextract/install-sh delete mode 100644 src/install/acquire/cabextract/ja/cabextract.1 delete mode 100644 src/install/acquire/cabextract/magic.cabinet delete mode 100755 src/install/acquire/cabextract/missing delete mode 100755 src/install/acquire/cabextract/mkinstalldirs delete mode 100644 src/install/acquire/cabextract/mktime.c delete mode 100644 src/install/acquire/cabextract/stamp-h.in diff --git a/src/install/acquire/cabextract/.vimrc b/src/install/acquire/cabextract/.vimrc new file mode 100644 index 0000000..6751a10 --- /dev/null +++ b/src/install/acquire/cabextract/.vimrc @@ -0,0 +1,2 @@ +set ts=8 +set sw=2 diff --git a/src/install/acquire/cabextract/AUTHORS b/src/install/acquire/cabextract/AUTHORS deleted file mode 100644 index c8e908c..0000000 --- a/src/install/acquire/cabextract/AUTHORS +++ /dev/null @@ -1,13 +0,0 @@ -Principal author: Stuart Caie - -Based on specification documents from Microsoft Corporation -Quantum decompression researched and implemented by Matthew Russoto -Huffman code adapted from unlzx by Dave Tritscher. -InfoZip team's INFLATE implementation adapted to MSZIP by Dirk Stoecker. -Major LZX fixes by Jae Jung. -Japanese manual page by Katsumi Saito. -Manual page and Debian packaging by Eric Sharkey. -FreeBSD packaging by Maxim Sovolev. -NetBSD packaging by Ben Collver et al. -SuSE packaging by Stefan Dirsch -RPM spec file by Soos Peter. diff --git a/src/install/acquire/cabextract/COPYING b/src/install/acquire/cabextract/COPYING deleted file mode 100644 index d60c31a..0000000 --- a/src/install/acquire/cabextract/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 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. - - 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.) - -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. - - 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. - - 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 - - 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. - - - Copyright (C) - - 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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. - - , 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. diff --git a/src/install/acquire/cabextract/ChangeLog b/src/install/acquire/cabextract/ChangeLog deleted file mode 100644 index 02c316c..0000000 --- a/src/install/acquire/cabextract/ChangeLog +++ /dev/null @@ -1,261 +0,0 @@ -2002-08-12 Stuart Caie - - * cabextract.c: now prints all errors and warnings to stderr - rather that stdout. I finally noticed that perror() prints to - stderr, and I want to follow suit. - -2002-08-11 Stuart Caie - - * extract_file(): now prints out the correct cabinet name in error - messages, in the case of files which are split over multiple - cabinet files and the 2nd or later split cabinet contains the - error. - - * QTMdecompress(): fixed the QTM decoding error - basically, Matthew - used the bitstream reading macros from my LZX decompressor. Sadly, - these macros can only guarantee at maximum 17 bits available in the - bit buffer, and Quantum uses up to 19 bits. I rewrote the Quantum - bit buffer macros to be multi-pass (and therefore slower) so they - can get the requisite number of bits. - - * QTMinit(): after fixing the decoding bug, I noticed that files - always failed extraction when going to a second folder. It turns out - - * configure.in: added limits.h to the list of checked includes - - * cabextract.c: ULONG_BITS now defined in terms of CHAR_BIT from - rather than fixed to 8 bits per char. Oddly, my system - seems to include rather than . So, for - people like me, I also define CHAR_BIT to be 8 if it's not already - defined. - -2002-07-29 Stuart Caie - - * cabextract.c: The Ministry of Sensible Naming dictates that - load_cab() be renamed find_cabs_in_file(), and lose the 'search' - argument. Calls to load_cab() where the search argument = 0 (i.e., - when loading spanning cabinets) be changed to load_cab_offset(x,0). - -2002-07-25 Stuart Caie - - * load_cab(): Bah! off_t is defined as a signed long int, and - not an unsigned long int as I had previously thought. This means the - 'valid cabinet' comparisions may fail. I have fixed this by making - these comparisons unsigned. - - * cabinfo.c: added the new search mechanism to cabinfo. - -2002-07-25 Stuart Caie - - * process_cabinet(): rewrote the loading mechanism. Uses the new - load_cab() to get a list of cabinets in the base file. Also does - bi-directional loading of spanning cabinets. - - * load_cab(): now takes a 'search' parameter. if search=0, the old - loading behaviour is performed, but if search=1, it now does the - exhaustive search for all matching cabinets and tries to load - them. If a load succeeds, it skips that section of the - file. Therefore, all embedded cabinets are found, yet most of the - file does not need to be searched. - - * cabinet_find_header(): removed, see above. Also, in shifting the - search, I altered the search mechanism. It now uses a state - machine to get around border cases, rather than the flaky 'save - the last 20 bytes and put them at the start the next time around'. - - * cabinet_read_entries(): now checks the MSCF signature, as there - is no longer a cabinet_find_header() to do this. - -2002-07-23 Stuart Caie - - * LZXdecompress(), QTMdecompress(): On systems where the LZ window - pointer is in "low memory", runsrc (window pointer - match offset) - could be below address 0, which wraps around to the end of memory, - so it appears runsrc is ahead of the LZ window, and so it does not - need 'fixing' before the match copy. Therefore the match data is - read from the incorrect, high address. Thanks to the NetBSD team - for discovering this and providing the patch. - -2002-07-22 Stuart Caie - - * file_close(): now honours your umask settings when extracting - files. Thanks to the NetBSD team for the patch. - - * cabinet_seek(), cabinet_skip(): these now print errors if - fseek() returns an error. - - * QTMdecompress(): finally! Added an implementation of the Quantum - method which was researched and written by Matthew Russoto. Many - thanks to him for all the hard work he did to produce this. I - tidied up the code to be more my style (and to be quite a bit - faster by inlining the bit buffer, H, L and C), but it's still all - his code running. - - * find_next_cabinet_file(): this is a new function which finds the - "next cabinet" by opening the directory it would be in and reading - each filename case-insensitively. It also handles any such "next - cabinets" with directory elements (delimited with MS-DOS - backslashes). - - * process_cabinet(): now uses find_next_cabinet_file() to get the - next cabinet file. This function also replaces the hack that gets - any directory path which might be embedded in the base cabinet - filename (as mentioned on the command line). - -2002-07-21 Stuart Caie - - * file_close(): fixed off-by-one error in setting the extracted - file date. Thanks to Claus Rasmussen. - -2002-07-20 Stuart Caie - - * file_open(): now removes any leading slashes from the name of - the file to be extracted. Thanks to the James Henstridge and - David Leonard for patches. - - * ensure_filepath(): now does not try to examine the directory "" - (i.e. no directory at all) if given an absolute path (one that - start with a slash). Thanks to the James Henstridge for the patch. - -2002-04-30 Stuart Caie - - * cabextract.spec.in: changed the fixed version number to @VERSION@ - -2002-04-06 Stuart Caie - - * Makefile.am, configure.in: used the guide no_getopt_long.txt - included with the gengetopt package to add getopt_long - configuration to cabextract. Hopefully it all works now. Thanks to - the many people who pointed out this problem and to the many - people who offered solutions. - -2001-09-06 Stuart Caie - - * Makefile.am, configure.in: made cabextract.spec one of the auto- - generated files. Now I can do 'make distcheck' here to build a - distribution which can be installed using 'rpm -tb - cabextract-0.6.tar.gz'. Thanks to Daniel Resare for the know-how. - -2001-08-20 Stuart Caie - - * Makefile.am: added an LDADD line for cabextract's LIBOBJS - generated by configure. This means the AC_REPLACE_FUNCS line - should actually have an effect. - - * configure.in: Removed getopt_long and mktime from the - AC_CHECK_FUNCS, as this is done anyway. - -2001-08-19 Stuart Caie - - * Makefile.am, configure.in, cabextract.c: moved the GNU getopt - sources to become an automatically added dependency if - getopt_long() can't be found in the standard library, just like - mktime() is handled. The getopt_long(), struct option and optarg - and optind definitions are taken from getopt.h if possible. If - they're not there, but getopt_long() was found with standard - includes files, it's assumed they're defined in the standard - include files. Otherwise, we define them ourselves. - - * cabextract.c: now gets VERSION defined from configure via - config.h. - - * decompress(): if the 'fix' option was used, the output buffer - would always be cleared before block decompression. A nice idea, - but the MSZIP method likes to keep the output buffer between - blocks. Thanks to Fernando Trias for spotting this. Stopped - clearing the output buffer. - - * main(): the 'fix' variable wasn't initialised to zero, so on - some architectures, where the stack-space allocated to the - variable isn't cleared to zero, you always got the 'fix' option - selected. See above for why this was bad. - - * process_cabinet(): now prints "Finished processing cabinet" when - finished extracting, instead of just a blank line. Still prints - blank lines for listing files. - -2001-08-05 Stuart Caie - - * Makefile.am: the manpage wasn't included in the distribution. - Fixed and re-issued the 0.3 release. - -2001-08-02 Stuart Caie - - * decompress(): now takes a 'fix' flag, which causes MSZIP errors - to be ignored. - - * cabinet_get_entries(): now keeps the printable information about - previous and next cabinet parts - - * process_cabinet(): now prints the printable information about - the next cabinet part in a multi-part cabinet - - * file_open(): now prepends a given directory if wanted, and can - make the filename lowercase if wanted. - - * main(): changed to using getopt_long to parse arguments. Added - -L (lowercase), -d (output to directory), -f (fix corrupt cabs), - -h (help), -q (quiet) and -v was recycled to become --version, - when used on its own. - - * LZXdecompress(): major bug fixed; the updated R0, R1 and R2 in - uncompressed blocks were being stored in the uncomp_state block, - not local variables. At the end of the function, the local values - are always written back to the uncomp_state block. So the values - placed there by the uncompressed block header were always - overwritten. Thanks to Pavel Turbin for providing an example of - this. - - * rindex(): this is the BSD precursor of the ANSI standard - function strrchr(). Oops! Now uses strrchr(), or rindex() if - strrchr() isn't available. - - * cabinet_find_header(): now prints an error message if it can't - find a header. - -2001-04-30 Stuart Caie - - * fixed includes to include both and if - they both exist, and made some signedness conversions explicit. - This should let cabextract compile with SGI's native - compiler. Thanks to Markus Nullmeier for the patch. - -2001-03-04 Stuart Caie - - * main(): now prints the version of cabextract in the copyright - line. - - * cabinet_find_header(): now searches any kind of file, not just - files beginning with 'MZ' header. Also, always searches entire - file. This slows the search down, but increases the usefulness of - the search overall, IMHO. Thanks to Eric Sharkey for pointing this - out. - - * LZXdecompress(): fixed problem in intel decoding: E8 must not - appear in the last 10 bytes, not the last 6 bytes... Thanks to Jae - Jung who pointed this out to me. I didn't believe him at first, - but he was quite right. Also thanks to Antoine Amanieux for - providing example files affected by this. - - * process_cabinet(): now extends multipart cabinet filenames to be - in the same directory as the base cabinet. - - * cabinet_open(): now only lowercases the filename part of a - cabinet name, not the path part. - -2001-03-03 Stuart Caie - - * LZXdecompress(): fixed LZX bit buffer exhaustion in where - READ_HUFFSYM() requests more bits than the buffer actually - contains: top-of-loop overflow check now allows for the input - pointer to be 16 bits past the end of the buffer, but checks to - ensure none of those 16 bits are actually used. Also increased - decomp_state.inbuf by two bytes and clear the two bytes after - loaded block in decompress(). Thanks to Jae Jung for pointing out - this bug, and for providing example files which exposed the bug. - -2001-02-26 Stuart Caie - - * added configure script / makefile using automake. - - * file_close(): now sets the timestamp on extracted files. diff --git a/src/install/acquire/cabextract/INSTALL b/src/install/acquire/cabextract/INSTALL deleted file mode 100644 index b42a17a..0000000 --- a/src/install/acquire/cabextract/INSTALL +++ /dev/null @@ -1,182 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. diff --git a/src/install/acquire/cabextract/Makefile.am b/src/install/acquire/cabextract/Makefile.am deleted file mode 100644 index a7fbd1c..0000000 --- a/src/install/acquire/cabextract/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AUTOMAKE_OPTIONS = no-dependencies -EXTRA_DIST = cabinfo.c mktime.c getopt.h \ - cabextract.1 debian ja cabextract.spec \ - cabextract.spec.in magic.cabinet - -bin_PROGRAMS = cabextract -man_MANS = cabextract.1 -cabextract_SOURCES = cabextract.c -cabextract_LDADD = @LIBOBJS@ - diff --git a/src/install/acquire/cabextract/Makefile.in b/src/install/acquire/cabextract/Makefile.in deleted file mode 100644 index 3d96c6f..0000000 --- a/src/install/acquire/cabextract/Makefile.in +++ /dev/null @@ -1,403 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -CC = @CC@ -EXEEXT = @EXEEXT@ -MAKEINFO = @MAKEINFO@ -PACKAGE = @PACKAGE@ -VERSION = @VERSION@ - -AUTOMAKE_OPTIONS = no-dependencies -EXTRA_DIST = cabinfo.c mktime.c getopt.h cabextract.1 debian ja cabextract.spec cabextract.spec.in magic.cabinet - - -bin_PROGRAMS = cabextract -man_MANS = cabextract.1 -cabextract_SOURCES = cabextract.c -cabextract_LDADD = @LIBOBJS@ -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = cabextract.spec -bin_PROGRAMS = cabextract$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -cabextract_OBJECTS = cabextract.o -cabextract_DEPENDENCIES = @LIBOBJS@ -cabextract_LDFLAGS = -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -man1dir = $(mandir)/man1 -MANS = $(man_MANS) - -NROFF = nroff -DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ -Makefile.am Makefile.in NEWS TODO aclocal.m4 cabextract.spec.in \ -config.h.in configure configure.in getopt.c getopt1.c install-sh \ -missing mkinstalldirs mktime.c - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -SOURCES = $(cabextract_SOURCES) -OBJECTS = $(cabextract_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .o .s -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): configure.in - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -config.h: stamp-h - @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ - else :; fi -stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=config.h \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.h.in: $(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null - -mostlyclean-hdr: - -clean-hdr: - -distclean-hdr: - -rm -f config.h - -maintainer-clean-hdr: -cabextract.spec: $(top_builddir)/config.status cabextract.spec.in - cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -mostlyclean-binPROGRAMS: - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -distclean-binPROGRAMS: - -maintainer-clean-binPROGRAMS: - -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ - $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - list='$(bin_PROGRAMS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ - done - -.c.o: - $(COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -cabextract$(EXEEXT): $(cabextract_OBJECTS) $(cabextract_DEPENDENCIES) - @rm -f cabextract$(EXEEXT) - $(LINK) $(cabextract_LDFLAGS) $(cabextract_OBJECTS) $(cabextract_LDADD) $(LIBS) - -install-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ - done - -uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ - done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -all-recursive-am: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: install-binPROGRAMS -install-exec: install-exec-am - -install-data-am: install-man -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-binPROGRAMS uninstall-man -uninstall: uninstall-am -all-am: Makefile $(PROGRAMS) $(MANS) config.h -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ - mostlyclean-compile mostlyclean-tags \ - mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ - distclean-tags distclean-generic clean-am - -distclean: distclean-am - -rm -f config.status - -maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ - maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -rm -f config.status - -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ -maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile install-man1 uninstall-man1 install-man \ -uninstall-man tags mostlyclean-tags distclean-tags clean-tags \ -maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck all-recursive-am install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/install/acquire/cabextract/NEWS b/src/install/acquire/cabextract/NEWS deleted file mode 100644 index 1681fa7..0000000 --- a/src/install/acquire/cabextract/NEWS +++ /dev/null @@ -1,69 +0,0 @@ -New in 0.6: -* Quantum method is now supported! Many thanks to Matthew Russoto for this. -* Fixed more build problems on non-glibc systems. I have now followed the - 'FSF approved' method for including getopt_long, so hopefully Solaris - and all the other OSes won't have a problem building cabextract any - more. -* Japanese manual page included -- you will have to install the file - ja/cabextract.1 by yourself, it's not part of the install process. -* Now searches for spanning cabinet files in a case-insensitive way. It - also searches in both directions for spanned cabinets (each spanned - cabinet can include a 'previous' and 'next' cabinet filename), so you - can also specify a cabinet in the middle of a set and get the full set, - rather than have to work out what the first cabinet is. -* An off-by-one month error in file dates was fixed. -* Cabinets with files beginning with "/" (or rather, "\") no longer - extract to your root directory. -* A better embeded cabinet search algorithm was introduced for finding - those elusive cabinets in files and executables :) -* Now you can find more than one cabinet in a file (if there is - more than one to find), and it will be extracted or listed as normal. -* Files and directories created now honour your umask settings. -* Errors and warnings are now printed to stderr. - -New in 0.5: -* Fixed build problems on non-glibc systems. - -New in 0.4: -* Fixed a new bug I added by myself to 0.3... :) It corrupts all MS-ZIP - compressed cabinets after the first 32k, and it should be very obvious - that corruption has taken place. -* cabextract should be happier building on Cygwin and other such - architectures -- you should be able to "./configure; make; make install" - again. This was broken in 0.3 due to the getopt.c / getopt1.c weirdness - I copied from GNU hello. -* Now prints 'Finished processing cabinet.' after completing the extraction - a cabinet. - -New in 0.3: -* Fixed very rare, but invisible decrunching bug... if you have any - important things you extracted with cabextract, extract them again - to be sure they're not corrupt. -* cabextract now tells you if a file isn't a cabinet file. -* cabextract now goes on to the next file, if extracting one fails. -* cabextract now goes on to the next cabinet, if extracting one fails. -* cabextract lets you try to 'fix' some cabinets by skipping over bad - blocks rather than failing on them. If you have a corrupt cabinet, try - the '-f' option, and see how it goes. -* Use the new '-d dir' option to extract cabinets to a given directory. -* Use the new '-L' option to turn the extracted filenames to lowercase. -* Use the new '-q' option to be quiet while extracting archives. -* cabextract now prints more information while it's probing multi-part - cabinets - -New in 0.2: -* new even-easier installation: ./configure; make; make install -* Extracted files now have their timestamps set -* Fixed bug which occured when extracting tiny files -* Fixed completely invisible intel E8 decoding bug... if you have any - important things you extracted with cabextract, extract them again - to be sure they're not corrupt. -* cabinet search extended to look through *any* file for cabinets, not - just MS-DOS/Windows executables. -* Now looks for multipart cabinets in the same directory as the base cabinet. - This means you can do stuff like 'cd /tmp && cabextract /cdrom/part01.cab' - -New in 0.1: -* supports MSZIP and LZX compression methods -* supports split cabs and cabs embedded in executables -* initial release diff --git a/src/install/acquire/cabextract/README b/src/install/acquire/cabextract/README deleted file mode 100644 index 636df47..0000000 --- a/src/install/acquire/cabextract/README +++ /dev/null @@ -1,32 +0,0 @@ -cabextract 0.6 - a program to extract Microsoft Cabinet files. -(C) 2000-2002 Stuart Caie -This is free software with ABSOLUTELY NO WARRANTY. - -Cabinet (.CAB) files are a form of archive, which Microsoft use to -distribute their software, and things like Windows Font Packs. The -cabextract program simply unpacks such files. - -For more information, see http://www.kyz.uklinux.net/cabextract.php3 -or run the command 'cabextract --help'. - -Example usage: - -Extracting files from a cabinet file: -$ cabextract wibble.cab - -Extracting files from an executable which contains a cabinet file: -$ cabextract wibble.exe -[cabextract will automatically search executables for embedded cabinets] - -Extracting files from a set of cabinet files; wib01.cab, wib02.cab, ...: -$ cabextract wib01.cab -[cabextract will automatically get the names of the other files] - -Extracting files to a directory of your choice (in this case, 'boogie'): -$ cabextract -d boogie wibble.cab -[cabextract will create the directory if it does not already exist] - -Listing files from a cabinet file: -$ cabextract -l wibble.cab - -Stuart Caie , 12 August 2002. diff --git a/src/install/acquire/cabextract/TODO b/src/install/acquire/cabextract/TODO deleted file mode 100644 index 8b7e024..0000000 --- a/src/install/acquire/cabextract/TODO +++ /dev/null @@ -1 +0,0 @@ -Nothing planned. diff --git a/src/install/acquire/cabextract/aclocal.m4 b/src/install/acquire/cabextract/aclocal.m4 deleted file mode 100644 index 5560342..0000000 --- a/src/install/acquire/cabextract/aclocal.m4 +++ /dev/null @@ -1,127 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "[$]2" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - diff --git a/src/install/acquire/cabextract/cabextract.1 b/src/install/acquire/cabextract/cabextract.1 deleted file mode 100644 index 8811128..0000000 --- a/src/install/acquire/cabextract/cabextract.1 +++ /dev/null @@ -1,60 +0,0 @@ -.TH CABEXTRACT 1 "August 2, 2001" -.SH NAME -cabextract \- program to extract files from Microsoft cabinet (.cab) archives -.SH SYNOPSIS -.B cabextract -.RB [ -v ] -.RB [ -h ] -.RB [ -l ] -.RB [ -q ] -.RB [ -L ] -.RB [ -f ] -.RB [ -d \fIdir\fP ] -.I " cabinet files" ... -.SH DESCRIPTION -.B cabextract -is a program that un-archives files in the -Microsoft cabinet file format (.cab) or any binary file which contains -an embedded cabinet file (frequently found in .exe files). -.PP -.B cabextract -will extract all files from all cabinet files specified on the command line -.PP -To extract a multi\-part cabinet consisting of several -files, only give the -.I first -file as an argument to -.B cabextract -as it will automatically look for the remaining files. -.SH OPTIONS -A summary of options is included below. -.TP -.B \-v -If given alone on the command line, prints the version of -.B cabextract -and exits. Given with a list of cabinet files, it will list the contents -of the cabinet files. -.TP -.B \-h -Prints a page of help and exits. -.TP -.B \-l -Lists the contents of the given cabinet files, rather than extracting them. -.TP -.B \-q -When extracting cabinet files, supresses all messages except errors and -warnings. -.TP -.B \-L -When extracting cabinet files, makes each extracted file's name lowercase. -.TP -.B \-f -When extracting cabinet files, will ignore corrupted MSZIP blocks. A warning -will be printed if a corrupted MSZIP block is encountered. -.TP -.B \-d \fIdir\fP -Extracts all files into the directory \fIdir\fP . -.SH AUTHOR -This manual page was written by Stuart Caie , based on -the one written by Eric Sharkey , for the Debian -GNU/Linux system. diff --git a/src/install/acquire/cabextract/cabextract.c b/src/install/acquire/cabextract/cabextract.c index ade7d8c..d83803f 100644 --- a/src/install/acquire/cabextract/cabextract.c +++ b/src/install/acquire/cabextract/cabextract.c @@ -1,5 +1,7 @@ /* cabextract 0.6 - a program to extract Microsoft Cabinet files * (C) 2000-2002 Stuart Caie + * Modifications for Captive project by: + * Copyright (C) 2003 Jan Kratochvil * * 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 @@ -48,6 +50,8 @@ * Intel code. */ +#include "config.h" /* CAPTIVE */ + #ifdef HAVE_CONFIG_H #include @@ -147,6 +151,12 @@ extern time_t mktime(struct tm *tp); #endif +#include +#include +#include "../cabinet.h" +#include "../cabinet-memory.h" +#include "cabextract.h" + #ifdef DEBUG # define D(x) printf x ; #else @@ -154,11 +164,6 @@ extern time_t mktime(struct tm *tp); #endif -typedef unsigned char UBYTE; /* 8 bits exactly */ -typedef unsigned short UWORD; /* 16 bits (or more) */ -typedef unsigned int ULONG; /* 32 bits (or more) */ -typedef signed int LONG; /* 32 bits (or more) */ - /* number of bits in a ULONG */ #ifndef CHAR_BIT # define CHAR_BIT (8) @@ -172,21 +177,6 @@ typedef signed int LONG; /* 32 bits (or more) */ /* maximum number of cabinets any one folder can be split across */ #define CAB_SPLITMAX (10) -struct cabinet { - struct cabinet *next; /* for making a list of cabinets */ - char *filename; /* input name of cabinet */ - FILE *fh; /* open file handle or NULL */ - off_t filelen; /* length of cabinet file */ - off_t blocks_off; /* offset to data blocks in file */ - struct cabinet *prevcab, *nextcab; /* multipart cabinet chains */ - char *prevname, *nextname; /* and their filenames */ - char *previnfo, *nextinfo; /* and their visible names */ - struct folder *folders; /* first folder in this cabinet */ - struct file *files; /* first file in this cabinet */ - UBYTE block_resv; /* reserved space in datablocks */ - UBYTE flags; /* header flags */ -}; - struct folder { struct folder *next; struct cabinet *cab[CAB_SPLITMAX]; /* cabinet(s) this folder spans */ @@ -198,17 +188,6 @@ struct folder { struct file *contfile; /* the first split file */ }; -struct file { - struct file *next; /* next file in sequence */ - struct folder *folder; /* folder that contains this file */ - char *filename; /* output name of file */ - FILE *fh; /* open file handle or NULL */ - ULONG length; /* uncompressed length of file */ - ULONG offset; /* uncompressed offset in folder */ - UWORD index; /* magic index number of folder */ - UWORD time, date, attribs; /* MS-DOS time/date/attributes */ -}; - /* structure offsets */ #define cfhead_Signature (0x00) @@ -380,10 +359,11 @@ struct LZXstate { /* generic stuff */ -#define CAB(x) (decomp_state.x) -#define ZIP(x) (decomp_state.methods.zip.x) -#define QTM(x) (decomp_state.methods.qtm.x) -#define LZX(x) (decomp_state.methods.lzx.x) +#define decomp_state_ptr ((struct decomp_state *)acquire_cabinet_memory_data_get(sizeof(struct decomp_state))) +#define CAB(x) (decomp_state_ptr->x) +#define ZIP(x) (decomp_state_ptr->methods.zip.x) +#define QTM(x) (decomp_state_ptr->methods.qtm.x) +#define LZX(x) (decomp_state_ptr->methods.lzx.x) #define DECR_OK (0) #define DECR_DATAFORMAT (1) #define DECR_ILLEGALDATA (2) @@ -400,7 +380,7 @@ struct LZXstate { #define CAB_BLOCKMAX (32768) #define CAB_INPUTMAX (CAB_BLOCKMAX+6144) -struct { +struct decomp_state { struct folder *current; /* current folder we're extracting from */ ULONG offset; /* uncompressed offset within folder */ UBYTE *outpos; /* (high level) start of data to use up */ @@ -414,7 +394,7 @@ struct { struct QTMstate qtm; struct LZXstate lzx; } methods; -} decomp_state; +}; /* MSZIP decruncher */ @@ -447,7 +427,7 @@ static const UWORD Zipmask[17] = { b|=((ULONG)c)<>=(n);k-=(n);} -void Ziphuft_free(struct Ziphuft *t) +static void Ziphuft_free(struct Ziphuft *t) { register struct Ziphuft *p, *q; @@ -456,12 +436,12 @@ void Ziphuft_free(struct Ziphuft *t) while (p != (struct Ziphuft *)NULL) { q = (--p)->v.t; - free(p); + acquire_cabinet_memory_free(p); p = q; } } -LONG Ziphuft_build(ULONG *b, ULONG n, ULONG s, UWORD *d, UWORD *e, +static LONG Ziphuft_build(ULONG *b, ULONG n, ULONG s, UWORD *d, UWORD *e, struct Ziphuft **t, LONG *m) { ULONG a; /* counter for codes of length k */ @@ -560,7 +540,7 @@ struct Ziphuft **t, LONG *m) w += l[h++]; /* add bits already decoded */ /* compute minimum size table less than or equal to *m bits */ - z = (z = g - w) > (ULONG)*m ? *m : z; /* upper limit */ + z = (z = g - w) > (ULONG)*m ? (ULONG)*m : z; /* upper limit */ if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ { /* too few codes for k-w bit table */ f -= a + 1; /* deduct codes from patterns left */ @@ -578,7 +558,7 @@ struct Ziphuft **t, LONG *m) l[h] = j; /* set table size in stack */ /* allocate and link in new table */ - if (!(q = (struct Ziphuft *) malloc((z + 1)*sizeof(struct Ziphuft)))) + if (!(q = (struct Ziphuft *) acquire_cabinet_memory_malloc((z + 1)*sizeof(struct Ziphuft)))) { if(h) Ziphuft_free(ZIP(u)[0]); @@ -638,7 +618,7 @@ struct Ziphuft **t, LONG *m) return y != 0 && g != 1; } -LONG Zipinflate_codes(struct Ziphuft *tl, struct Ziphuft *td, +static LONG Zipinflate_codes(struct Ziphuft *tl, struct Ziphuft *td, LONG bl, LONG bd) { register ULONG e; /* table entry flag/number of extra bits */ @@ -718,7 +698,7 @@ LONG bl, LONG bd) return 0; } -LONG Zipinflate_stored(void) +static LONG Zipinflate_stored(void) /* "decompress" an inflated type 0 (stored) block. */ { ULONG n; /* number of bytes in block */ @@ -759,7 +739,7 @@ LONG Zipinflate_stored(void) return 0; } -LONG Zipinflate_fixed(void) +static LONG Zipinflate_fixed(void) { struct Ziphuft *fixed_tl; struct Ziphuft *fixed_td; @@ -802,7 +782,7 @@ LONG Zipinflate_fixed(void) return i; } -LONG Zipinflate_dynamic(void) +static LONG Zipinflate_dynamic(void) /* decompress an inflated type 2 (dynamic Huffman codes) block. */ { LONG i; /* temporary variables */ @@ -932,7 +912,7 @@ LONG Zipinflate_dynamic(void) return 0; } -LONG Zipinflate_block(LONG *e) /* e == last block flag */ +static LONG Zipinflate_block(LONG *e) /* e == last block flag */ { /* decompress an inflated block */ ULONG t; /* block type */ register ULONG b; /* bit buffer */ @@ -967,7 +947,7 @@ LONG Zipinflate_block(LONG *e) /* e == last block flag */ return 2; } -int ZIPdecompress(int inlen, int outlen) +static int ZIPdecompress(int inlen, int outlen) { LONG e; /* last block flag */ @@ -1000,7 +980,7 @@ static UBYTE q_length_base[27], q_length_extra[27], q_extra_bits[42]; static ULONG q_position_base[42]; /* Initialise a model which decodes symbols from [s] to [s]+[n]-1 */ -void QTMinitmodel(struct QTMmodel *m, struct QTMmodelsym *sym, int n, int s) { +static void QTMinitmodel(struct QTMmodel *m, struct QTMmodelsym *sym, int n, int s) { int i; m->shiftsleft = 4; m->entries = n; @@ -1014,19 +994,19 @@ void QTMinitmodel(struct QTMmodel *m, struct QTMmodelsym *sym, int n, int s) { m->syms[n].cumfreq = 0; } -int QTMinit(int window, int level) { +static int QTMinit(int window, int level) { int wndsize = 1 << window, msz = window * 2, i; ULONG j; /* QTM supports window sizes of 2^10 (1Kb) through 2^21 (2Mb) */ /* if a previously allocated window is big enough, keep it */ if (window < 10 || window > 21) return DECR_DATAFORMAT; - if (QTM(actual_size) < wndsize) { - if (QTM(window)) free(QTM(window)); + if (QTM(actual_size) < (ULONG)wndsize) { + if (QTM(window)) acquire_cabinet_memory_free(QTM(window)); QTM(window) = NULL; } if (!QTM(window)) { - if (!(QTM(window) = malloc(wndsize))) return DECR_NOMEMORY; + if (!(QTM(window) = acquire_cabinet_memory_malloc(wndsize))) return DECR_NOMEMORY; QTM(actual_size) = wndsize; } QTM(window_size) = wndsize; @@ -1063,7 +1043,7 @@ int QTMinit(int window, int level) { } -void QTMupdatemodel(struct QTMmodel *model, int sym) { +static void QTMupdatemodel(struct QTMmodel *model, int sym) { struct QTMmodelsym temp; int i, j; @@ -1145,7 +1125,7 @@ void QTMupdatemodel(struct QTMmodel *model, int sym) { #define Q_INIT_BITSTREAM do { bitsleft = 0; bitbuf = 0; } while (0) #define Q_FILL_BUFFER do { \ - if (bitsleft <= (ULONG_BITS - 16)) { \ + if (bitsleft <= (int)(ULONG_BITS - 16)) { \ bitbuf |= ((inpos[0]<<8)|inpos[1]) << (ULONG_BITS-16 - bitsleft); \ bitsleft += 16; inpos += 2; \ } \ @@ -1201,7 +1181,7 @@ void QTMupdatemodel(struct QTMmodel *model, int sym) { } while (0) -int QTMdecompress(int inlen, int outlen) { +static int QTMdecompress(int inlen, int outlen) { UBYTE *inpos = CAB(inbuf); UBYTE *window = QTM(window); UBYTE *runsrc, *rundest; @@ -1218,9 +1198,10 @@ int QTMdecompress(int inlen, int outlen) { UWORD symf; int i; - int extra, togo = outlen, match_length, copy_length; + int extra, togo = outlen, match_length = 0; /* Prevent: ... might be used uninitialized in this function */ + int copy_length; UBYTE selector, sym; - ULONG match_offset; + ULONG match_offset = 0; /* Prevent: ... might be used uninitialized in this function */ UWORD H = 0xFFFF, L = 0, C; @@ -1381,7 +1362,7 @@ int QTMdecompress(int inlen, int outlen) { static ULONG lzx_position_base[51]; static UBYTE extra_bits[51]; -int LZXinit(int window) { +static int LZXinit(int window) { ULONG wndsize = 1 << window; int i, j, posn_slots; @@ -1389,11 +1370,11 @@ int LZXinit(int window) { /* if a previously allocated window is big enough, keep it */ if (window < 15 || window > 21) return DECR_DATAFORMAT; if (LZX(actual_size) < wndsize) { - if (LZX(window)) free(LZX(window)); + if (LZX(window)) acquire_cabinet_memory_free(LZX(window)); LZX(window) = NULL; } if (!LZX(window)) { - if (!(LZX(window) = malloc(wndsize))) return DECR_NOMEMORY; + if (!(LZX(window) = acquire_cabinet_memory_malloc(wndsize))) return DECR_NOMEMORY; LZX(actual_size) = wndsize; } LZX(window_size) = wndsize; @@ -1537,7 +1518,7 @@ int LZXinit(int window) { * Returns 0 for OK or 1 for error */ -int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) { +static int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) { register UWORD sym; register ULONG leaf; register UBYTE bit_num = 1; @@ -1613,7 +1594,7 @@ struct lzx_bits { UBYTE *ip; }; -int lzx_read_lens(UBYTE *lens, ULONG first, ULONG last, struct lzx_bits *lb) { +static int lzx_read_lens(UBYTE *lens, ULONG first, ULONG last, struct lzx_bits *lb) { ULONG i,j, x,y; int z; @@ -1656,7 +1637,7 @@ int lzx_read_lens(UBYTE *lens, ULONG first, ULONG last, struct lzx_bits *lb) { return 0; } -int LZXdecompress(int inlen, int outlen) { +static int LZXdecompress(int inlen, int outlen) { UBYTE *inpos = CAB(inbuf); UBYTE *endinp = inpos + inlen; UBYTE *window = LZX(window); @@ -1976,6 +1957,7 @@ int LZXdecompress(int inlen, int outlen) { +#if 0 /* CAPTIVE */ /* all the file IO is abstracted into these routines: * cabinet_(open|close|read|seek|skip|getoffset) @@ -2008,8 +1990,8 @@ int file_open(struct file *fi, int lower, char *dir) { char c, *s, *d, *name; int ok = 0; - if (!(name = malloc(strlen(fi->filename) + (dir ? strlen(dir) : 0) + 2))) { - fprintf(stderr, "out of memory!\n"); + if (!(name = acquire_cabinet_memory_malloc(strlen(fi->filename) + (dir ? strlen(dir) : 0) + 2))) { + g_warning(_("out of memory!")); return 0; } @@ -2044,7 +2026,7 @@ int file_open(struct file *fi, int lower, char *dir) { } /* as full filename is no longer needed, free it */ - free(name); + acquire_cabinet_memory_free(name); if (!ok) { perror(fi->filename); @@ -2052,6 +2034,7 @@ int file_open(struct file *fi, int lower, char *dir) { return ok; } + /* closes a completed file, updates protections and timestamp */ void file_close(struct file *fi) { struct utimbuf utb; @@ -2092,7 +2075,6 @@ int file_write(struct file *fi, UBYTE *buf, size_t length) { return 1; } - void cabinet_close(struct cabinet *cab) { if (cab->fh) { fclose(cab->fh); @@ -2100,36 +2082,37 @@ void cabinet_close(struct cabinet *cab) { cab->fh = NULL; } -void cabinet_seek(struct cabinet *cab, off_t offset) { - if (fseek(cab->fh, offset, SEEK_SET) < 0) { - perror(cab->filename); - } +#endif /* CAPTIVE */ + +static void cabinet_seek(struct cabinet *cab, off_t offset) { + acquire_cabinet_seek(cab->acquire_cabinet,offset); } -void cabinet_skip(struct cabinet *cab, off_t distance) { - if (fseek(cab->fh, distance, SEEK_CUR) < 0) { - perror(cab->filename); - } +static void cabinet_skip(struct cabinet *cab, off_t distance) { + acquire_cabinet_seek_skip(cab->acquire_cabinet,distance); } -off_t cabinet_getoffset(struct cabinet *cab) { - return ftell(cab->fh); +static off_t cabinet_getoffset(struct cabinet *cab) { + return acquire_cabinet_tell(cab->acquire_cabinet); } /* read data from a cabinet, returns success */ -int cabinet_read(struct cabinet *cab, UBYTE *buf, size_t length) { - size_t avail = (size_t) (cab->filelen - cabinet_getoffset(cab)); - if (length > avail) { - fprintf(stderr, "%s: WARNING; cabinet is truncated\n", cab->filename); - length = avail; - } - if (fread((void *)buf, 1, length, cab->fh) != length) { - perror(cab->filename); +static int cabinet_read(struct cabinet *cab, UBYTE *buf, size_t length) { + GnomeVFSResult errvfsresult; + GnomeVFSFileSize bytes_read; + + errvfsresult=acquire_cabinet_read(cab->acquire_cabinet,buf,length,&bytes_read); + if (errvfsresult!=GNOME_VFS_OK) { + g_warning(_("%s: cabinet read error: %s"), cab->filename, gnome_vfs_result_to_string(errvfsresult)); return 0; } + if (bytes_read!=length) + g_warning(_("%s: WARNING; cabinet is truncated"), cab->filename); return 1; } +#if 0 /* CAPTIVE */ + /* try to open a cabinet file, returns success */ int cabinet_open(struct cabinet *cab) { char *name = cab->filename; @@ -2162,14 +2145,16 @@ int cabinet_open(struct cabinet *cab) { return 1; } +#endif /* CAPTIVE */ + /* allocate and read an aribitrarily long string from the cabinet */ -char *cabinet_read_string(struct cabinet *cab) { +static char *cabinet_read_string(struct cabinet *cab) { off_t len=256, base = cabinet_getoffset(cab), maxlen = cab->filelen - base; int ok = 0, i; UBYTE *buf = NULL; do { if (len > maxlen) len = maxlen; - if (!(buf = realloc(buf, (size_t) len))) break; + if (!(buf = acquire_cabinet_memory_realloc(buf, (size_t) len))) break; if (!cabinet_read(cab, buf, (size_t) len)) break; /* search for a null terminator in what we've just read */ @@ -2179,7 +2164,7 @@ char *cabinet_read_string(struct cabinet *cab) { if (!ok) { if (len == maxlen) { - fprintf(stderr, "%s: WARNING; cabinet is truncated\n", cab->filename); + g_warning(_("%s: WARNING; cabinet is truncated"), cab->filename); break; } len += 256; @@ -2188,7 +2173,7 @@ char *cabinet_read_string(struct cabinet *cab) { } while (!ok); if (!ok) { - if (buf) free(buf); else fprintf(stderr, "out of memory!\n"); + if (buf) acquire_cabinet_memory_free(buf); else g_warning(_("out of memory!")); return NULL; } @@ -2198,7 +2183,7 @@ char *cabinet_read_string(struct cabinet *cab) { } /* reads the header and all folder and file entries in this cabinet */ -int cabinet_read_entries(struct cabinet *cab) { +static int cabinet_read_entries(struct cabinet *cab) { int num_folders, num_files, header_resv, folder_resv = 0, i; struct folder *fol, *linkfol = NULL; struct file *file, *linkfile = NULL; @@ -2213,21 +2198,21 @@ int cabinet_read_entries(struct cabinet *cab) { /* check basic MSCF signature */ if (EndGetI32(buf+cfhead_Signature) != 0x4643534d) { - fprintf(stderr, "%s: not a Microsoft cabinet file\n", cab->filename); + g_warning(_("%s: not a Microsoft cabinet file"), cab->filename); return 0; } /* get the number of folders */ num_folders = EndGetI16(buf+cfhead_NumFolders); if (num_folders == 0) { - fprintf(stderr, "%s: no folders in cabinet\n", cab->filename); + g_warning(_("%s: no folders in cabinet"), cab->filename); return 0; } /* get the number of files */ num_files = EndGetI16(buf+cfhead_NumFiles); if (num_files == 0) { - fprintf(stderr, "%s: no files in cabinet\n", cab->filename); + g_warning(_("%s: no files in cabinet"), cab->filename); return 0; } @@ -2235,7 +2220,7 @@ int cabinet_read_entries(struct cabinet *cab) { if ((buf[cfhead_MajorVersion] > 1) || (buf[cfhead_MajorVersion] == 1 && buf[cfhead_MinorVersion] > 3)) { - fprintf(stderr, "%s: WARNING; cabinet format version > 1.3\n", + g_warning(_("%s: WARNING; cabinet format version > 1.3"), cab->filename); } @@ -2248,24 +2233,26 @@ int cabinet_read_entries(struct cabinet *cab) { cab->block_resv = buf[cfheadext_DataReserved]; if (header_resv > 60000) { - fprintf(stderr, "%s: WARNING; header reserved space > 60000\n", + g_warning(_("%s: WARNING; header reserved space > 60000"), cab->filename); } /* skip the reserved header */ - if (header_resv) fseek(cab->fh, (off_t) header_resv, SEEK_CUR); + if (header_resv) cabinet_skip(cab, (off_t) header_resv); } if (cab->flags & cfheadPREV_CABINET) { cab->prevname = cabinet_read_string(cab); if (!cab->prevname) return 0; cab->previnfo = cabinet_read_string(cab); + if (!cab->previnfo) return 0; } if (cab->flags & cfheadNEXT_CABINET) { cab->nextname = cabinet_read_string(cab); if (!cab->nextname) return 0; cab->nextinfo = cabinet_read_string(cab); + if (!cab->nextinfo) return 0; } /* read folders */ @@ -2273,8 +2260,8 @@ int cabinet_read_entries(struct cabinet *cab) { if (!cabinet_read(cab, buf, cffold_SIZEOF)) return 0; if (folder_resv) cabinet_skip(cab, folder_resv); - fol = (struct folder *) calloc(1, sizeof(struct folder)); - if (!fol) { fprintf(stderr, "out of memory!\n"); return 0; } + fol = (struct folder *) acquire_cabinet_memory_malloc0(sizeof(struct folder)); + if (!fol) { g_warning(_("out of memory!")); return 0; } fol->cab[0] = cab; fol->offset[0] = base_offset + (off_t) EndGetI32(buf+cffold_DataOffset); @@ -2288,8 +2275,8 @@ int cabinet_read_entries(struct cabinet *cab) { /* read files */ for (i = 0; i < num_files; i++) { if (!cabinet_read(cab, buf, cffile_SIZEOF)) return 0; - file = (struct file *) calloc(1, sizeof(struct file)); - if (!file) { fprintf(stderr, "out of memory!\n"); return 0; } + file = (struct file *) acquire_cabinet_memory_malloc0(sizeof(struct file)); + if (!file) { g_warning(_("out of memory!")); return 0; } file->length = EndGetI32(buf+cffile_UncompressedSize); file->offset = EndGetI32(buf+cffile_FolderOffset); @@ -2359,7 +2346,7 @@ struct file *process_files(struct cabinet *basecab) { /* increase the number of splits */ if ((i = ++(predfol->num_splits)) > CAB_SPLITMAX) { mergeok = 0; - fprintf(stderr, "%s: internal error, increase CAB_SPLITMAX\n", + g_warning(_("%s: internal error, increase CAB_SPLITMAX"), basecab->filename); } else { @@ -2398,20 +2385,21 @@ struct file *process_files(struct cabinet *basecab) { * file [name]. Returns a cabinet structure if successful, or NULL * otherwise. */ -struct cabinet *load_cab_offset(char *name, off_t offset) { - struct cabinet *cab = (struct cabinet *) calloc(1, sizeof(struct cabinet)); +static struct cabinet *load_cab_offset(struct acquire_cabinet *acquire_cabinet, off_t offset) { + struct cabinet *cab = (struct cabinet *) acquire_cabinet_memory_malloc0(sizeof(struct cabinet)); int ok; if (!cab) return NULL; - cab->filename = name; - if ((ok = cabinet_open(cab))) { - cabinet_seek(cab, offset); - ok = cabinet_read_entries(cab); - cabinet_close(cab); - } + cab->acquire_cabinet = acquire_cabinet; + cab->filename = cab->acquire_cabinet->filename; + /* if ((ok = cabinet_open(cab))) * CAPTIVE */ + cab->filelen = acquire_cabinet->size; + cabinet_seek(cab, offset); + ok = cabinet_read_entries(cab); + /* cabinet_close(cab); * CAPTIVE */ if (ok) return cab; - free(cab); + acquire_cabinet_memory_free(cab); return NULL; } @@ -2421,19 +2409,23 @@ struct cabinet *load_cab_offset(char *name, off_t offset) { * member. */ #define SEARCH_SIZE (32*1024) -UBYTE search_buf[SEARCH_SIZE]; +static UBYTE search_buf[SEARCH_SIZE]; -struct cabinet *find_cabs_in_file(char *name) { +struct cabinet *find_cabs_in_file(struct acquire_cabinet *acquire_cabinet) { struct cabinet *cab, *cab2, *firstcab = NULL, *linkcab = NULL; UBYTE *pstart = &search_buf[0], *pend, *p; - ULONG offset, caboff, cablen, foffset, filelen; + ULONG offset, caboff, cablen = 0; /* Prevent: ... might be used uninitialized in this function */ + ULONG foffset = 0; /* Prevent: ... might be used uninitialized in this function */ + ULONG filelen; size_t length; int state = 0, found = 0, ok = 0; /* open the file and search for cabinet headers */ - if ((cab = (struct cabinet *) calloc(1, sizeof(struct cabinet)))) { - cab->filename = name; - if (cabinet_open(cab)) { + if ((cab = (struct cabinet *) acquire_cabinet_memory_malloc0(sizeof(struct cabinet)))) { + cab->acquire_cabinet = acquire_cabinet; + cab->filename = acquire_cabinet->filename; + cab->filelen = acquire_cabinet->size; + if (1 /* cabinet_open(cab) * CAPTIVE */) { filelen = (ULONG) cab->filelen; for (offset = 0; offset < filelen; offset += length) { /* search length is either the full length of the search buffer, @@ -2492,7 +2484,7 @@ struct cabinet *find_cabs_in_file(char *name) { { /* found a potential result - try loading it */ found++; - cab2 = load_cab_offset(name, (off_t) caboff); + cab2 = load_cab_offset(acquire_cabinet, (off_t) caboff); if (cab2) { /* success */ ok++; @@ -2516,23 +2508,25 @@ struct cabinet *find_cabs_in_file(char *name) { } } } - cabinet_close(cab); + /* cabinet_close(cab); * CAPTIVE */ } - free(cab); + acquire_cabinet_memory_free(cab); } /* if there were cabinets that were found but are not ok, point this out */ if (found > ok) { - fprintf(stderr, "%s: WARNING; found %d bad cabinets\n", name, found-ok); + g_warning(_("%s: WARNING; found %d bad cabinets"), acquire_cabinet->filename, found-ok); } /* if no cabinets were found, let the user know */ if (!firstcab) { - fprintf(stderr, "%s: not a Microsoft cabinet file.\n", name); + g_warning(_("%s: not a Microsoft cabinet file."), acquire_cabinet->filename); } return firstcab; } +#if 0 /* CAPTIVE */ + /* UTF translates two-byte unicode characters into 1, 2 or 3 bytes. * %000000000xxxxxxx -> %0xxxxxxx * %00000xxxxxyyyyyy -> %110xxxxx %10yyyyyy @@ -2548,7 +2542,7 @@ struct cabinet *find_cabs_in_file(char *name) { */ /* translate UTF -> ASCII */ -int convertUTF(UBYTE *in) { +static int convertUTF(UBYTE *in) { UBYTE c, *out = in, *end = in + strlen((char *) in) + 1; ULONG x; @@ -2582,7 +2576,7 @@ void print_fileinfo(struct file *fi) { char *fname = NULL; if (fi->attribs & cffile_A_NAME_IS_UTF) { - fname = malloc(strlen(fi->filename) + 1); + fname = acquire_cabinet_memory_malloc(strlen(fi->filename) + 1); if (fname) { strcpy(fname, fi->filename); convertUTF((UBYTE *) fname); @@ -2596,16 +2590,18 @@ void print_fileinfo(struct file *fi) { fname ? fname : fi->filename ); - if (fname) free(fname); + if (fname) acquire_cabinet_memory_free(fname); } -int NONEdecompress(int inlen, int outlen) { +#endif /* CAPTIVE */ + +static int NONEdecompress(int inlen, int outlen) { if (inlen != outlen) return DECR_ILLEGALDATA; memcpy(CAB(outbuf), CAB(inbuf), (size_t) inlen); return DECR_OK; } -ULONG checksum(UBYTE *data, UWORD bytes, ULONG csum) { +static ULONG checksum(UBYTE *data, UWORD bytes, ULONG csum) { int len; ULONG ul = 0; @@ -2623,7 +2619,9 @@ ULONG checksum(UBYTE *data, UWORD bytes, ULONG csum) { return csum; } -int decompress(struct file *fi, int savemode, int fix) { +int file_write(struct file *fi, UBYTE *buf, size_t length); + +static int decompress(struct file *fi, int savemode, int fix) { ULONG bytes = savemode ? fi->length : fi->offset - CAB(offset); struct cabinet *cab = CAB(current)->cab[CAB(split)]; UBYTE buf[cfdata_SIZEOF], *data; @@ -2649,7 +2647,19 @@ int decompress(struct file *fi, int savemode, int fix) { inlen = outlen = 0; while (outlen == 0) { /* read the block header, skip the reserved part */ - if (!cabinet_read(cab, buf, cfdata_SIZEOF)) return DECR_INPUT; + if ((NONEdecompress==CAB(decompress) && !savemode && bytes>32768)) { + cabinet_skip(cab, cfdata_SIZEOF); + memset(buf + cfdata_CheckSum, 0, 4); /* no CheckSum */ + /* FIXME: Is it safe to assume 'NONEdecompress' block size 32768? + * Probably not but we need to prevent scattering block headers through the file. + */ + buf[cfdata_CompressedSize + 0]=(32768>>0)&0xFF; + buf[cfdata_CompressedSize + 1]=(32768>>8)&0xFF; + buf[cfdata_UncompressedSize + 0]=(32768>>0)&0xFF; + buf[cfdata_UncompressedSize + 1]=(32768>>8)&0xFF; + } else { + if (!cabinet_read(cab, buf, cfdata_SIZEOF)) return DECR_INPUT; + } cabinet_skip(cab, cab->block_resv); /* we shouldn't get blocks over CAB_INPUTMAX in size */ @@ -2657,45 +2667,57 @@ int decompress(struct file *fi, int savemode, int fix) { len = EndGetI16(buf+cfdata_CompressedSize); inlen += len; if (inlen > CAB_INPUTMAX) return DECR_INPUT; - if (!cabinet_read(cab, data, len)) return DECR_INPUT; + if ((NONEdecompress==CAB(decompress) && !savemode && bytes>32768)) { + cabinet_skip(cab, len); + } else { + if (!cabinet_read(cab, data, len)) return DECR_INPUT; + } /* clear two bytes after read-in data */ data[len+1] = data[len+2] = 0; /* perform checksum test on the block (if one is stored) */ cksum = EndGetI32(buf+cfdata_CheckSum); - if (cksum && cksum != checksum(buf+4, 4, checksum(data, len, 0))) { - /* checksum is wrong */ - if (fix && ((fi->folder->comp_type & cffoldCOMPTYPE_MASK) - == cffoldCOMPTYPE_MSZIP)) - { - fprintf(stderr, "%s: WARNING; checksum failed\n", fi->filename); - } - else { - return DECR_CHECKSUM; + if (!(NONEdecompress==CAB(decompress) && !savemode && bytes>32768)) { + if (cksum && cksum != checksum(buf+4, 4, checksum(data, len, 0))) { + /* checksum is wrong */ + if (fix && ((fi->folder->comp_type & cffoldCOMPTYPE_MASK) + == cffoldCOMPTYPE_MSZIP)) + { + g_warning(_("%s: WARNING; checksum failed"), fi->filename); + } + else { + return DECR_CHECKSUM; + } } } /* outlen=0 means this block was part of a split block */ outlen = EndGetI16(buf+cfdata_UncompressedSize); if (outlen == 0) { +#if 0 /* CAPTIVE */ cabinet_close(cab); cab = CAB(current)->cab[++CAB(split)]; if (!cabinet_open(cab)) return DECR_INPUT; cabinet_seek(cab, CAB(current)->offset[CAB(split)]); +#else + return DECR_INPUT; +#endif } } - /* decompress block */ - if ((err = CAB(decompress)(inlen, outlen))) { - if (fix && ((fi->folder->comp_type & cffoldCOMPTYPE_MASK) - == cffoldCOMPTYPE_MSZIP)) - { - fprintf(stderr, "%s: WARNING; failed decrunching block\n", - fi->filename); - } - else { - return err; + if (!(NONEdecompress==CAB(decompress) && !savemode && bytes>32768)) { + /* decompress block */ + if ((err = CAB(decompress)(inlen, outlen))) { + if (fix && ((fi->folder->comp_type & cffoldCOMPTYPE_MASK) + == cffoldCOMPTYPE_MSZIP)) + { + g_warning(_("%s: WARNING; failed decrunching block"), + fi->filename); + } + else { + return err; + } } } CAB(outlen) = outlen; @@ -2706,7 +2728,7 @@ int decompress(struct file *fi, int savemode, int fix) { } -void extract_file(struct file *fi, int lower, int fix, char *dir) { +int extract_file(struct file *fi, int lower, int fix, char *dir) { struct folder *fol = fi->folder, *oldfol = CAB(current); LONG err = DECR_OK; @@ -2721,13 +2743,13 @@ void extract_file(struct file *fi, int lower, int fix, char *dir) { switch (ct2) { case cffoldCOMPTYPE_LZX: if (LZX(window)) { - free(LZX(window)); + acquire_cabinet_memory_free(LZX(window)); LZX(window) = NULL; } break; case cffoldCOMPTYPE_QUANTUM: if (QTM(window)) { - free(QTM(window)); + acquire_cabinet_memory_free(QTM(window)); QTM(window) = NULL; } break; @@ -2759,8 +2781,13 @@ void extract_file(struct file *fi, int lower, int fix, char *dir) { if (err) goto exit_handler; /* initialisation OK, set current folder and reset offset */ +#if 0 /* CAPTIVE */ if (oldfol) cabinet_close(oldfol->cab[CAB(split)]); - if (!cabinet_open(fol->cab[0])) goto exit_handler; + if (!cabinet_open(fol->cab[0])) { + err = DECR_ILLEGALDATA; + goto exit_handler; + } +#endif /* CAPTIVE */ cabinet_seek(fol->cab[0], fol->offset[0]); CAB(current) = fol; CAB(offset) = 0; @@ -2773,29 +2800,33 @@ void extract_file(struct file *fi, int lower, int fix, char *dir) { if ((err = decompress(fi, 0, fix))) goto exit_handler; CAB(offset) = fi->offset; } - if (!file_open(fi, lower, dir)) return; +#if 0 /* CAPTIVE */ + if (!file_open(fi, lower, dir)) return 0; +#endif /* CAPTIVE */ err = decompress(fi, 1, fix); if (err) CAB(current) = NULL; else CAB(offset) += fi->length; +#if 0 /* CAPTIVE */ file_close(fi); +#endif /* CAPTIVE */ exit_handler: if (err) { - char *errmsg, *cabname; + const char *errmsg, *cabname; switch (err) { case DECR_NOMEMORY: - errmsg = "out of memory!\n"; break; + errmsg = _("out of memory!"); break; case DECR_ILLEGALDATA: - errmsg = "%s: illegal or corrupt data\n"; break; + errmsg = _("%s: illegal or corrupt data"); break; case DECR_DATAFORMAT: - errmsg = "%s: unsupported data format\n"; break; + errmsg = _("%s: unsupported data format"); break; case DECR_CHECKSUM: - errmsg = "%s: checksum error\n"; break; + errmsg = _("%s: checksum error"); break; case DECR_INPUT: - errmsg = "%s: input error\n"; break; + errmsg = _("%s: input error"); break; case DECR_OUTPUT: - errmsg = "%s: output error\n"; break; + errmsg = _("%s: output error"); break; default: - errmsg = "%s: unknown error (BUG)\n"; + errmsg = _("%s: unknown error (BUG)"); } if (CAB(current)) { @@ -2805,10 +2836,14 @@ exit_handler: cabname = fi->folder->cab[0]->filename; } - fprintf(stderr, errmsg, cabname); + g_warning(errmsg, cabname); + return 0; } + return 1; } +#if 0 /* CAPTIVE */ + /* tries to find *cabname, from the directory path of origcab, correcting the * case of *cabname if necessary, If found, writes back to *cabname. */ @@ -2825,7 +2860,7 @@ void find_cabinet_file(char **cabname, char *origcab) { /* find if there's a directory path in the origcab */ tail = origcab ? strrchr(origcab, '/') : NULL; - if ((cab = (char *) malloc((tail ? tail-origcab : 1) + strlen(name) + 2))) { + if ((cab = (char *) acquire_cabinet_memory_malloc((tail ? tail-origcab : 1) + strlen(name) + 2))) { /* add the directory path from the original cabinet name */ if (tail) { memcpy(cab, origcab, tail-origcab); @@ -2880,15 +2915,16 @@ void find_cabinet_file(char **cabname, char *origcab) { * otherwise, pretend nothing happened */ if (found) { - free((void *) *cabname); + acquire_cabinet_memory_free((void *) *cabname); *cabname = cab; } else { - free((void *) cab); + acquire_cabinet_memory_free((void *) cab); } } } + /* process_cabinet() is called by main() for every file listed on the * command line. It will find every cabinet file in that file, and will * search for every chained cabinet attached to those cabinets, then it @@ -2921,7 +2957,7 @@ int process_cabinet(char *cabname, char *dir, cab1->prevname, cab1->previnfo); find_cabinet_file(&(cab1->prevname), cabname); if (!(cab1->prevcab = load_cab_offset(cab1->prevname, 0))) { - fprintf(stderr, "%s: can't read previous cabinet %s\n", + g_warning(_("%s: can't read previous cabinet %s"), cabname, cab1->prevname); break; } @@ -2934,7 +2970,7 @@ int process_cabinet(char *cabname, char *dir, cab2->nextname, cab2->nextinfo); find_cabinet_file(&(cab2->nextname), cabname); if (!(cab2->nextcab = load_cab_offset(cab2->nextname, 0))) { - fprintf(stderr, "%s: can't read next cabinet %s\n", + g_warning(_("%s: can't read next cabinet %s"), cabname, cab2->nextname); break; } @@ -3031,3 +3067,5 @@ int main(int argc, char *argv[]) { return err; } + +#endif /* CAPTIVE */ diff --git a/src/install/acquire/cabextract/cabextract.h b/src/install/acquire/cabextract/cabextract.h new file mode 100644 index 0000000..6661720 --- /dev/null +++ b/src/install/acquire/cabextract/cabextract.h @@ -0,0 +1,69 @@ +/* $Id$ + * Include file for cabextract - a program to extract Microsoft Cabinet files + * Copyright (C) 2003 Jan Kratochvil + * + * 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; exactly version 2 of June 1991 is required + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#ifndef _CAPTIVE_INSTALL_ACQUIRE_CABEXTRACT_H +#define _CAPTIVE_INSTALL_ACQUIRE_CABEXTRACT_H 1 + + +#include + + +G_BEGIN_DECLS + +typedef unsigned char UBYTE; /* 8 bits exactly */ +typedef unsigned short UWORD; /* 16 bits (or more) */ +typedef unsigned int ULONG; /* 32 bits (or more) */ +typedef signed int LONG; /* 32 bits (or more) */ + +struct cabinet { + struct cabinet *next; /* for making a list of cabinets */ + struct acquire_cabinet *acquire_cabinet; + const char *filename; /* input name of cabinet */ + off_t filelen; /* length of cabinet file */ + off_t blocks_off; /* offset to data blocks in file */ + struct cabinet *prevcab, *nextcab; /* multipart cabinet chains */ + char *prevname, *nextname; /* and their filenames */ + char *previnfo, *nextinfo; /* and their visible names */ + struct folder *folders; /* first folder in this cabinet */ + struct file *files; /* first file in this cabinet */ + UBYTE block_resv; /* reserved space in datablocks */ + UBYTE flags; /* header flags */ +}; + +struct file { + struct file *next; /* next file in sequence */ + struct folder *folder; /* folder that contains this file */ + char *filename; /* output name of file */ +#if 0 + FILE *fh; /* open file handle or NULL */ +#endif + ULONG length; /* uncompressed length of file */ + ULONG offset; /* uncompressed offset in folder */ + UWORD index; /* magic index number of folder */ + UWORD time, date, attribs; /* MS-DOS time/date/attributes */ +}; + +struct cabinet *find_cabs_in_file(struct acquire_cabinet *acquire_cabinet); +struct file *process_files(struct cabinet *basecab); +int extract_file(struct file *fi, int lower, int fix, char *dir); + +G_END_DECLS + + +#endif /* _CAPTIVE_INSTALL_ACQUIRE_CABEXTRACT_H */ diff --git a/src/install/acquire/cabextract/cabextract.spec b/src/install/acquire/cabextract/cabextract.spec deleted file mode 100644 index 537270e..0000000 --- a/src/install/acquire/cabextract/cabextract.spec +++ /dev/null @@ -1,35 +0,0 @@ -Summary: a program to extract Microsoft Cabinet files -Name: cabextract -Version: 0.6 -Release: 1 -Group: Applications/Archiving -Copyright: GPL -Source: http://www.kyz.uklinux.net/downloads/%{name}-%{version}.tar.gz -URL: http://www.kyz.uklinux.net/cabextract.php3 -BuildRoot: %{_tmppath}/%{name}-%{version}-root -Prefix: /usr - -%description -Cabinet (.CAB) files are a form of archive, which Microsoft use to -distribute their software, and things like Windows Font Packs. The -cabextract program simply unpacks such files. - -%prep -%setup - -%build -CFLAGS=${RPM_OPT_FLAGS} ./configure --prefix=%{prefix} -make - -%install -rm -rf ${RPM_BUILD_ROOT} -%makeinstall - -%clean -rm -rf ${RPM_BUILD_ROOT} - -%files -%defattr(0644, root, root, 0755) -%doc AUTHORS ChangeLog NEWS README -%attr(0755, root, root) %{_bindir}/cabextract -%{_mandir}/man1/cabextract.1* diff --git a/src/install/acquire/cabextract/cabextract.spec.in b/src/install/acquire/cabextract/cabextract.spec.in deleted file mode 100644 index f0c7128..0000000 --- a/src/install/acquire/cabextract/cabextract.spec.in +++ /dev/null @@ -1,35 +0,0 @@ -Summary: a program to extract Microsoft Cabinet files -Name: cabextract -Version: @VERSION@ -Release: 1 -Group: Applications/Archiving -Copyright: GPL -Source: http://www.kyz.uklinux.net/downloads/%{name}-%{version}.tar.gz -URL: http://www.kyz.uklinux.net/cabextract.php3 -BuildRoot: %{_tmppath}/%{name}-%{version}-root -Prefix: /usr - -%description -Cabinet (.CAB) files are a form of archive, which Microsoft use to -distribute their software, and things like Windows Font Packs. The -cabextract program simply unpacks such files. - -%prep -%setup - -%build -CFLAGS=${RPM_OPT_FLAGS} ./configure --prefix=%{prefix} -make - -%install -rm -rf ${RPM_BUILD_ROOT} -%makeinstall - -%clean -rm -rf ${RPM_BUILD_ROOT} - -%files -%defattr(0644, root, root, 0755) -%doc AUTHORS ChangeLog NEWS README -%attr(0755, root, root) %{_bindir}/cabextract -%{_mandir}/man1/cabextract.1* diff --git a/src/install/acquire/cabextract/cabinfo.c b/src/install/acquire/cabextract/cabinfo.c deleted file mode 100644 index dd48cd7..0000000 --- a/src/install/acquire/cabextract/cabinfo.c +++ /dev/null @@ -1,497 +0,0 @@ -/* cabinfo -- dumps useful information from cabinets - * (C) 2000 Stuart Caie - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include - -/* structure offsets */ -#define cfhead_Signature (0x00) -#define cfhead_CabinetSize (0x08) -#define cfhead_FileOffset (0x10) -#define cfhead_MinorVersion (0x18) -#define cfhead_MajorVersion (0x19) -#define cfhead_NumFolders (0x1A) -#define cfhead_NumFiles (0x1C) -#define cfhead_Flags (0x1E) -#define cfhead_SetID (0x20) -#define cfhead_CabinetIndex (0x22) -#define cfhead_SIZEOF (0x24) -#define cfheadext_HeaderReserved (0x00) -#define cfheadext_FolderReserved (0x02) -#define cfheadext_DataReserved (0x03) -#define cfheadext_SIZEOF (0x04) -#define cffold_DataOffset (0x00) -#define cffold_NumBlocks (0x04) -#define cffold_CompType (0x06) -#define cffold_SIZEOF (0x08) -#define cffile_UncompressedSize (0x00) -#define cffile_FolderOffset (0x04) -#define cffile_FolderIndex (0x08) -#define cffile_Date (0x0A) -#define cffile_Time (0x0C) -#define cffile_Attribs (0x0E) -#define cffile_SIZEOF (0x10) -#define cfdata_CheckSum (0x00) -#define cfdata_CompressedSize (0x04) -#define cfdata_UncompressedSize (0x06) -#define cfdata_SIZEOF (0x08) - -/* flags */ -#define cffoldCOMPTYPE_MASK (0x000f) -#define cffoldCOMPTYPE_NONE (0x0000) -#define cffoldCOMPTYPE_MSZIP (0x0001) -#define cffoldCOMPTYPE_QUANTUM (0x0002) -#define cffoldCOMPTYPE_LZX (0x0003) -#define cfheadPREV_CABINET (0x0001) -#define cfheadNEXT_CABINET (0x0002) -#define cfheadRESERVE_PRESENT (0x0004) -#define cffileCONTINUED_FROM_PREV (0xFFFD) -#define cffileCONTINUED_TO_NEXT (0xFFFE) -#define cffileCONTINUED_PREV_AND_NEXT (0xFFFF) -#define cffile_A_RDONLY (0x01) -#define cffile_A_HIDDEN (0x02) -#define cffile_A_SYSTEM (0x04) -#define cffile_A_ARCH (0x20) -#define cffile_A_EXEC (0x40) -#define cffile_A_NAME_IS_UTF (0x80) - - -FILE *fh; -char *filename; -unsigned long filelength; -void search(); -void getinfo(); - -#define EndGetI32(a) ((((a)[3])<<24)|(((a)[2])<<16)|(((a)[1])<<8)|((a)[0])) -#define EndGetI16(a) ((((a)[1])<<8)|((a)[0])) -#define GETLONG(n) EndGetI32(&buf[n]) -#define GETWORD(n) EndGetI16(&buf[n]) -#define GETBYTE(n) ((int)buf[n]) - -#define GETOFFSET (ftell(fh)) -#define READ(buf,len) if (myread((void *)(buf),(len))) return -#define SKIP(offset) if (myseek((offset),SEEK_CUR)) return -#define SEEK(offset) if (myseek((offset),SEEK_SET)) return - - - -int myread(void *buf, int length) { - int remain = filelength - GETOFFSET; - if (length > remain) length = remain; - if (fread(buf, 1, length, fh) != length) { - perror(filename); - return 1; - } - return 0; -} - -int myseek(unsigned long offset, int mode) { - if (fseek(fh, offset, mode) != 0) { - perror(filename); - return 1; - } - return 0; -} - -int main(int argc, char *argv[]) { - printf("Cabinet information dumper by Stuart Caie \n"); - - if (argc <= 1) { - printf("Usage: %s \n", argv[0]); - return 1; - } - - if (!(fh = fopen((filename = argv[1]), "rb"))) { - perror(filename); - return 1; - } - - if (fseek(fh, 0, SEEK_END) != 0) { - perror(filename); - fclose(fh); - return 1; - } - - filelength = (unsigned long) ftell(fh); - - if (fseek(fh, 0, SEEK_SET) != 0) { - perror(filename); - fclose(fh); - return 1; - } - - printf("Examining file \"%s\" (%u bytes)...\n", filename, filelength); - search(); - fclose(fh); - return 0; -} - - -#define SEARCH_SIZE (32*1024) -unsigned char search_buf[SEARCH_SIZE]; - -void search() { - unsigned char *pstart = &search_buf[0], *pend, *p; - unsigned long offset, caboff, cablen, foffset; - size_t length; - int state = 0; - - for (offset = 0; offset < filelength; offset += length) { - /* search length is either the full length of the search buffer, - * or the amount of data remaining to the end of the file, - * whichever is less. - */ - length = filelength - offset; - if (length > SEARCH_SIZE) length = SEARCH_SIZE; - - /* fill the search buffer with data from disk */ - SEEK(offset); - READ(&search_buf[0], length); - /* read through the entire buffer. */ - p = pstart; - pend = &search_buf[length]; - while (p < pend) { - switch (state) { - /* starting state */ - case 0: - /* we spend most of our time in this while loop, looking for - * a leading 'M' of the 'MSCF' signature - */ - while (*p++ != 0x4D && p < pend); - if (p < pend) state = 1; /* if we found tht 'M', advance state */ - break; - - /* verify that the next 3 bytes are 'S', 'C' and 'F' */ - case 1: state = (*p++ == 0x53) ? 2 : 0; break; - case 2: state = (*p++ == 0x43) ? 3 : 0; break; - case 3: state = (*p++ == 0x46) ? 4 : 0; break; - - /* we don't care about bytes 4-7 */ - /* bytes 8-11 are the overall length of the cabinet */ - case 8: cablen = *p++; state++; break; - case 9: cablen |= *p++ << 8; state++; break; - case 10: cablen |= *p++ << 16; state++; break; - case 11: cablen |= *p++ << 24; state++; break; - - /* we don't care about bytes 12-15 */ - /* bytes 16-19 are the offset within the cabinet of the filedata */ - case 16: foffset = *p++; state++; break; - case 17: foffset |= *p++ << 8; state++; break; - case 18: foffset |= *p++ << 16; state++; break; - case 19: foffset |= *p++ << 24; - /* now we have recieved 20 bytes of potential cab header. */ - /* work out the offset in the file of this potential cabinet */ - caboff = offset + (p-pstart) - 20; - /* check that the files offset is less than the alleged length - * of the cabinet, and that the offset + the alleged length are - * 'roughly' within the end of overall file length - */ - if ((foffset < cablen) && - ((caboff + foffset) < (filelength + 32)) && - ((caboff + cablen) < (filelength + 32)) ) - { - /* found a potential result - try loading it */ - printf("Found cabinet header at offset %u\n", caboff); - SEEK(caboff); - getinfo(); - offset = caboff + cablen; - length = 0; - p = pend; - } - state = 0; - break; - - default: - p++, state++; break; - } /* switch state */ - } /* while p < pend */ - } /* while offset < filelength */ -} - - - - - -#define CAB_NAMEMAX (1024) - -/* UTF translates two-byte unicode characters into 1, 2 or 3 bytes. - * %000000000xxxxxxx -> %0xxxxxxx - * %00000xxxxxyyyyyy -> %110xxxxx %10yyyyyy - * %xxxxyyyyyyzzzzzz -> %1110xxxx %10yyyyyy %10zzzzzz - * - * Therefore, the inverse is as follows: - * First char: - * 0x00 - 0x7F = one byte char - * 0x80 - 0xBF = invalid - * 0xC0 - 0xDF = 2 byte char (next char only 0x80-0xBF is valid) - * 0xE0 - 0xEF = 3 byte char (next 2 chars only 0x80-0xBF is valid) - * 0xF0 - 0xFF = invalid - */ - -/* translate UTF -> ASCII */ -int convertUTF(unsigned char *in) { - unsigned char c, *out = in, *end = in + strlen(in) + 1; - unsigned int x; - - do { - /* read unicode character */ - if ((c = *in++) < 0x80) x = c; - else { - if (c < 0xC0) return 0; - else if (c < 0xE0) { - x = (c & 0x1F) << 6; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F); - } - else if (c < 0xF0) { - x = (c & 0xF) << 12; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F)<<6; - if ((c = *in++) < 0x80 || c > 0xBF) return 0; else x |= (c & 0x3F); - } - else return 0; - } - - /* terrible unicode -> ASCII conversion */ - if (x > 127) x = '_'; - - if (in > end) return 0; /* just in case */ - } while ((*out++ = (unsigned char) x)); - return 1; -} - - - -void getinfo() { - unsigned char buf[64]; - unsigned char namebuf[CAB_NAMEMAX]; - char *name; - - int num_folders, num_files, num_blocks = 0; - int header_res = 0, folder_res = 0, data_res = 0; - int i, x, offset, base_offset, files_offset, base; - - base_offset = GETOFFSET; - - READ(&buf, cfhead_SIZEOF); - - x = GETWORD(cfhead_Flags); - - printf( - "\n*** HEADER SECTION ***\n\n" - "Cabinet signature = '%4.4s'\n" - "Cabinet size = %u bytes\n" - "Offset of files = %u\n" - "Cabinet format version = %d.%d\n" - "Number of folders = %u\n" - "Number of files = %u\n" - "Header flags = 0x%04x%s%s%s\n" - "Set ID = %u\n" - "Cabinet set index = %u\n", - - buf, - GETLONG(cfhead_CabinetSize), - files_offset = (GETLONG(cfhead_FileOffset) + base_offset), - GETBYTE(cfhead_MajorVersion), - GETBYTE(cfhead_MinorVersion), - num_folders = GETWORD(cfhead_NumFolders), - num_files = GETWORD(cfhead_NumFiles), - x, - ((x & cfheadPREV_CABINET) ? " PREV_CABINET" : ""), - ((x & cfheadNEXT_CABINET) ? " NEXT_CABINET" : ""), - ((x & cfheadRESERVE_PRESENT) ? " RESERVE_PRESENT" : ""), - GETWORD(cfhead_SetID), - GETWORD(cfhead_CabinetIndex) - ); - - if (num_folders == 0) { printf("ERROR: no folders\n"); return; } - if (num_files == 0) { printf("ERROR: no files\n"); return; } - - if (buf[0]!='M' || buf[1]!='S' || buf[2]!='C' || buf[3]!='F') - printf("WARNING: cabinet doesn't start with MSCF signature\n"); - - if (GETBYTE(cfhead_MajorVersion) > 1 - || GETBYTE(cfhead_MinorVersion) > 3) - printf("WARNING: format version > 1.3\n"); - - - - if (x & cfheadRESERVE_PRESENT) { - READ(&buf, cfheadext_SIZEOF); - header_res = GETWORD(cfheadext_HeaderReserved); - folder_res = GETBYTE(cfheadext_FolderReserved); - data_res = GETBYTE(cfheadext_DataReserved); - } - - printf("Reserved header space = %u\n", header_res); - printf("Reserved folder space = %u\n", folder_res); - printf("Reserved datablk space = %u\n", data_res); - - if (header_res > 60000) - printf("WARNING: header reserved space > 60000\n"); - - if (header_res) { - printf("[Reserved header: offset %lu, size %u]\n", GETOFFSET, header_res); - SKIP(header_res); - } - - if (x & cfheadPREV_CABINET) { - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - printf("Previous cabinet file = %s\n", namebuf); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - printf("Previous disk name = %s\n", namebuf); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - } - - if (x & cfheadNEXT_CABINET) { - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - printf("Next cabinet file = %s\n", namebuf); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - printf("Next disk name = %s\n", namebuf); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - } - - printf("\n*** FOLDERS SECTION ***\n"); - - for (i = 0; i < num_folders; i++) { - offset = GETOFFSET; - READ(&buf, cffold_SIZEOF); - - switch(GETWORD(cffold_CompType) & cffoldCOMPTYPE_MASK) { - case cffoldCOMPTYPE_NONE: name = "stored"; break; - case cffoldCOMPTYPE_MSZIP: name = "MSZIP"; break; - case cffoldCOMPTYPE_QUANTUM: name = "Quantum"; break; - case cffoldCOMPTYPE_LZX: name = "LZX"; break; - default: name = "unknown"; break; - } - - printf( - "\n[New folder at offset %u]\n" - "Offset of folder = %u\n" - "Num. blocks in folder = %u\n" - "Compression type = 0x%04x [%s]\n", - - offset, - base_offset + GETLONG(cffold_DataOffset), - GETWORD(cffold_NumBlocks), - GETWORD(cffold_CompType), - name - ); - - num_blocks += GETWORD(cffold_NumBlocks); - - if (folder_res) { - printf("[Reserved folder: offset %lu, size %u]\n", GETOFFSET, folder_res); - SKIP(folder_res); - } - } - - printf("\n*** FILES SECTION ***\n"); - - if (GETOFFSET != files_offset) { - printf("WARNING: weird file offset in header\n"); - SEEK(files_offset); - } - - - for (i = 0; i < num_files; i++) { - offset = GETOFFSET; - READ(&buf, cffile_SIZEOF); - - switch (GETWORD(cffile_FolderIndex)) { - case cffileCONTINUED_PREV_AND_NEXT: - name = "continued from previous and to next cabinet"; - break; - case cffileCONTINUED_FROM_PREV: - name = "continued from previous cabinet"; - break; - case cffileCONTINUED_TO_NEXT: - name = "continued to next cabinet"; - break; - default: - name = "normal folder"; - break; - } - - x = GETWORD(cffile_Attribs); - - base = GETOFFSET; - READ(&namebuf, CAB_NAMEMAX); - SEEK(base + strlen(namebuf) + 1); - if (strlen(namebuf) > 256) printf("WARNING: name length > 256\n"); - - /* convert filename */ - if (x & cffile_A_NAME_IS_UTF) { - if (!convertUTF(namebuf)) printf("WARNING: invalid UTF filename"); - } - - printf( - "\n[New file at offset %u]\n" - "File name = %s\n" - "File size = %u bytes\n" - "Offset within folder = %u\n" - "Folder index = 0x%04x [%s]\n" - "Date / time = %02d/%02d/%4d %02d:%02d:%02d\n" - "File attributes = 0x%02x %s%s%s%s%s\n", - offset, - namebuf, - GETLONG(cffile_UncompressedSize), - GETLONG(cffile_FolderOffset), - GETWORD(cffile_FolderIndex), - name, - GETWORD(cffile_Date) & 0x1f, - (GETWORD(cffile_Date)>>5) & 0xf, - (GETWORD(cffile_Date)>>9) + 1980, - GETWORD(cffile_Time) >> 11, - (GETWORD(cffile_Time)>>5) & 0x3f, - (GETWORD(cffile_Time) << 1) & 0x3e, - x, - (x & cffile_A_RDONLY) ? "RDONLY " : "", - (x & cffile_A_HIDDEN) ? "HIDDEN " : "", - (x & cffile_A_SYSTEM) ? "SYSTEM " : "", - (x & cffile_A_ARCH) ? "ARCH " : "", - (x & cffile_A_EXEC) ? "EXEC " : "" - ); - } - - printf("\n*** DATABLOCKS SECTION ***\n"); - printf("*** Note: offset is BLOCK offset. Add 8 for DATA offset! ***\n\n"); - - for (i = 0; i < num_blocks; i++) { - offset = GETOFFSET; - READ(&buf, cfdata_SIZEOF); - printf("Block %5d: offset %10d / csum %08x / c=%5d / u=%5d\n", - i, offset, GETLONG(cfdata_CheckSum), - x = GETWORD(cfdata_CompressedSize), - GETWORD(cfdata_UncompressedSize) - ); - SKIP(x); - } - -} diff --git a/src/install/acquire/cabextract/config.h.in b/src/install/acquire/cabextract/config.h.in deleted file mode 100644 index eba9169..0000000 --- a/src/install/acquire/cabextract/config.h.in +++ /dev/null @@ -1,89 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* Define to `int' if doesn't define. */ -#undef mode_t - -/* Define to `long' if doesn't define. */ -#undef off_t - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define if you have the getopt_long function. */ -#undef HAVE_GETOPT_LONG - -/* Define if you have the memcpy function. */ -#undef HAVE_MEMCPY - -/* Define if you have the mktime function. */ -#undef HAVE_MKTIME - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the strchr function. */ -#undef HAVE_STRCHR - -/* Define if you have the utime function. */ -#undef HAVE_UTIME - -/* Define if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define if you have the header file. */ -#undef HAVE_GETOPT_H - -/* Define if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the header file. */ -#undef HAVE_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the header file. */ -#undef HAVE_STRING_H - -/* Define if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_DIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_NDIR_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define if you have the header file. */ -#undef HAVE_UTIME_H - -/* Name of package */ -#undef PACKAGE - -/* Version number of package */ -#undef VERSION - diff --git a/src/install/acquire/cabextract/configure b/src/install/acquire/cabextract/configure deleted file mode 100755 index c2dbc06..0000000 --- a/src/install/acquire/cabextract/configure +++ /dev/null @@ -1,2302 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -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' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -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 - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # 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 ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$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" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) 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) - # 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 << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$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) - 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 ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - 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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# 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 - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=cabextract.c - -# 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_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - 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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# 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 "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:559: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:612: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:669: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE=cabextract - -VERSION=0.6 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:715: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:728: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:741: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:754: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:767: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:784: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:814: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:865: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:897: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 908 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:939: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:944: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:972: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1015: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1068: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1101: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1132: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.$ac_ext | *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi - -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT - - - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1165: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1245: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1349: checking whether time.h and sys/time.h may both be included" >&5 -if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -int main() { -struct tm *tp; -; return 0; } -EOF -if { (eval echo configure:1363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_header_time=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_time=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_time" 1>&6 -if test $ac_cv_header_time = yes; then - cat >> confdefs.h <<\EOF -#define TIME_WITH_SYS_TIME 1 -EOF - -fi - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1388: checking for $ac_hdr that defines DIR" >&5 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include <$ac_hdr> -int main() { -DIR *dirp = 0; -; return 0; } -EOF -if { (eval echo configure:1401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1426: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 -fi - -else -echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1467: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lx $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lx" -else - echo "$ac_t""no" 1>&6 -fi - -fi - -for ac_hdr in ctype.h limits.h stdlib.h string.h strings.h \ - utime.h sys/stat.h sys/time.h sys/types.h getopt.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1513: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1551: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:1605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1626: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_inline=$ac_kw; break -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -done - -fi - -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in - inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline -EOF - ;; - *) cat >> confdefs.h <&6 -echo "configure:1666: checking for mode_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_mode_t=yes -else - rm -rf conftest* - ac_cv_type_mode_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_mode_t" 1>&6 -if test $ac_cv_type_mode_t = no; then - cat >> confdefs.h <<\EOF -#define mode_t int -EOF - -fi - -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1699: checking for off_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_off_t=yes -else - rm -rf conftest* - ac_cv_type_off_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF -#define off_t long -EOF - -fi - -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1732: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF - -fi - - -for ac_func in strchr strcasecmp memcpy utime -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1768: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -fi -done - -for ac_func in mktime -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1823: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" -fi -done - - - -for ac_func in getopt_long -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1881: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS getopt.o getopt1.o" -fi -done - - -trap '' 1 2 15 -cat > confcache <<\EOF -# 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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# 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 \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile cabextract.spec config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@EXEEXT@%$EXEEXT%g -s%@CPP@%$CPP%g -s%@LIBOBJS@%$LIBOBJS%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# 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_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # 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" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/src/install/acquire/cabextract/configure.in b/src/install/acquire/cabextract/configure.in deleted file mode 100644 index 14531a8..0000000 --- a/src/install/acquire/cabextract/configure.in +++ /dev/null @@ -1,34 +0,0 @@ -.dnl Process this file with autoconf to produce a configure script. -AC_INIT(cabextract.c) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(cabextract, 0.6) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_INSTALL -AC_EXEEXT - -dnl Checks for libraries. - -dnl Checks for header files. -AC_HEADER_STDC -AC_HEADER_TIME -AC_HEADER_DIRENT -AC_CHECK_HEADERS(ctype.h limits.h stdlib.h string.h strings.h \ - utime.h sys/stat.h sys/time.h sys/types.h getopt.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_C_INLINE -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_CHECK_FUNCS(strchr strcasecmp memcpy utime) -AC_REPLACE_FUNCS(mktime) - -dnl check for getopt in standard library -AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) - -AC_OUTPUT(Makefile cabextract.spec) diff --git a/src/install/acquire/cabextract/debian/README.Debian b/src/install/acquire/cabextract/debian/README.Debian deleted file mode 100644 index 5c285db..0000000 --- a/src/install/acquire/cabextract/debian/README.Debian +++ /dev/null @@ -1,6 +0,0 @@ -cabextract for Debian ----------------------- - -This was packaged for debian to help msttcorefonts work better. - - -- Eric Sharkey , Thu, 11 Jan 2001 13:05:48 -0500 diff --git a/src/install/acquire/cabextract/debian/changelog b/src/install/acquire/cabextract/debian/changelog deleted file mode 100644 index 29983f8..0000000 --- a/src/install/acquire/cabextract/debian/changelog +++ /dev/null @@ -1,45 +0,0 @@ -cabextract (0.6-1) unstable; urgency=low - - * New upstream release - - -- Stuart Caie Mon, 29 Jul 2002 13:31:37 +0100 - -cabextract (0.5-1) unstable; urgency=low - - * New upstream release (Closes: #123961) - - -- Eric Sharkey Mon, 6 May 2002 20:07:25 -0400 - -cabextract (0.2-2) unstable; urgency=low - - * Specify path to configure script (Closes: #89269) - - -- Eric Sharkey Sun, 11 Mar 2001 22:17:10 -0500 - -cabextract (0.2-1) unstable; urgency=low - - * New Upstream Release - - -- Eric Sharkey Tue, 6 Mar 2001 11:55:58 -0500 - -cabextract (0.1-3) unstable; urgency=low - - * Fix grammar: Closes: #82794 - - -- Eric Sharkey Fri, 26 Jan 2001 15:16:55 -0500 - -cabextract (0.1-2) unstable; urgency=low - - * Ignore documentation in New Maintainer's guide and install into - debian/cabextract rather than debian/tmp - * Closes: #83237 - - -- Eric Sharkey Wed, 24 Jan 2001 15:50:30 -0500 - -cabextract (0.1-1) unstable; urgency=low - - * Initial Release. - * Closes: 81492 - - -- Eric Sharkey Thu, 11 Jan 2001 13:05:48 -0500 - diff --git a/src/install/acquire/cabextract/debian/control b/src/install/acquire/cabextract/debian/control deleted file mode 100644 index 92cb470..0000000 --- a/src/install/acquire/cabextract/debian/control +++ /dev/null @@ -1,14 +0,0 @@ -Source: cabextract -Section: utils -Priority: extra -Maintainer: Eric Sharkey -Build-Depends: debhelper (>> 2.0.0) -Standards-Version: 3.2.1 - -Package: cabextract -Architecture: any -Depends: ${shlibs:Depends} -Description: a program to extract Microsoft Cabinet files - Cabextract is a program which unpacks cabinet (.cab) files, which - are a form of archive Microsoft uses to distribute their software - and things like Windows Font Packs. diff --git a/src/install/acquire/cabextract/debian/copyright b/src/install/acquire/cabextract/debian/copyright deleted file mode 100644 index c4be8f9..0000000 --- a/src/install/acquire/cabextract/debian/copyright +++ /dev/null @@ -1,13 +0,0 @@ -This package was debianized by Eric Sharkey on -Thu, 11 Jan 2001 13:05:48 -0500. - -It was downloaded from http://www.kyz.uklinux.net/cabextract.php3 - -Upstream Author(s): Stuart Caie - -Copyright: - -You are free to distribute this software under the terms of -the GNU General Public License. -On Debian systems, the complete text of the GNU General Public -License can be found in /usr/share/common-licenses/GPL file. diff --git a/src/install/acquire/cabextract/debian/dirs b/src/install/acquire/cabextract/debian/dirs deleted file mode 100644 index adee15e..0000000 --- a/src/install/acquire/cabextract/debian/dirs +++ /dev/null @@ -1,5 +0,0 @@ -usr -usr/bin -usr/share -usr/share/doc -usr/share/doc/cabextract diff --git a/src/install/acquire/cabextract/debian/docs b/src/install/acquire/cabextract/debian/docs deleted file mode 100644 index 86dfdb8..0000000 --- a/src/install/acquire/cabextract/debian/docs +++ /dev/null @@ -1,3 +0,0 @@ -README -NEWS -AUTHORS diff --git a/src/install/acquire/cabextract/debian/rules b/src/install/acquire/cabextract/debian/rules deleted file mode 100755 index 201f9c4..0000000 --- a/src/install/acquire/cabextract/debian/rules +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# This is the debhelper compatability version to use. -export DH_COMPAT=2 - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - ./configure --prefix=$(CURDIR)/debian/cabextract/usr --mandir=$(CURDIR)/debian/cabextract/usr/share/man --infodir=$(CURDIR)/debian/cabextract/usr/share/info - - - touch configure-stamp - -build: configure-stamp build-stamp -build-stamp: - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - #/usr/bin/docbook-to-man debian/cabextract.sgml > cabextract.1 - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) clean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/cabextract. - \$(MAKE) install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot -# dh_installdebconf - dh_installdocs - dh_installexamples - dh_installmenu -# dh_installemacsen -# dh_installpam -# dh_installinit - dh_installcron - dh_installmanpages - dh_installinfo -# dh_undocumented - dh_installchangelogs - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_makeshlibs - dh_installdeb -# dh_perl - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/src/install/acquire/cabextract/getopt.c b/src/install/acquire/cabextract/getopt.c deleted file mode 100644 index 4744e43..0000000 --- a/src/install/acquire/cabextract/getopt.c +++ /dev/null @@ -1,1055 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to drepper@gnu.org - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 - Free Software Foundation, Inc. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library 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 Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -# define _NO_PROTO -#endif - -#ifdef HAVE_CONFIG_H -# include -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -# ifndef const -# define const -# endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -# include -# include -#endif /* GNU C library. */ - -#ifdef VMS -# include -# if HAVE_STRING_H - 0 -# include -# endif -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -# ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -# else -# define _(msgid) (msgid) -# endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -# include -# define my_index strchr -#else - -# if HAVE_STRING_H -# include -# else -# include -# endif - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -#ifndef getenv -extern char *getenv (); -#endif - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -# if (!defined __STDC__ || !__STDC__) && !defined strlen -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -# endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -# ifdef text_set_element -text_set_element (__libc_subinit, store_args_and_env); -# endif /* text_set_element */ - -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined __STDC__ && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#ifdef _LIBC - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memset (__mempcpy (new_str, __getopt_nonoption_flags, - nonoption_flags_max_len), - '\0', top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined __STDC__ && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), - '\0', nonoption_flags_max_len - len); - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - int print_errors = opterr; - if (optstring[0] == ':') - print_errors = 0; - - optarg = NULL; - - if (optind == 0 || !__getopt_initialized) - { - if (optind == 0) - optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = _getopt_initialize (argc, argv, optstring); - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && __getopt_nonoption_flags[optind] == '1')) -#else -# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (print_errors) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (print_errors) - { - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - } - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (print_errors) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (print_errors) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (print_errors) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (print_errors) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (print_errors) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (print_errors) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (print_errors) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (print_errors) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/src/install/acquire/cabextract/getopt.h b/src/install/acquire/cabextract/getopt.h deleted file mode 100644 index b0147e9..0000000 --- a/src/install/acquire/cabextract/getopt.h +++ /dev/null @@ -1,169 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library 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 Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _GETOPT_H - -#ifndef __need_getopt -# define _GETOPT_H 1 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -#ifndef __need_getopt -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -# if defined __STDC__ && __STDC__ - const char *name; -# else - char *name; -# endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -# define no_argument 0 -# define required_argument 1 -# define optional_argument 2 -#endif /* need getopt */ - - -/* Get definitions and prototypes for functions to process the - arguments in ARGV (ARGC of them, minus the program name) for - options given in OPTS. - - Return the option character from OPTS just read. Return -1 when - there are no more options. For unrecognized options, or options - missing arguments, `optopt' is set to the option letter, and '?' is - returned. - - The OPTS string is a list of characters which are recognized option - letters, optionally followed by colons, specifying that that letter - takes an argument, to be placed in `optarg'. - - If a letter in OPTS is followed by two colons, its argument is - optional. This behavior is specific to the GNU `getopt'. - - The argument `--' causes premature termination of argument - scanning, explicitly telling `getopt' that there are no more - options. - - If OPTS begins with `--', then non-option arguments are treated as - arguments to the option '\0'. This behavior is specific to the GNU - `getopt'. */ - -#if defined __STDC__ && __STDC__ -# ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int __argc, char *const *__argv, const char *__shortopts); -# else /* not __GNU_LIBRARY__ */ -extern int getopt (); -# endif /* __GNU_LIBRARY__ */ - -# ifndef __need_getopt -extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, - const struct option *__longopts, int *__longind); -extern int getopt_long_only (int __argc, char *const *__argv, - const char *__shortopts, - const struct option *__longopts, int *__longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int __argc, char *const *__argv, - const char *__shortopts, - const struct option *__longopts, int *__longind, - int __long_only); -# endif -#else /* not __STDC__ */ -extern int getopt (); -# ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -# endif -#endif /* __STDC__ */ - -#ifdef __cplusplus -} -#endif - -/* Make sure we later can get all the definitions and declarations. */ -#undef __need_getopt - -#endif /* getopt.h */ diff --git a/src/install/acquire/cabextract/getopt1.c b/src/install/acquire/cabextract/getopt1.c deleted file mode 100644 index 3d264f2..0000000 --- a/src/install/acquire/cabextract/getopt1.c +++ /dev/null @@ -1,188 +0,0 @@ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library 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 Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "getopt.h" - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/src/install/acquire/cabextract/install-sh b/src/install/acquire/cabextract/install-sh deleted file mode 100755 index c122ef9..0000000 --- a/src/install/acquire/cabextract/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/src/install/acquire/cabextract/ja/cabextract.1 b/src/install/acquire/cabextract/ja/cabextract.1 deleted file mode 100644 index 8ea871c..0000000 --- a/src/install/acquire/cabextract/ja/cabextract.1 +++ /dev/null @@ -1,70 +0,0 @@ -.TH CABEXTRACT 1 "2001ǯ 8·î 2Æü" -.SH ̾Á° -cabextract \- Microsoft cabinet (.cab) archives ¤«¤é¥Õ¥¡¥¤¥ë¤ò²òÅह¤ë¥×¥í¥°¥é¥à -.SH ½ñ¼° -.B cabextract -.RB [ -v ] -.RB [ -h ] -.RB [ -l ] -.RB [ -q ] -.RB [ -L ] -.RB [ -f ] -.RB [ -d \fIdir\fP ] -.I " ¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë" ... -.SH ¾ÜºÙ -.B cabextract -¤Ï¡¢Microsoft ¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë·Á¼° (.cab) ¤Þ¤¿¤Ï¡¢ -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤¬Ëä¤á¹þ¤Þ¤ì¤¿¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë (¤è¤¯ .exe ¥Õ¥¡¥¤¥ë¤Ç¸«¤Ä¤«¤ë) -¤«¤é²òÅह¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£ -.PP -.B cabextract -¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¾å¤Ç»ØÄꤵ¤ì¤¿Á´¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤«¤é -¥Õ¥¡¥¤¥ë¤òÃê½Ð¤¹¤ë¤Ç¤·¤ç¤¦¡£ -.PP -´ö¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¤Ëʬ³ä¤µ¤ì¤¿¥Þ¥ë¥Á¥Ñ¡¼¥È¤Î¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë -¤Î¾ì¹ç¤Ï¡¢ -.I ºÇ½é¤Î -¥Õ¥¡¥¤¥ë¤Î¤ß¤ò -.B cabextract -¤Î°ú¿ô¤ËÍ¿¤¨¤ì¤Ð¡¢»Ä¤ê¤Î¥Õ¥¡¥¤¥ë¤ò¼«Æ°Åª¤Ë¸¡½Ð¤·¤Þ¤¹¡£ -.SH ¥ª¥×¥·¥ç¥ó -¥ª¥×¥·¥ç¥ó¤ÎÍ×Ìó¤Ï¡¢°Ê²¼¤ò»²¾È²¼¤µ¤¤¡£ -.TP -.B \-v -¥³¥Þ¥ó¥É¥é¥¤¥ó¤«¤é¡¢Ã±ÆȤǻØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢ -.B cabextract -¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òɽ¼¨¤·¤Æ½ªÎ»¤·¤Þ¤¹¡£ -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¤È¤òÍ¿¤¨¤¿¾ì¹ç¤Ï¡¢ -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£ -.TP -.B \-h -¥Ø¥ë¥×¤Î¥Ú¡¼¥¸¤òɽ¼¨¤·½ªÎ»¤·¤Þ¤¹¡£ -.TP -.B \-l -¤½¤ì¤é¤òÃê½Ð¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ -Í¿¤¨¤é¤ì¤¿¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£ -.TP -.B \-q -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤òÃê½Ð¤¹¤ë¾ì¹ç¡¢ -¥¨¥é¡¼¤È·Ù¹ð¥á¥Ã¥»¡¼¥¸¤ò½ü¤­¡¢Á´¤Æ¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤»¤ó¡£ -.TP -.B \-L -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤òÃê½Ð¤¹¤ë¾ì¹ç¡¢ -³Æ²òÅव¤ì¤¿¥Õ¥¡¥¤¥ë̾¤ò¾®Ê¸»ú¤È¤·¤ÆºîÀ®¤¹¤ë¡£ -.TP -.B \-f -¥­¥ã¥Ó¥Í¥Ã¥È¥Õ¥¡¥¤¥ë¤òÃê½Ð¤¹¤ë¾ì¹ç¡¢ -ÌäÂ꤬¤¢¤Ã¤¿ MSZIP¥Ö¥í¥Ã¥¯¤ò̵»ë¤·¤Þ¤¹¡£ -ÌäÂ꤬¤¢¤Ã¤¿ MSZIP¥Ö¥í¥Ã¥¯¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ -·Ù¹ð¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡£ -.TP -.B \-d \fIdir\fP -¥Ç¥£¥ì¥¯¥È¥ê \fIdir\fP ¤ËÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò²òÅष¤Þ¤¹¡£ -.SH Ãø¼Ô -¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¡¢ -Stuart Caie ¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¡¢ -Debian GNU/Linux ¥·¥¹¥Æ¥à¤Î¤¿¤á¤Ë¡¢ -Eric Sharkey ¤Î¤ß¤Ë¤è¤Ã¤Æ¥Ù¡¼¥¹¤¬½ñ¤«¤ì¤Þ¤·¤¿¡£ -.SH Ìõ¼Ô -ÆüËܸìÌõ¤Ï¡¢Katsumi Saito ¤¬ -¹Ô¤¤¤Þ¤·¤¿¡£ diff --git a/src/install/acquire/cabextract/magic.cabinet b/src/install/acquire/cabextract/magic.cabinet deleted file mode 100644 index 72d0bff..0000000 --- a/src/install/acquire/cabextract/magic.cabinet +++ /dev/null @@ -1,6 +0,0 @@ -#------------------------------------------------------------------------------ -# Microsoft Cabinet files -# -# From (part of cabextract package) -0 string \x4D\x53\x43\x46 Microsoft Cabinet file - diff --git a/src/install/acquire/cabextract/missing b/src/install/acquire/cabextract/missing deleted file mode 100755 index d46f79f..0000000 --- a/src/install/acquire/cabextract/missing +++ /dev/null @@ -1,198 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. - -# 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, 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., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.in; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`$configure_ac'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`$configure_ac'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`$configure_ac'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/src/install/acquire/cabextract/mkinstalldirs b/src/install/acquire/cabextract/mkinstalldirs deleted file mode 100755 index 6b3b5fc..0000000 --- a/src/install/acquire/cabextract/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id$ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/src/install/acquire/cabextract/mktime.c b/src/install/acquire/cabextract/mktime.c deleted file mode 100644 index b63fa05..0000000 --- a/src/install/acquire/cabextract/mktime.c +++ /dev/null @@ -1,541 +0,0 @@ -/* mktime: convert a `struct tm' to a time_t value - Copyright (C) 1993-1997, 1998 Free Software Foundation, Inc. - Contributed by Paul Eggert (eggert@twinsun.com). - - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -/* Define this to have a standalone program to test this implementation of - mktime. */ -/* #define DEBUG 1 */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef _LIBC -# define HAVE_LIMITS_H 1 -# define STDC_HEADERS 1 -#endif - -/* Assume that leap seconds are possible, unless told otherwise. - If the host has a `zic' command with a `-L leapsecondfilename' option, - then it supports leap seconds; otherwise it probably doesn't. */ -#ifndef LEAP_SECONDS_POSSIBLE -# define LEAP_SECONDS_POSSIBLE 1 -#endif - -#include /* Some systems define `time_t' here. */ -#include - -#if HAVE_LIMITS_H -# include -#endif - -#if DEBUG -# include -# if STDC_HEADERS -# include -# endif -/* Make it work even if the system's libc has its own mktime routine. */ -# define mktime my_mktime -#endif /* DEBUG */ - -#ifndef __P -# if defined (__GNUC__) || (defined (__STDC__) && __STDC__) -# define __P(args) args -# else -# define __P(args) () -# endif /* GCC. */ -#endif /* Not __P. */ - -#ifndef CHAR_BIT -# define CHAR_BIT 8 -#endif - -/* The extra casts work around common compiler bugs. */ -#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) -/* The outer cast is needed to work around a bug in Cray C 5.0.3.0. - It is necessary at least when t == time_t. */ -#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ - ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0)) -#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) - -#ifndef INT_MIN -# define INT_MIN TYPE_MINIMUM (int) -#endif -#ifndef INT_MAX -# define INT_MAX TYPE_MAXIMUM (int) -#endif - -#ifndef TIME_T_MIN -# define TIME_T_MIN TYPE_MINIMUM (time_t) -#endif -#ifndef TIME_T_MAX -# define TIME_T_MAX TYPE_MAXIMUM (time_t) -#endif - -#define TM_YEAR_BASE 1900 -#define EPOCH_YEAR 1970 - -#ifndef __isleap -/* Nonzero if YEAR is a leap year (every 4 years, - except every 100th isn't, and every 400th is). */ -# define __isleap(year) \ - ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) -#endif - -/* How many days come before each month (0-12). */ -const unsigned short int __mon_yday[2][13] = - { - /* Normal years. */ - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, - /* Leap years. */ - { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } - }; - -static struct tm *ranged_convert __P ((struct tm *(*) __P ((const time_t *, - struct tm *)), - time_t *, struct tm *)); -static time_t ydhms_tm_diff __P ((int, int, int, int, int, const struct tm *)); -time_t __mktime_internal __P ((struct tm *, - struct tm *(*) (const time_t *, struct tm *), - time_t *)); - - -#ifdef _LIBC -# define my_mktime_localtime_r __localtime_r -#else -/* If we're a mktime substitute in a GNU program, then prefer - localtime to localtime_r, since many localtime_r implementations - are buggy. */ -static struct tm *my_mktime_localtime_r __P ((const time_t *, struct tm *)); -static struct tm * -my_mktime_localtime_r (t, tp) - const time_t *t; - struct tm *tp; -{ - struct tm *l = localtime (t); - if (! l) - return 0; - *tp = *l; - return tp; -} -#endif /* ! _LIBC */ - - -/* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP), - measured in seconds, ignoring leap seconds. - YEAR uses the same numbering as TM->tm_year. - All values are in range, except possibly YEAR. - If TP is null, return a nonzero value. - If overflow occurs, yield the low order bits of the correct answer. */ -static time_t -ydhms_tm_diff (year, yday, hour, min, sec, tp) - int year, yday, hour, min, sec; - const struct tm *tp; -{ - if (!tp) - return 1; - else - { - /* Compute intervening leap days correctly even if year is negative. - Take care to avoid int overflow. time_t overflow is OK, since - only the low order bits of the correct time_t answer are needed. - Don't convert to time_t until after all divisions are done, since - time_t might be unsigned. */ - int a4 = (year >> 2) + (TM_YEAR_BASE >> 2) - ! (year & 3); - int b4 = (tp->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (tp->tm_year & 3); - int a100 = a4 / 25 - (a4 % 25 < 0); - int b100 = b4 / 25 - (b4 % 25 < 0); - int a400 = a100 >> 2; - int b400 = b100 >> 2; - int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); - time_t years = year - (time_t) tp->tm_year; - time_t days = (365 * years + intervening_leap_days - + (yday - tp->tm_yday)); - return (60 * (60 * (24 * days + (hour - tp->tm_hour)) - + (min - tp->tm_min)) - + (sec - tp->tm_sec)); - } -} - - -static time_t localtime_offset; - -/* Convert *TP to a time_t value. */ -time_t -mktime (tp) - struct tm *tp; -{ -#ifdef _LIBC - /* POSIX.1 8.1.1 requires that whenever mktime() is called, the - time zone names contained in the external variable `tzname' shall - be set as if the tzset() function had been called. */ - __tzset (); -#endif - - return __mktime_internal (tp, my_mktime_localtime_r, &localtime_offset); -} - -/* Use CONVERT to convert *T to a broken down time in *TP. - If *T is out of range for conversion, adjust it so that - it is the nearest in-range value and then convert that. */ -static struct tm * -ranged_convert (convert, t, tp) - struct tm *(*convert) __P ((const time_t *, struct tm *)); - time_t *t; - struct tm *tp; -{ - struct tm *r; - - if (! (r = (*convert) (t, tp)) && *t) - { - time_t bad = *t; - time_t ok = 0; - struct tm tm; - - /* BAD is a known unconvertible time_t, and OK is a known good one. - Use binary search to narrow the range between BAD and OK until - they differ by 1. */ - while (bad != ok + (bad < 0 ? -1 : 1)) - { - time_t mid = *t = (bad < 0 - ? bad + ((ok - bad) >> 1) - : ok + ((bad - ok) >> 1)); - if ((r = (*convert) (t, tp))) - { - tm = *r; - ok = mid; - } - else - bad = mid; - } - - if (!r && ok) - { - /* The last conversion attempt failed; - revert to the most recent successful attempt. */ - *t = ok; - *tp = tm; - r = tp; - } - } - - return r; -} - - -/* Convert *TP to a time_t value, inverting - the monotonic and mostly-unit-linear conversion function CONVERT. - Use *OFFSET to keep track of a guess at the offset of the result, - compared to what the result would be for UTC without leap seconds. - If *OFFSET's guess is correct, only one CONVERT call is needed. */ -time_t -__mktime_internal (tp, convert, offset) - struct tm *tp; - struct tm *(*convert) __P ((const time_t *, struct tm *)); - time_t *offset; -{ - time_t t, dt, t0, t1, t2; - struct tm tm; - - /* The maximum number of probes (calls to CONVERT) should be enough - to handle any combinations of time zone rule changes, solar time, - leap seconds, and oscillations around a spring-forward gap. - POSIX.1 prohibits leap seconds, but some hosts have them anyway. */ - int remaining_probes = 6; - - /* Time requested. Copy it in case CONVERT modifies *TP; this can - occur if TP is localtime's returned value and CONVERT is localtime. */ - int sec = tp->tm_sec; - int min = tp->tm_min; - int hour = tp->tm_hour; - int mday = tp->tm_mday; - int mon = tp->tm_mon; - int year_requested = tp->tm_year; - int isdst = tp->tm_isdst; - - /* Ensure that mon is in range, and set year accordingly. */ - int mon_remainder = mon % 12; - int negative_mon_remainder = mon_remainder < 0; - int mon_years = mon / 12 - negative_mon_remainder; - int year = year_requested + mon_years; - - /* The other values need not be in range: - the remaining code handles minor overflows correctly, - assuming int and time_t arithmetic wraps around. - Major overflows are caught at the end. */ - - /* Calculate day of year from year, month, and day of month. - The result need not be in range. */ - int yday = ((__mon_yday[__isleap (year + TM_YEAR_BASE)] - [mon_remainder + 12 * negative_mon_remainder]) - + mday - 1); - - int sec_requested = sec; -#if LEAP_SECONDS_POSSIBLE - /* Handle out-of-range seconds specially, - since ydhms_tm_diff assumes every minute has 60 seconds. */ - if (sec < 0) - sec = 0; - if (59 < sec) - sec = 59; -#endif - - /* Invert CONVERT by probing. First assume the same offset as last time. - Then repeatedly use the error to improve the guess. */ - - tm.tm_year = EPOCH_YEAR - TM_YEAR_BASE; - tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0; - t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm); - - for (t = t1 = t2 = t0 + *offset; - (dt = ydhms_tm_diff (year, yday, hour, min, sec, - ranged_convert (convert, &t, &tm))); - t1 = t2, t2 = t, t += dt) - if (t == t1 && t != t2 - && (isdst < 0 || tm.tm_isdst < 0 - || (isdst != 0) != (tm.tm_isdst != 0))) - /* We can't possibly find a match, as we are oscillating - between two values. The requested time probably falls - within a spring-forward gap of size DT. Follow the common - practice in this case, which is to return a time that is DT - away from the requested time, preferring a time whose - tm_isdst differs from the requested value. In practice, - this is more useful than returning -1. */ - break; - else if (--remaining_probes == 0) - return -1; - - /* If we have a match, check whether tm.tm_isdst has the requested - value, if any. */ - if (dt == 0 && 0 <= isdst && 0 <= tm.tm_isdst) - { - int dst_diff = (isdst != 0) - (tm.tm_isdst != 0); - if (dst_diff) - { - /* Move two hours in the direction indicated by the disagreement, - probe some more, and switch to a new time if found. - The largest known fallback due to daylight savings is two hours: - once, in Newfoundland, 1988-10-30 02:00 -> 00:00. */ - time_t ot = t - 2 * 60 * 60 * dst_diff; - while (--remaining_probes != 0) - { - struct tm otm; - if (! (dt = ydhms_tm_diff (year, yday, hour, min, sec, - ranged_convert (convert, &ot, &otm)))) - { - t = ot; - tm = otm; - break; - } - if ((ot += dt) == t) - break; /* Avoid a redundant probe. */ - } - } - } - - *offset = t - t0; - -#if LEAP_SECONDS_POSSIBLE - if (sec_requested != tm.tm_sec) - { - /* Adjust time to reflect the tm_sec requested, not the normalized value. - Also, repair any damage from a false match due to a leap second. */ - t += sec_requested - sec + (sec == 0 && tm.tm_sec == 60); - if (! (*convert) (&t, &tm)) - return -1; - } -#endif - - if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) - { - /* time_t isn't large enough to rule out overflows in ydhms_tm_diff, - so check for major overflows. A gross check suffices, - since if t has overflowed, it is off by a multiple of - TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of - the difference that is bounded by a small value. */ - - double dyear = (double) year_requested + mon_years - tm.tm_year; - double dday = 366 * dyear + mday; - double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested; - - /* On Irix4.0.5 cc, dividing TIME_T_MIN by 3 does not produce - correct results, ie., it erroneously gives a positive value - of 715827882. Setting a variable first then doing math on it - seems to work. (ghazi@caip.rutgers.edu) */ - - const time_t time_t_max = TIME_T_MAX; - const time_t time_t_min = TIME_T_MIN; - - if (time_t_max / 3 - time_t_min / 3 < (dsec < 0 ? - dsec : dsec)) - return -1; - } - - *tp = tm; - return t; -} - -#ifdef weak_alias -weak_alias (mktime, timelocal) -#endif - -#if DEBUG - -static int -not_equal_tm (a, b) - struct tm *a; - struct tm *b; -{ - return ((a->tm_sec ^ b->tm_sec) - | (a->tm_min ^ b->tm_min) - | (a->tm_hour ^ b->tm_hour) - | (a->tm_mday ^ b->tm_mday) - | (a->tm_mon ^ b->tm_mon) - | (a->tm_year ^ b->tm_year) - | (a->tm_mday ^ b->tm_mday) - | (a->tm_yday ^ b->tm_yday) - | (a->tm_isdst ^ b->tm_isdst)); -} - -static void -print_tm (tp) - struct tm *tp; -{ - if (tp) - printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", - tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, - tp->tm_hour, tp->tm_min, tp->tm_sec, - tp->tm_yday, tp->tm_wday, tp->tm_isdst); - else - printf ("0"); -} - -static int -check_result (tk, tmk, tl, lt) - time_t tk; - struct tm tmk; - time_t tl; - struct tm *lt; -{ - if (tk != tl || !lt || not_equal_tm (&tmk, lt)) - { - printf ("mktime ("); - print_tm (&tmk); - printf (")\nyields ("); - print_tm (lt); - printf (") == %ld, should be %ld\n", (long) tl, (long) tk); - return 1; - } - - return 0; -} - -int -main (argc, argv) - int argc; - char **argv; -{ - int status = 0; - struct tm tm, tmk, tml; - struct tm *lt; - time_t tk, tl; - char trailer; - - if ((argc == 3 || argc == 4) - && (sscanf (argv[1], "%d-%d-%d%c", - &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) - == 3) - && (sscanf (argv[2], "%d:%d:%d%c", - &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) - == 3)) - { - tm.tm_year -= TM_YEAR_BASE; - tm.tm_mon--; - tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); - tmk = tm; - tl = mktime (&tmk); - lt = localtime (&tl); - if (lt) - { - tml = *lt; - lt = &tml; - } - printf ("mktime returns %ld == ", (long) tl); - print_tm (&tmk); - printf ("\n"); - status = check_result (tl, tmk, tl, lt); - } - else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) - { - time_t from = atol (argv[1]); - time_t by = atol (argv[2]); - time_t to = atol (argv[3]); - - if (argc == 4) - for (tl = from; tl <= to; tl += by) - { - lt = localtime (&tl); - if (lt) - { - tmk = tml = *lt; - tk = mktime (&tmk); - status |= check_result (tk, tmk, tl, tml); - } - else - { - printf ("localtime (%ld) yields 0\n", (long) tl); - status = 1; - } - } - else - for (tl = from; tl <= to; tl += by) - { - /* Null benchmark. */ - lt = localtime (&tl); - if (lt) - { - tmk = tml = *lt; - tk = tl; - status |= check_result (tk, tmk, tl, tml); - } - else - { - printf ("localtime (%ld) yields 0\n", (long) tl); - status = 1; - } - } - } - else - printf ("Usage:\ -\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ -\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ -\t%s FROM BY TO - # Do not test those values (for benchmark).\n", - argv[0], argv[0], argv[0]); - - return status; -} - -#endif /* DEBUG */ - -/* -Local Variables: -compile-command: "gcc -DDEBUG -DHAVE_LIMITS_H -DSTDC_HEADERS -Wall -W -O -g mktime.c -o mktime" -End: -*/ diff --git a/src/install/acquire/cabextract/stamp-h.in b/src/install/acquire/cabextract/stamp-h.in deleted file mode 100644 index 9788f70..0000000 --- a/src/install/acquire/cabextract/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp -- 1.8.3.1