pax_global_header00006660000000000000000000000064131514556260014522gustar00rootroot0000000000000052 comment=5c802fc370c0475d534710c36f2286632eb32088 abi-tracker-1.11/000077500000000000000000000000001315145562600136305ustar00rootroot00000000000000abi-tracker-1.11/GPL-2.0000066400000000000000000000432541315145562600145020ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 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 Lesser General Public License instead of this License. abi-tracker-1.11/HOWTO000066400000000000000000000032351315145562600144560ustar00rootroot00000000000000Follow the instructions to setup the ABI Tracker for your library: 1) Please look at the README of the ABI Tracker and ABI Monitor tools: https://github.com/lvc/abi-tracker https://github.com/lvc/abi-monitor 2) You need to install basic packages to the system: elfutils libelf-devel ctags wdiff wget git rfcdiff (https://tools.ietf.org/tools/rfcdiff/) 3) You need to install these tools to the system: abi-tracker abi-monitor abi-dumper abi-compliance-checker pkgdiff vtable-dumper You can use the installer for that: https://github.com/lvc/installer/releases Just extract the package of installer and execute: sudo make install prefix=/usr target=abi-tracker All packages will be downloaded from the github.com/lvc and installed to the "/usr" directory. To uninstall: sudo make uninstall prefix=/usr target=abi-tracker 4) Please install also necessary tools to build your library: automake cmake gcc g++ ... 5) Create initial profile for your library (PROFILE.json): { "Name": "SHORT LIBRARY NAME", "SourceUrl": "URL TO DOWNLOAD PACKAGES", "Git": "GIT ADDRESS TO CLONE" } 6) Download and build latest packages of your library: abi-monitor -get PROFILE.json abi-monitor -build --limit=10 PROFILE.json 7) Create analysis reports: abi-tracker -build PROFILE.json 8) Rebuild some reports if needed: abi-tracker -rebuild -target abireport -v X.Y.Z PROFILE.json 9) Cron job for daily monitoring and analysis: abi-monitor -get -build-new PROFILE.json abi-tracker -build PROFILE.json 10) The home page of the report will be generated to: timeline//index.html Enjoy! abi-tracker-1.11/LGPL-2.1000066400000000000000000000636421315145562600146220ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! abi-tracker-1.11/LICENSE000066400000000000000000000002711315145562600146350ustar00rootroot00000000000000This program is free software. You may use, redistribute and/or modify it under the terms of either the GNU General Public License v2.0+ or the GNU Lesser General Public License v2.1+. abi-tracker-1.11/Makefile000066400000000000000000000002221315145562600152640ustar00rootroot00000000000000prefix ?= /usr .PHONY: install install: perl Makefile.pl -install -prefix "$(prefix)" uninstall: perl Makefile.pl -remove -prefix "$(prefix)" abi-tracker-1.11/Makefile.pl000066400000000000000000000145611315145562600157110ustar00rootroot00000000000000#!/usr/bin/perl ########################################################################### # Makefile for ABI Tracker # Install/remove the tool for GNU/Linux # # Copyright (C) 2015 Andrey Ponomarenko's ABI Laboratory # # Written by Andrey Ponomarenko # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License or the GNU Lesser # General Public License as published by the Free Software Foundation. # # 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 # and the GNU Lesser General Public License along with this program. # If not, see . ########################################################################### use Getopt::Long; Getopt::Long::Configure ("posix_default", "no_ignore_case"); use File::Path qw(mkpath rmtree); use File::Copy qw(copy); use File::Basename qw(dirname); use Cwd qw(abs_path); use File::Find; use strict; my $TOOL_SNAME = "abi-tracker"; my $ARCHIVE_DIR = abs_path(dirname($0)); my $HELP_MSG = " NAME: Makefile for ABI Tracker DESCRIPTION: Install $TOOL_SNAME command and private modules. USAGE: sudo perl $0 -install -prefix /usr sudo perl $0 -remove -prefix /usr OPTIONS: -h|-help Print this help. --prefix=PREFIX Install files in PREFIX [/usr]. -install Command to install the tool. -remove Command to remove the tool. EXTRA OPTIONS: --destdir=DESTDIR This option is for maintainers to build RPM or DEB packages inside the build root. The environment variable DESTDIR is also supported. \n"; if(not @ARGV) { print $HELP_MSG; exit(0); } my ($PREFIX, $DESTDIR, $Help, $Install, $Remove); GetOptions( "h|help!" => \$Help, "prefix=s" => \$PREFIX, "destdir=s" => \$DESTDIR, "install!" => \$Install, "remove!" => \$Remove ) or exit(1); sub scenario() { if($Help) { print $HELP_MSG; exit(0); } if(not $Install and not $Remove) { print STDERR "ERROR: command is not selected (-install or -remove)\n"; exit(1); } if($Install) { # remove old version first $Remove = 1; } if($PREFIX ne "/") { $PREFIX=~s/[\/]+\Z//g; } if(not $PREFIX) { # default prefix $PREFIX = "/usr"; } if(my $Var = $ENV{"DESTDIR"}) { print "Using DESTDIR environment variable\n"; $DESTDIR = $Var; } if($DESTDIR) { if($DESTDIR ne "/") { $DESTDIR=~s/[\/]+\Z//g; } if($DESTDIR!~/\A\//) { print STDERR "ERROR: destdir is not absolute path\n"; exit(1); } if(not -d $DESTDIR) { print STDERR "ERROR: you should create destdir directory first\n"; exit(1); } $PREFIX = $DESTDIR.$PREFIX; if(not -d $PREFIX) { print STDERR "ERROR: you should create installation directory first (destdir + prefix):\n mkdir -p $PREFIX\n"; exit(1); } } else { if($PREFIX!~/\A\//) { print STDERR "ERROR: prefix is not absolute path\n"; exit(1); } if(not -d $PREFIX) { print STDERR "ERROR: you should create prefix directory first\n"; exit(1); } } print "INSTALL PREFIX: $PREFIX\n"; # paths my $EXE_PATH = "$PREFIX/bin"; my $MODULES_PATH = "$PREFIX/share/$TOOL_SNAME"; my $REL_PATH = "../share/$TOOL_SNAME"; my $TOOL_PATH = "$EXE_PATH/$TOOL_SNAME"; if(not -w $PREFIX) { print STDERR "ERROR: you should be root\n"; exit(1); } if($Remove) { if(-e $EXE_PATH."/".$TOOL_SNAME) { # remove executable print "-- Removing $TOOL_PATH\n"; unlink($EXE_PATH."/".$TOOL_SNAME); } elsif(not $Install) { print "The tool is not installed\n"; } if(-d $ARCHIVE_DIR."/modules") { if(-d $MODULES_PATH) { # remove modules print "-- Removing $MODULES_PATH\n"; rmtree($MODULES_PATH); } elsif(not $Install) { print "The modules of the tool are not installed\n"; } } } if($Install) { # configure my $Content = readFile($ARCHIVE_DIR."/".$TOOL_SNAME.".pl"); if($DESTDIR) { # relative path $Content=~s/MODULES_INSTALL_PATH/$REL_PATH/; } else { # absolute path $Content=~s/MODULES_INSTALL_PATH/$MODULES_PATH/; } # copy executable print "-- Installing $TOOL_PATH\n"; mkpath($EXE_PATH); writeFile($EXE_PATH."/".$TOOL_SNAME, $Content); chmod(0755, $EXE_PATH."/".$TOOL_SNAME); # copy modules if(-d $ARCHIVE_DIR."/modules") { print "-- Installing $MODULES_PATH\n"; mkpath($MODULES_PATH); copyDir($ARCHIVE_DIR."/modules", $MODULES_PATH); } # check PATH if($ENV{"PATH"}!~/(\A|:)\Q$EXE_PATH\E[\/]?(\Z|:)/) { print "WARNING: your PATH variable doesn't include \'$EXE_PATH\'\n"; } } exit(0); } sub copyDir($$) { my ($From, $To) = @_; my %Files; find(\&wanted, $From); sub wanted { $Files{$File::Find::dir."/$_"} = 1 if($_ ne "."); } foreach my $Path (sort keys(%Files)) { my $Inst = $Path; $Inst=~s/\A\Q$ARCHIVE_DIR\E/$To/; if(-d $Path) { # directories mkpath($Inst); } else { # files mkpath(dirname($Inst)); copy($Path, $Inst); } } } sub readFile($) { my $Path = $_[0]; return "" if(not $Path or not -f $Path); open(FILE, $Path) || die ("can't open file \'$Path\': $!\n"); local $/ = undef; my $Content = ; close(FILE); return $Content; } sub writeFile($$) { my ($Path, $Content) = @_; return if(not $Path); open(FILE, ">".$Path) || die ("can't open file \'$Path\': $!\n"); print FILE $Content; close(FILE); } scenario(); abi-tracker-1.11/README000066400000000000000000000071701315145562600145150ustar00rootroot00000000000000NAME: ABI Tracker - visualize ABI changes timeline of a C/C++ software library. The tool requires input profile of the library in JSON format. It can be created manually or automatically generated by the ABI Monitor: https://github.com/lvc/abi-monitor Sample report: https://abi-laboratory.pro/tracker/timeline/glib/ The tool is developed by Andrey Ponomarenko. Please consider to add ABI Viewer reports for visualization of the ABI structure and high detailed binary compatibility analysis: https://abi-laboratory.pro/ INSTALL: sudo make install prefix=/usr REQUIRES: Perl 5 (5.8 or newer) Elfutils ABI Dumper (1.1 or newer) Vtable-Dumper (1.1 or newer) ABI Compliance Checker (2.2 or newer) ABI Monitor (1.12 or newer) PkgDiff (1.6.4 or newer) RfcDiff (1.41 or newer) You can use the installer (https://github.com/lvc/installer) to automatically download and install most of the required tools. USAGE: abi-tracker [options] [profile] The input profile can be generated by the ABI Monitor tool. All manual edits in the profile will be preserved after re-generating it by the ABI Monitor. The home page of the output report is: timeline/LIB_NAME/index.html EXAMPLES: abi-tracker -build libssh.json abi-tracker -rebuild -target abireport -v 0.7.0 libssh.json GRAPH: abi-tracker -build -t graph libssh.json RSS: abi-tracker -build -rss libssh.json CRON JOB: abi-monitor -get -build-new [profile] abi-tracker -build [profile] PROFILE FORMAT: { "Name": "SHORT LIBRARY NAME", "Maintainer": "MAINTAINER NAME", "SourceUrl": "URL TO DOWNLOAD PACKAGES", "Git": "GIT ADDRESS TO CLONE", "Versions": [ { "Number": "VERSION NUMBER", "Installed": "INSTALL TREE PATH", "Source": "SOURCE PACKAGE PATH", "Changelog": "CHANGELOG: On/Off", "HeadersDiff": "HEADERS DIFF: On/Off", "PkgDiff": "PACKAGE DIFF: On/Off", "ABIView": "ABI VIEW: On/Off", "ABIDiff": "ABI DIFF: On/Off" }, ... { ... }] } PROFILE EXAMPLE: { "Name": "libssh", "Maintainer": "Andrey P.", "SourceUrl": "https://red.libssh.org/projects/libssh/files", "Git": "https://git.libssh.org/projects/libssh.git", "Versions": [ { "Number": "0.7.0", "Installed": "installed/libssh/0.7.0", "Source": "src/libssh/0.7.0/libssh-0.7.0.tar.xz", "Changelog": "On", "HeadersDiff": "On", "PkgDiff": "On", "ABIView": "Off", "ABIDiff": "Off" }, { "Number": "0.6.5", "Installed": "installed/libssh/0.6.5", "Source": "src/libssh/0.6.5/libssh-0.6.5.tar.xz", "Changelog": "On", "HeadersDiff": "On", "PkgDiff": "On", "ABIView": "Off", "ABIDiff": "Off" }, ... { "Number": "0.5.2", "Installed": "installed/libssh/0.5.2", "Source": "src/libssh/0.5.2/libssh-0.5.2.tar.xz", "Changelog": "On", "HeadersDiff": "On", "PkgDiff": "On", "ABIView": "Off", "ABIDiff": "Off" }] } See more profile examples in this directory: https://github.com/lvc/upstream-tracker/tree/master/profile ADV. OPTIONS: If you want to allow users to connect the maintainer of the tracker then you can set "MaintainerUrl" option. To skip checking of some objects in the install tree of a library please define "SkipObjects": ["O1", ..., "On"] option. The name of the analysed library in the title can be changed by "Title" option. ADV. OPTIONS OF A VERSION: To hide some version in the report you can define "Deleted" option. ADV. USAGE: For advanced usage, see output of --help option. Enjoy! abi-tracker-1.11/abi-tracker.pl000066400000000000000000004112151315145562600163550ustar00rootroot00000000000000#!/usr/bin/perl ################################################################## # ABI Tracker 1.11 # A tool to visualize ABI changes timeline of a C/C++ software library # # Copyright (C) 2015-2017 Andrey Ponomarenko's ABI Laboratory # # Written by Andrey Ponomarenko # # PLATFORMS # ========= # Linux (x86, x86_64) # # REQUIREMENTS # ============ # Perl 5 # Elfutils (eu-readelf) # ABI Dumper (1.1 or newer) # Vtable-Dumper (1.1 or newer) # ABI Compliance Checker (2.2 or newer) # PkgDiff (1.6.4 or newer) # RfcDiff 1.41 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License or the GNU Lesser # General Public License as published by the Free Software Foundation. # # 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 # and the GNU Lesser General Public License along with this program. # If not, see . ################################################################## use Getopt::Long; Getopt::Long::Configure ("posix_default", "no_ignore_case", "permute"); use File::Path qw(mkpath rmtree); use File::Temp qw(tempdir); use File::Basename qw(dirname basename); use File::Copy qw(copy); use Cwd qw(abs_path cwd); use Data::Dumper; my $TOOL_VERSION = "1.11"; my $DB_NAME = "Tracker.data"; my $TMP_DIR = tempdir(CLEANUP=>1); my $INSTALL_ROOT = "installed"; # Internal modules my $MODULES_DIR = get_Modules(); push(@INC, dirname($MODULES_DIR)); # Basic modules my %LoadedModules = (); loadModule("Basic"); loadModule("Input"); loadModule("Utils"); my $ABI_DUMPER = "abi-dumper"; my $ABI_DUMPER_VERSION = "1.1"; my $ABI_DUMPER_EE = 0; my $ABI_CC = "abi-compliance-checker"; my $ABI_CC_VERSION = "2.2"; my $RFCDIFF = "rfcdiff"; my $PKGDIFF = "pkgdiff"; my $PKGDIFF_VERSION = "1.6.4"; my $ABI_VIEWER = "abi-viewer"; my $CmdName = basename($0); my $ORIG_DIR = cwd(); my $MD5_LEN = 5; my %ERROR_CODE = ( "Success"=>0, # Undifferentiated error code "Error"=>2, # System command is not found "Not_Found"=>3, # Cannot access input files "Access_Error"=>4, # Cannot find a module "Module_Error"=>9 ); my $HomePage = "https://abi-laboratory.pro/"; my $ShortUsage = "ABI Tracker $TOOL_VERSION A tool to visualize ABI changes timeline of a C/C++ software library Copyright (C) 2017 Andrey Ponomarenko's ABI Laboratory License: GPLv2.0+ or LGPLv2.1+ Usage: $CmdName [options] [profile] Example: $CmdName -build profile.json More info: $CmdName --help\n"; if($#ARGV==-1) { printMsg("INFO", $ShortUsage); exit(0); } GetOptions("h|help!" => \$In::Opt{"Help"}, "dumpversion!" => \$In::Opt{"DumpVersion"}, # general options "build!" => \$In::Opt{"Build"}, "rebuild!" => \$In::Opt{"Rebuild"}, "v=s" => \$In::Opt{"TargetVersion"}, "t|target=s" => \$In::Opt{"TargetElement"}, "clear!" => \$In::Opt{"Clear"}, "clean-unused!" => \$In::Opt{"CleanUnused"}, "force!" => \$In::Opt{"Force"}, "global-index!" => \$In::Opt{"GlobalIndex"}, "disable-cache!" => \$In::Opt{"DisableCache"}, "deploy=s" => \$In::Opt{"Deploy"}, "debug!" => \$In::Opt{"Debug"}, # other options "json-report=s" => \$In::Opt{"JsonReport"}, "regen-dump!" => \$In::Opt{"RegenDump"}, "rss!" => \$In::Opt{"GenRss"}, # private options "sponsors=s" => \$In::Opt{"Sponsors"} ) or ERR_MESSAGE(); sub ERR_MESSAGE() { printMsg("INFO", "\n".$ShortUsage); exit($ERROR_CODE{"Error"}); } my $HelpMessage=" NAME: ABI Tracker ($CmdName) Visualize ABI changes timeline of a C/C++ software library DESCRIPTION: ABI Tracker is a tool to visualize ABI changes timeline of a C/C++ software library. The tool is intended for developers of software libraries and Linux maintainers who are interested in ensuring backward binary compatibility, i.e. allow old applications to run with newer library versions. This tool is free software: you can redistribute it and/or modify it under the terms of the GPLv2.0+ or LGPLv2.1+. USAGE: $CmdName [options] [profile] EXAMPLES: $CmdName -build profile.json INFORMATION OPTIONS: -h|-help Print this help. -dumpversion Print the tool version ($TOOL_VERSION) and don't do anything else. GENERAL OPTIONS: -build Build reports. -rebuild Re-build reports. -v NUM Select only one particular version of the library to create reports for. -t|-target TYPE Select type of the reports to build: abidump abireport headersdiff pkgdiff changelog soname date -clear Remove all reports. -global-index Create list of all tested libraries. -disable-cache Enable this option if you've changed filter of checked symbols in the library (skipped types, skipped functions, etc.). -deploy DIR Copy all reports and css to DIR. -debug Enable debug messages. OTHER OPTIONS: -json-report DIR Generate JSON-format report for a library to DIR. -regen-dump Regenerate ABI dumps for previous versions if comparing with new ones. -rss Generate RSS feed. "; my $Profile; my $DB; my $TARGET_LIB; my $DB_PATH = undef; # Sponsors my %LibrarySponsor; # Regenerate reports my $ObjectsReport = 0; # Dump status my %FailedDump = (); my %DoneDump = (); # Report style my $LinkClass = " class='num'"; my $LinkNew = " new"; my $LinkRemoved = " removed"; # Dumps my $COMPRESS = "tar.gz"; sub get_Modules() { my $TOOL_DIR = dirname($0); my @SEARCH_DIRS = ( # tool's directory abs_path($TOOL_DIR), # relative path to modules abs_path($TOOL_DIR)."/../share/abi-tracker", # install path 'MODULES_INSTALL_PATH' ); foreach my $DIR (@SEARCH_DIRS) { if(not $DIR=~/\A\//) { # relative path $DIR = abs_path($TOOL_DIR)."/".$DIR; } if(-d $DIR."/modules") { return $DIR."/modules"; } } exitStatus("Module_Error", "can't find modules"); } sub loadModule($) { my $Name = $_[0]; if(defined $LoadedModules{$Name}) { return; } my $Path = $MODULES_DIR."/Internals/$Name.pm"; if(not -f $Path) { exitStatus("Module_Error", "can't access \'$Path\'"); } require $Path; $LoadedModules{$Name} = 1; } sub readModule($$) { my ($Module, $Name) = @_; my $Path = $MODULES_DIR."/Internals/$Module/".$Name; if(not -f $Path) { exitStatus("Module_Error", "can't access \'$Path\'"); } return readFile($Path); } sub exitStatus($$) { my ($Code, $Msg) = @_; printMsg("ERROR", $Msg); exit($ERROR_CODE{$Code}); } sub printMsg($$) { my ($Type, $Msg) = @_; if($Type!~/\AINFO/) { $Msg = $Type.": ".$Msg; } if($Type!~/_C\Z/) { $Msg .= "\n"; } if($Type eq "ERROR") { print STDERR $Msg; } else { print $Msg; } } sub readProfile($) { my $Content = $_[0]; my %Res = (); if($Content=~/\A\s*\{\s*((.|\n)+?)\s*\}\s*\Z/) { my $Info = $1; my $Pos = 0; if($Info=~/\"(Versions|Supports)\"/) { my $Subj = $1; $Pos = 0; while($Info=~s/(\"$Subj\"\s*:\s*\[\s*)(\{\s*(.|\n)+?\s*\})\s*,?\s*/$1/) { my $SInfo = readProfile($2); if($Subj eq "Versions") { if(my $Num = $SInfo->{"Number"}) { $SInfo->{"Pos"} = $Pos++; $Res{$Subj}{$Num} = $SInfo; } else { printMsg("ERROR", "version number is missed in the profile"); } } elsif($Subj eq "Supports") { $Res{$Subj}{$Pos++} = $SInfo; } } } # arrays while($Info=~s/\"(\w+)\"\s*:\s*\[\s*(.*?)\s*\]\s*(\,|\Z)//) { my ($K, $A) = ($1, $2); if($K eq "Versions" or $K eq "Supports") { next; } $Res{$K} = []; foreach my $E (split(/\s*\,\s*/, $A)) { $E=~s/\A[\"\']//; $E=~s/[\"\']\Z//; push(@{$Res{$K}}, $E); } } # scalars while($Info=~s/\"(\w+)\"\s*:\s*(.+?)\s*\,?\s*$//m) { my ($K, $V) = ($1, $2); if($K eq "Versions" or $K eq "Supports") { next; } if($K eq "RfcDiff") { # alias $K = "HeadersDiff"; } $V=~s/\A[\"\']//; $V=~s/[\"\']\Z//; $Res{$K} = $V; } } return \%Res; } sub skipVersion_T($) { my $V = $_[0]; if(defined $In::Opt{"TargetVersion"}) { if($V ne $In::Opt{"TargetVersion"}) { return 1; } } return 0; } sub skipVersion($) { my $V = $_[0]; if(defined $Profile->{"SkipVersions"}) { my @Skip = @{$Profile->{"SkipVersions"}}; foreach my $E (@Skip) { if($E=~/[\*\+\(\|\\]/) { # pattern if($V=~/\A$E\Z/) { return 1; } } elsif($E eq $V) { return 1; } } } return 0; } sub cleanUnused() { printMsg("INFO", "Cleaning unused data"); my @Versions = getVersionsList(); my %SeqVer = (); my %PoinVer = (); foreach my $K (0 .. $#Versions) { my $V1 = $Versions[$K]; my $V2 = undef; if($K<$#Versions) { $V2 = $Versions[$K+1]; } $PoinVer{$V1} = 1; if(defined $V2) { $SeqVer{$V2}{$V1} = 1; } } foreach my $V (keys(%{$DB->{"ABIDump"}})) { if(not defined $PoinVer{$V}) { printMsg("INFO", "Unused ABI dump v.$V"); if(defined $In::Opt{"Force"}) { rmtree("abi_dump/$TARGET_LIB/$V"); } } } foreach my $O_V (keys(%{$DB->{"ABIReport"}})) { foreach my $V (keys(%{$DB->{"ABIReport"}{$O_V}})) { if(not defined $SeqVer{$O_V}{$V}) { printMsg("INFO", "Unused ABI report from $O_V to $V"); if(defined $In::Opt{"Force"}) { rmtree("objects_report/$TARGET_LIB/$O_V/$V"); rmtree("compat_report/$TARGET_LIB/$O_V/$V"); } } } } if(not defined $In::Opt{"Force"}) { printMsg("INFO", "Use -force option to remove unused data"); } } sub buildData() { my @Versions = getVersionsList(); if($In::Opt{"TargetVersion"}) { if(not grep {$_ eq $In::Opt{"TargetVersion"}} @Versions) { printMsg("ERROR", "unknown version number \'".$In::Opt{"TargetVersion"}."\'"); } } foreach my $V (@Versions) { if(skipVersion_T($V)) { next; } if(my $Installed = $Profile->{"Versions"}{$V}{"Installed"}) { if(not -d $Installed) { printMsg("ERROR", "$V is not installed"); } } } if(checkTarget("date") or checkTarget("dates")) { foreach my $V (@Versions) { if(skipVersion_T($V)) { next; } detectDate($V); } } if(checkTarget("soname")) { foreach my $V (@Versions) { if(skipVersion_T($V)) { next; } detectSoname($V); } } if(checkTarget("changelog")) { foreach my $V (@Versions) { if(skipVersion_T($V)) { next; } createChangelog($V, $V eq $Versions[$#Versions]); } } if(checkTarget("abidump")) { foreach my $V (@Versions) { if(skipVersion_T($V)) { next; } createABIDump($V); } } if(checkTarget("compress")) { foreach my $V (@Versions) { if(skipVersion_T($V)) { next; } compressABIDump($V); } } if($In::Opt{"Rebuild"} and not $In::Opt{"TargetElement"} and $In::Opt{"TargetVersion"}) { # rebuild previous ABI dump my $PV = undef; foreach my $V (reverse(@Versions)) { if($V eq $In::Opt{"TargetVersion"}) { if(defined $PV) { createABIDump($PV); last; } } $PV = $V; } } if(checkTarget("abiview")) { foreach my $V (@Versions) { if(skipVersion_T($V)) { next; } createABIView($V); } } foreach my $P (0 .. $#Versions) { my $V = $Versions[$P]; my $O_V = undef; if($P<$#Versions) { $O_V = $Versions[$P+1]; } if(skipVersion_T($V)) { next; } if(defined $O_V) { if(checkTarget("abireport")) { createABIReport($O_V, $V); } if(checkTarget("rfcdiff") or checkTarget("headersdiff")) { diffHeaders($O_V, $V); } if(checkTarget("pkgdiff") or checkTarget("packagediff")) { if($V ne "current") { createPkgdiff($O_V, $V); } } } } if(defined $Profile->{"Versions"}{"current"}) { # save pull/update time of the code repository if(-d $Profile->{"Versions"}{"current"}{"Installed"}) { if(my $UTime = getScmUpdateTime()) { $DB->{"ScmUpdateTime"} = $UTime; } } } if(defined $In::Opt{"TargetElement"} and $In::Opt{"TargetElement"} eq "graph") { my $First = $Versions[$#Versions]; my $Total = 0; foreach my $Md5 (sort keys(%{$DB->{"ABIDump"}{$First}})) { my $Dump = $DB->{"ABIDump"}{$First}{$Md5}; if(skipLib($Dump->{"Object"})) { next; } $Total += countSymbolsF($Dump, $First); } my $Scatter = {}; $Scatter->{$First} = 0; foreach my $P (0 .. $#Versions) { my $V = $Versions[$P]; my $O_V = undef; if($P<$#Versions) { $O_V = $Versions[$P+1]; } if(not defined $O_V) { next; } if(defined $DB->{"ABIReport"} and defined $DB->{"ABIReport"}{$O_V} and defined $DB->{"ABIReport"}{$O_V}{$V}) { my $ABIReport = $DB->{"ABIReport"}{$O_V}{$V}; my $Added = $ABIReport->{"Added"}; my $Removed = $ABIReport->{"Removed"}; my $AddedByObjects = $ABIReport->{"ObjectsAddedSymbols"}; my $RemovedByObjects = $ABIReport->{"ObjectsRemovedSymbols"}; $Scatter->{$V} = $Added - $Removed + $AddedByObjects - $RemovedByObjects; } } my @Order = reverse(@Versions); simpleGraph($Scatter, \@Order, $Total); } } sub countSymbolsF($$) { my ($Dump, $V) = @_; if(defined $Dump->{"TotalSymbolsFiltered"}) { if(not defined $In::Opt{"DisableCache"}) { return $Dump->{"TotalSymbolsFiltered"}; } } my $AccOpts = getABICC_Options(); if($AccOpts=~/list|skip/) { my $Path = $Dump->{"Path"}; printMsg("INFO", "Counting symbols in the ABI dump for \'".getFilename($Dump->{"Object"})."\' ($V)"); my $Cmd_C = "$ABI_CC -count-symbols \"$Path\" $AccOpts"; if($In::Opt{"Debug"}) { printMsg("DEBUG", "executing $Cmd_C"); } my $Count = qx/$Cmd_C/; chomp($Count); return ($Dump->{"TotalSymbolsFiltered"} = $Count); } if(not defined $Dump->{"TotalSymbols"}) { # support for old data print STDERR "WARNING: TotalSymbols property is missed, reading ABI dump for ".$Dump->{"Object"}." ($V) ...\n"; $Dump->{"TotalSymbols"} = countSymbols($Dump); } elsif(defined $In::Opt{"DisableCache"}) { # re-count print STDERR "WARNING: re-counting symbols in ABI dump for ".$Dump->{"Object"}." ($V) ...\n"; $Dump->{"TotalSymbols"} = countSymbols($Dump); } elsif(not defined $Dump->{"Version"} or cmpVersions_S($Dump->{"Version"}, "1.7")<0) { # TotalSymbols is fixed in 1.7 print STDERR "WARNING: TotalSymbols property contains obsolete data, reading ABI dump for ".$Dump->{"Object"}." ($V) ...\n"; $Dump->{"TotalSymbols"} = countSymbols($Dump); } return ($Dump->{"TotalSymbolsFiltered"} = $Dump->{"TotalSymbols"}); } sub countSymbols($) { my $Dump = $_[0]; my $Path = $Dump->{"Path"}; printMsg("INFO", "Counting symbols in the ABI dump for \'".getFilename($Dump->{"Object"})."\'"); my $Cmd_C = "$ABI_CC -count-symbols \"$Path\""; if($In::Opt{"Debug"}) { printMsg("DEBUG", "executing $Cmd_C"); } my $Total = qx/$Cmd_C/; chomp($Total); return $Total; } sub simpleGraph($$$) { my ($Scatter, $Order, $StartVal) = @_; my @Vs = @{$Order}; if($Vs[$#Vs] eq "current") { pop(@Vs); } my $MinVer = $Vs[0]; my $MaxVer = $Vs[$#Vs]; my $MinRange = undef; my $MaxRange = undef; my $Content = ""; my $Val_Pre = $StartVal; my $Few = (defined $Profile->{"GraphFewXTics"} and $Profile->{"GraphFewXTics"} eq "On"); foreach (0 .. $#Vs) { my $V = $Vs[$_]; my $Val = $Val_Pre + $Scatter->{$V}; if(not defined $MinRange) { $MinRange = $Val; } if(not defined $MaxRange) { $MaxRange = $Val; } if($Val<$MinRange) { $MinRange = $Val; } elsif($Val>$MaxRange) { $MaxRange = $Val; } my $V_S = $V; if(defined $Profile->{"GraphShortXTics"}) { if($V=~tr![\._\-]!!>=2) { $V_S = getMajor($V, 2); } elsif($V=~/\A(20\d\d)\d\d\d\d\Z/) { # 20160507 $V_S = $1; } elsif($V=~/\A(20\d\d)\-\d\d\-\d\d\Z/) { # 2016-07-01 $V_S = $1; } elsif($V=~/\A(.+)\-\d\d\d\d\d\d\d\d\Z/) { # 0.12-20140410 $V_S = $1; } } $V_S=~s/\-(alpha|beta|rc)\d*\Z//g; $Content .= $_." ".$Val; if($_==0 or $_==$#Vs or $_==int($#Vs/2) or (not $Few and $_==int($#Vs/4)) or (not $Few and $_==int(3*$#Vs/4))) { $Content .= " ".$V_S; } $Content .= "\n"; $Val_Pre = $Val; } my $Delta = $MaxRange - $MinRange; if($Delta<20) { $MinRange -= 5; $MaxRange += 5; } else { $MinRange -= int($Delta/20); $MaxRange += int($Delta/20); } my $Data = $TMP_DIR."/graph.data"; writeFile($Data, $Content); my $GraphTitle = ""; # Timeline of ABI changes my $GraphPath = "graph/$TARGET_LIB/graph.svg"; mkpath(getDirname($GraphPath)); my $Title = showTitle(); $Title=~s/\'/''/g; my $Cmd = "gnuplot -e \"set title \'$GraphTitle\';"; $Cmd .= "set xlabel '".$Title." version';"; $Cmd .= "set ylabel 'ABI symbols';"; $Cmd .= "set xrange [0:".$#Vs."];"; $Cmd .= "set yrange [$MinRange:$MaxRange];"; $Cmd .= "set terminal svg size 380,300;"; $Cmd .= "set output \'$GraphPath\';"; $Cmd .= "set nokey;"; $Cmd .= "set xtics font 'Times, 12';"; $Cmd .= "set ytics font 'Times, 12';"; $Cmd .= "set xlabel font 'Times, 12';"; $Cmd .= "set ylabel font 'Times, 12';"; $Cmd .= "set style line 1 linecolor rgbcolor 'red' linewidth 2;"; $Cmd .= "set style increment user;"; $Cmd .= "plot \'$Data\' using 2:xticlabels(3) with lines\""; system($Cmd); unlink($Data); } sub getLdDirs($$) { my ($V, $Opts) = @_; my @Dirs = (); foreach my $C (@{$Opts}) { while($C=~s&({INSTALL_ROOT}\/[^\/]+\/[^\/\s;:'"]+)&&) { my $Dir = addParams($1, $V); if(-d $Dir."/lib") { push(@Dirs, $Dir."/lib"); } if(-d $Dir."/lib64") { push(@Dirs, $Dir."/lib64"); } } } return @Dirs; } sub addParams($$) { my ($Str, $V) = @_; $Str=~s/{VERSION}/$V/g; my $InstallRoot_A = $ORIG_DIR."/".$INSTALL_ROOT; $Str=~s/{INSTALL_ROOT}/$InstallRoot_A/g; return $Str; } sub findObjects($) { my $Dir = $_[0]; my @Files = (); if($Profile->{"Mode"} eq "Kernel") { @Files = findFiles($Dir, "f", ".*\\.ko"); @Files = (@Files, findFiles($Dir, "f", "", "vmlinux")); } else { @Files = findFiles($Dir, "f", ".*\\.so\\..*"); @Files = (@Files, findFiles($Dir, "f", ".*\\.so")); } my @Res = (); foreach my $F (@Files) { if(-B $F) { push(@Res, $F); } } return @Res; } sub findHeaders($) { my $Dir = $_[0]; if(-d $Dir."/include") { $Dir .= "/include"; } my @Files = findFiles($Dir, "f"); my @Headers = (); foreach my $File (sort {lc($a) cmp lc($b)} @Files) { if($File=~/\.(so|pc)(\Z|\.)/) { next; } push(@Headers, $File); } return @Headers; } sub detectSoname($) { if($Profile->{"Mode"} eq "Kernel") { return 0; } my $V = $_[0]; if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"Soname"}{$V}) { if(not updateRequired($V)) { return 0; } } } delete($DB->{"Soname"}{$V}); # empty cache delete($DB->{"Sover"}{$V}); # empty cache printMsg("INFO", "Detecting soname of $V"); my $Installed = $Profile->{"Versions"}{$V}{"Installed"}; if(not -d $Installed) { return 0; } my @Objects = findObjects($Installed); my %Sovers = (); foreach my $Path (@Objects) { my $RPath = $Path; $RPath=~s/\A\Q$Installed\E\/*//; if(skipLib($RPath)) { next; } if(readBytes($Path) eq "7f454c46") { if(my $Soname = getSoname($Path)) { $DB->{"Soname"}{$V}{$RPath} = $Soname; if((my $Ver = getSover($Soname)) ne "") { $Sovers{$Ver} = 1; } } else { $DB->{"Soname"}{$V}{$RPath} = "None"; } } } my $Sover = "None"; if(defined $Profile->{"SkipSoversions"}) { foreach my $Skip (@{$Profile->{"SkipSoversions"}}) { if(defined $Sovers{$Skip}) { delete($Sovers{$Skip}); } } } if(my @S = sort keys(%Sovers)) { if($#S==0) { $Sover = $S[0]; } else { $Sover = join("/", @S); } } $DB->{"Sover"}{$V} = $Sover; } sub skipHeader($) { return matchFile($_[0], "SkipHeaders"); } sub skipLib($) { if(matchFile($_[0], "SkipObjects")) { return 1; } if(defined $Profile->{"CheckObjects"}) { if(not matchFile($_[0], "CheckObjects")) { return 1; } } return 0; } sub matchFile($$) { my ($Path, $Tag) = @_; if(defined $Profile->{$Tag}) { my $Name = getFilename($Path); my @Skip = @{$Profile->{$Tag}}; foreach my $L (@Skip) { if($L eq $Name) { # exact match return 1; } elsif($L=~/\/\Z/) { # directory if($Path=~/\Q$L\E/) { return 1; } } else { # file if($L=~/[\*\+\(\|\\]/) { # pattern if($Name=~/\A$L\Z/) { return 1; } } elsif($Tag eq "SkipObjects" or $Tag eq "CheckObjects") { # short name $L = getObjectName($L, "Short"); if($L eq getObjectName($Name, "Short")) { return 1; } } } } } return 0; } sub getSover($) { my $Name = $_[0]; my ($Pre, $Post) = (undef, undef); if($Name=~/\.so\.([\w\.\-]+)/) { $Post = $1; } $Name=~s/x11//gi; $Name=~s/x86[-_]64//gi; # libunwind-x86_64.so.7.0.0 $Name=~s/x86//gi; if($Name=~/(\d+[\d\.]*\-[\w\.\-]*\d+)\.so(\.|\Z)/) { # libMagickCore6-Q16.so.1 $Pre = $1; } elsif($Name=~/\-([a-zA-Z]?\d+([\w\.\-]*\d+|))\.so(\.|\Z)/) { # libMagickCore-6.Q16.so.1 # libMagickCore-Q16.so.7 $Pre = $1; } elsif(not defined $Post and $Name=~/\.?([\d\.]+)\.so(\.|\Z)/) { $Pre = $1; } my @V = (); if(defined $Pre) { push(@V, $Pre); } if(defined $Post) { push(@V, $Post); } if(@V) { return join(".", @V); } return undef; } sub getSoname($) { my $Path = $_[0]; my $Soname = `objdump -p \"$Path\"|grep SONAME`; chomp($Soname); if($Soname=~/SONAME\s+([^ ]+)/) { return $1; } return undef; } sub updateRequired($) { my $V = $_[0]; if($V eq "current") { if($DB->{"ScmUpdateTime"}) { if(my $UTime = getScmUpdateTime()) { if($DB->{"ScmUpdateTime"} ne $UTime) { return 1; } } } } return 0; } sub createChangelog($$) { my $V = $_[0]; my $First = $_[1]; my $Dir = "changelog/$TARGET_LIB/$V"; if(defined $Profile->{"Versions"}{$V}{"Changelog"}) { if($Profile->{"Versions"}{$V}{"Changelog"} eq "Off" or index($Profile->{"Versions"}{$V}{"Changelog"}, "://")!=-1) { rmtree($Dir); return 0; } } if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"Changelog"}{$V}) { if(not updateRequired($V)) { return 0; } } } printMsg("INFO", "Creating changelog for $V"); my $Source = $Profile->{"Versions"}{$V}{"Source"}; my $ChangelogPath = undef; if(not -e $Source) { printMsg("ERROR", "Can't access \'$Source\'"); return 0; } my $TmpDir = $TMP_DIR."/log"; mkpath($TmpDir); if($V eq "current") { $ChangelogPath = "$TmpDir/log"; chdir($Source); my $Cmd_L = undef; if(defined $Profile->{"Git"}) { $Cmd_L = "git log -100 --date=iso >$ChangelogPath"; } elsif(defined $Profile->{"Svn"}) { $Cmd_L = "svn log -l100 >$ChangelogPath"; } elsif(defined $Profile->{"Hg"}) { $Cmd_L = "hg log --limit 100 >$ChangelogPath"; } else { printMsg("ERROR", "Unknown type of source code repository"); return 0; } qx/$Cmd_L/; # execute appendFile($ChangelogPath, "\n..."); chdir($ORIG_DIR); } else { if(my $Cmd_E = extractPackage($Source, $TmpDir)) { qx/$Cmd_E/; # execute if($?) { printMsg("ERROR", "Failed to extract package \'".getFilename($Source)."\'"); return 0; } } else { printMsg("ERROR", "Unknown package format \'".getFilename($Source)."\'"); return 0; } my $STmpDir = $TmpDir; while(1) { my @Files = listDir($STmpDir); if($#Files==0) { # one step deeper $STmpDir .= "/".$Files[0]; } else { last; } } if(defined $Profile->{"Versions"}{$V}{"Changelog"}) { my $Target = $Profile->{"Versions"}{$V}{"Changelog"}; if($Target eq "On") { my $Found = findChangelog($STmpDir); if($Found and $Found ne "None") { $ChangelogPath = $STmpDir."/".$Found; } } else { # name of the changelog if(-f $STmpDir."/".$Target and -s $STmpDir."/".$Target) { $ChangelogPath = $STmpDir."/".$Target; } } } } my $Html = undef; if($ChangelogPath) { $Html = toHtml($V, $ChangelogPath, $First); } if($Html) { writeFile($Dir."/log.html", $Html); $DB->{"Changelog"}{$V} = $Dir."/log.html"; } else { rmtree($Dir); $DB->{"Changelog"}{$V} = "Off"; } rmtree($TmpDir); } sub toHtml($$$) { my ($V, $Path, $First) = @_; my $Content = readFile($Path); if(not $Content) { return undef; } my $LIM = 500000; my $MIN = 15; if(not $First and $V ne "current") { $LIM /= 20; } my $Len = length($Content); if($Len<$MIN) { return undef; } if(length($Content)>$LIM) { $Content = substr($Content, 0, $LIM); $Content .= "\n..."; } $Content = htmlSpecChars($Content, 1); my $Title = showTitle()." ".$V.": changelog"; my $Keywords = showTitle().", $V, changes, changelog"; my $Desc = "Log of changes in the package"; $Content = "\n
\n
$Content
\n"; if($V eq "current") { $Content = "

Changelog from ".getScmInfo()."



".$Content; } else { $Content = "

Changelog for $V version



".$Content; } $Content = getHead("changelog").$Content; $Content = composeHTML_Head("changelog", $Title, $Keywords, $Desc, "changelog.css")."\n\n$Content\n\n\n"; return $Content; } sub getScmName() { my $Name = "source repository"; if(defined $Profile->{"Git"}) { $Name = "Git"; } elsif(defined $Profile->{"Svn"}) { $Name = "Svn"; } elsif(defined $Profile->{"Hg"}) { $Name = "Mercurial"; } return $Name; } sub getScmInfo() { my $Name = getScmName(); if(defined $Profile->{"Branch"}) { $Name .= " (".$Profile->{"Branch"}.")"; } return $Name; } sub htmlSpecChars(@) { my $S = shift(@_); my $Sp = 0; if(@_) { $Sp = shift(@_); } $S=~s/\&([^#])/&$1/g; $S=~s//>/g; if(not $Sp) { $S=~s/([^ ]) ([^ ])/$1\@SP\@$2/g; $S=~s/([^ ]) ([^ ])/$1\@SP\@$2/g; $S=~s/ / /g; $S=~s/\@SP\@/ /g; $S=~s/\n/\n/g; } return $S; } sub findChangelog($) { my $Dir = $_[0]; my $MIN_LOG = 250; foreach my $Name ("NEWS", "CHANGES", "CHANGES.txt", "RELEASE_NOTES", "ChangeLog", "ChangeLog.md", "Changelog", "changelog", "RELEASE_NOTES.md", "CHANGELOG.md", "CHANGELOG.txt", "RELEASE_NOTES.markdown", "NEWS.md", "CHANGES.md", "changes.txt", "changes", "CHANGELOG", "RELEASE-NOTES", "WHATSNEW", "CHANGE_LOG", "doc/ChangeLog", "ChangeLog.txt") { if(-f $Dir."/".$Name and (-s $Dir."/".$Name > $MIN_LOG)) { return $Name; } } return "None"; } sub getScmUpdateTime() { if(my $Source = $Profile->{"Versions"}{"current"}{"Source"}) { if(not -d $Source) { return undef; } my $Time = undef; my $Head = undef; if(defined $Profile->{"Git"}) { $Head = "$Source/.git/refs/heads/master"; if(not -f $Head) { # is not updated yet $Head = "$Source/.git/FETCH_HEAD"; } if(not -f $Head) { $Head = undef; } } elsif(defined $Profile->{"Svn"}) { $Head = "$Source/.svn/wc.db"; if(not -f $Head) { $Head = undef; } } elsif(defined $Profile->{"Hg"}) { $Head = "$Source/.hg/store"; if(not -e $Head) { $Head = undef; } } if($Head) { $Time = `stat -c \%Y \"$Head\"`; chomp($Time); } if($Time) { return $Time; } } return undef; } sub checkTarget($) { my $Elem = $_[0]; if(defined $In::Opt{"TargetElement"}) { if($Elem ne $In::Opt{"TargetElement"}) { return 0; } } return 1; } sub detectDate($) { my $V = $_[0]; if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"Date"}{$V}) { if(not updateRequired($V)) { return 0; } } } printMsg("INFO", "Detecting date of $V"); my $Source = $Profile->{"Versions"}{$V}{"Source"}; my $Date = undef; if($V eq "current") { if(defined $Profile->{"Git"}) { chdir($Source); my $Log = `git log -1 --date=iso`; chdir($ORIG_DIR); if($Log=~/ (\d+\-\d+\-\d+ \d+:\d+:\d+) /) { $Date = $1; } } elsif(defined $Profile->{"Svn"}) { chdir($Source); my $Log = `svn log -l1`; chdir($ORIG_DIR); if($Log=~/ (\d+\-\d+\-\d+ \d+:\d+:\d+) /) { $Date = $1; } } elsif(defined $Profile->{"Hg"}) { chdir($Source); my $Log = `hg log --limit 1 --template 'date: {date|isodate}'`; chdir($ORIG_DIR); if($Log=~/ (\d+\-\d+\-\d+ \d+:\d+) /) { $Date = $1; } } else { printMsg("ERROR", "Unknown type of source code repository"); return 0; } } else { my @Files = listPackage($Source); my %Dates = (); my $Zip = ($Source=~/\.(zip|jar)\Z/i); foreach my $Line (@Files) { if($Line!~/\Ad/ # skip directories and $Line=~/ (\d+)\-(\d+)\-(\d+) (\d+:\d+) /) { my $Date = undef; my $Time = $4; if($Zip) { $Date = $3."-".$1."-".$2; } else { $Date = $1."-".$2."-".$3; } $Dates{$Date." ".$Time} = 1; } } if(my @Sorted = sort {$b cmp $a} keys(%Dates)) { $Date = $Sorted[0]; } } if(defined $Date) { $DB->{"Date"}{$V} = $Date; } } sub listPackage($) { my $Path = $_[0]; my $Cmd = ""; if($Path=~/\.(tar\.\w+|tgz|tbz2)\Z/i) { $Cmd = "tar -tvf \"$Path\""; } elsif($Path=~/\.zip\Z/i) { $Cmd = "unzip -l $Path"; } if($Cmd) { my @Res = split(/\n/, `$Cmd 2>/dev/null`); return @Res; } return (); } sub readDump($) { my $Path = abs_path($_[0]); if($Path!~/\.\Q$COMPRESS\E\Z/) { return readFile($Path); } my $Cmd_E = "tar -xOf \"$Path\""; my $Content = qx/$Cmd_E/; return $Content; } sub compressABIDump($) { my $V = $_[0]; foreach my $Md5 (keys(%{$DB->{"ABIDump"}{$V}})) { my $DumpPath = $DB->{"ABIDump"}{$V}{$Md5}{"Path"}; if($DumpPath=~/\.\Q$COMPRESS\E\Z/) { next; } printMsg("INFO", "Compressing $DumpPath"); my $Dir = getDirname($DumpPath); my $Name = getFilename($DumpPath); my @Cmd_C = ("tar", "-C", $Dir, "-czf", $DumpPath.".".$COMPRESS, $Name); system(@Cmd_C); if($?) { exitStatus("Error", "Can't compress ABI dump"); } else { unlink($DumpPath); } } } sub createABIDump($) { my $V = $_[0]; if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"ABIDump"}{$V}) { if(not updateRequired($V)) { return 0; } } } delete($DB->{"ABIDump"}{$V}); # empty cache printMsg("INFO", "Creating ABI dump for $V"); my $Installed = $Profile->{"Versions"}{$V}{"Installed"}; if(not -d $Installed) { return 0; } my @Objects = findObjects($Installed); my $Dir = "abi_dump/$TARGET_LIB/$V"; if(-d $Dir) { rmtree($Dir); } if(not @Objects) { printMsg("ERROR", "can't find objects"); return 1; } my $TmpDir = $TMP_DIR."/objects"; foreach my $Object (sort {lc($a) cmp lc($b)} @Objects) { my $RPath = $Object; $RPath=~s/\A\Q$Installed\E\/*//; if(skipLib($RPath)) { next; } printMsg("INFO", "Creating ABI dump for $RPath"); my $Md5 = getMd5($RPath); my $ABIDir = $Dir."/".$Md5; my $ABIDump = $ABIDir."/ABI.dump"; if(not $Profile->{"NoCompress"}) { $ABIDump .= ".".$COMPRESS; } my $Cmd = $ABI_DUMPER." \"".$Object."\" -output \"".$ABIDump."\" -lver \"$V\""; if(not $Profile->{"PrivateABI"} or $Profile->{"PrivateABI"} eq "Off") { # set "PrivateABI":1 in the profile to check all symbols if($Profile->{"Mode"} eq "Kernel") { $Cmd .= " -kernel-export"; } else { $Cmd .= " -public-headers \"$Installed\""; if($Profile->{"UseTUDump"}) { $Cmd .= " -use-tu-dump -cache-headers \"$TmpDir\""; if(my $IncDefines = $Profile->{"IncludeDefines"}) { $Cmd .= " -include-defines \"$IncDefines\""; } if(my $IncPreamble = $Profile->{"IncludePreamble"}) { $Cmd .= " -include-preamble \"$IncPreamble\""; } if(defined $Profile->{"IncludePaths"}) { # May be empty to deny automatic generation of include paths $Cmd .= " -include-paths \"".$Profile->{"IncludePaths"}."\""; } } else { $Cmd .= " -ignore-tags \"$MODULES_DIR/ignore.tags\""; if(my $CtagsDef = $Profile->{"CtagsDef"}) { foreach my $Def (@{$CtagsDef}) { $Cmd .= " -ctags-def \"$Def\""; } } } if($Profile->{"ReimplementStd"}) { $Cmd .= " -reimplement-std"; } } } if($ABI_DUMPER_EE) { $Cmd .= " -extra-dump"; $Cmd .= " -extra-info \"".$Dir."/".$Md5."/debug/\""; } if($Profile->{"MixedHeaders"}) { $Cmd .= " -mixed-headers"; $Cmd .= " -debug"; } if($Profile->{"LambdaSupport"}) { $Cmd .= " -lambda"; } my @ConfKeys = ("Configure", "CMakeConfigure", "AutotoolsConfigure"); if($V eq "current") { @ConfKeys = ("CurrentConfigure", @ConfKeys) } my @Conf = (); foreach my $C (@ConfKeys) { if(defined $Profile->{$C}) { push(@Conf, $Profile->{$C}); } } if(@Conf) { if(my @LdDirs = getLdDirs($V, \@Conf)) { $Cmd .= " -ld-library-path \"".join(":", @LdDirs)."\""; } } if($In::Opt{"Debug"}) { printMsg("DEBUG", "executing $Cmd"); } my $Log = `$Cmd`; # execute if(-f $ABIDump) { $DB->{"ABIDump"}{$V}{$Md5}{"Path"} = $ABIDump; $DB->{"ABIDump"}{$V}{$Md5}{"Object"} = $RPath; my $ABI = eval(readDump($ABIDump)); $DB->{"ABIDump"}{$V}{$Md5}{"Lang"} = $ABI->{"Language"}; my $TotalSymbols = countSymbols($DB->{"ABIDump"}{$V}{$Md5}); $DB->{"ABIDump"}{$V}{$Md5}{"TotalSymbols"} = $TotalSymbols; $DB->{"ABIDump"}{$V}{$Md5}{"Version"} = $TOOL_VERSION; my @Meta = (); push(@Meta, "\"Object\": \"".$RPath."\""); push(@Meta, "\"Lang\": \"".$ABI->{"Language"}."\""); push(@Meta, "\"TotalSymbols\": \"".$TotalSymbols."\""); push(@Meta, "\"PublicABI\": \"1\""); push(@Meta, "\"Version\": \"".$TOOL_VERSION."\""); writeFile($Dir."/".$Md5."/meta.json", "{\n ".join(",\n ", @Meta)."\n}"); } else { printMsg("ERROR", "can't create ABI dump"); $FailedDump{$V}{$RPath} = 1; rmtree($ABIDir); } } if(-d $TmpDir) { rmtree($TmpDir); } $DoneDump{$V} = 1; } sub getObjectName($$) { my ($Object, $T) = @_; my $Name = getFilename($Object); if($T eq "Short") { if($Name=~/\A(.+)\.(so|ko)[\d\.]*\Z/) { return $1; } } elsif($T eq "SuperShort") { if($Name=~/\A(.+?)[\-\_]*(\d+[\d\.]*\-[\w\.\-]*)\.so(\.|\Z)/) { # libABC-4.6.6-alpha01.so return $1; } elsif($Name=~/\A(.+?)\-([a-zA-Z]?\d[\w\.\-]*)\.so(\.|\Z)/) { return $1; } elsif($Name=~/\A(.+?)[\d\.\-\_]*\.so(\.|\Z)/) { # libABC-4.6.5.so return $1; } } return undef; } sub dropPrefix($) { my $Path = $_[0]; $Path=~s/\A(usr\/|)(lib\/|lib64\/|lib32\/|)(src\/|)//; return $Path; } sub createABIView($) { my $V = $_[0]; if($Profile->{"Versions"}{$V}{"ABIView"} ne "On" and not (defined $In::Opt{"TargetVersion"} and defined $In::Opt{"TargetElement"})) { return 0; } if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"ABIView"}{$V}) { if(not updateRequired($V)) { return 0; } } } if(not getToolVer($ABI_VIEWER)) { printMsg("ERROR", "ABI Viewer is not installed"); return 0; } if(not $ABI_DUMPER_EE) { printMsg("ERROR", "ABI Dumper EE is not installed"); return 0; } printMsg("INFO", "Creating ABI View for $V"); if(not defined $DB->{"ABIDump"}{$V}) { createABIDump($V); } my $D = $DB->{"ABIDump"}{$V}; if(not $D) { return 0; } my @Objects = (); foreach my $Md5 (sort keys(%{$D})) { push(@Objects, $D->{$Md5}{"Object"}); } @Objects = sort {lc($a) cmp lc($b)} @Objects; foreach my $Object (@Objects) { if(skipLib($Object)) { next; } createABIView_Object($V, $Object); } my $Report = ""; $Report .= getHead("objects_view"); $Report .= "

View objects ABI: $V

\n"; $Report .= "
\n"; $Report .= "
\n"; $Report .= "\n"; $Report .= ""; $Report .= "\n"; $Report .= "\n"; $Report .= "\n"; foreach my $Object (@Objects) { if(skipLib($Object)) { next; } my $Name = dropPrefix($Object); $Report .= "\n"; $Report .= "\n"; my $Md5 = getMd5($Object); if(defined $DB->{"ABIView_D"}{$V}{$Md5}) { my $ABIView_D = $DB->{"ABIView_D"}{$V}{$Md5}; $Report .= "\n"; } else { $Report .= "\n"; } $Report .= "\n"; } $Report .= "
ObjectABI View
$NameviewN/A
\n"; $Report .= getSign("Other"); my $Title = showTitle().": View objects ABI of $V version"; my $Keywords = showTitle().", ABI, view, report"; my $Desc = "View objects ABI of the $TARGET_LIB $V"; $Report = composeHTML_Head("objects_view", $Title, $Keywords, $Desc, "report.css")."\n\n$Report\n\n\n"; my $Dir = "objects_view/$TARGET_LIB/$V"; my $Output = $Dir."/report.html"; writeFile($Output, $Report); $DB->{"ABIView"}{$V}{"Path"} = $Output; } sub createABIReport($$) { my ($V1, $V2) = @_; if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"ABIReport"}{$V1}{$V2}) { if(not updateRequired($V2)) { return 0; } } } delete($DB->{"ABIReport"}{$V1}{$V2}); # empty cache printMsg("INFO", "Creating objects ABI report between $V1 and $V2"); my $Cols = 5; my $RCol = 1; if($Profile->{"SourceCompat"} eq "On") { $Cols += 2; $RCol = 2; } my $ABIDiff = $Profile->{"Versions"}{$V2}{"ABIDiff"}; if($ABIDiff eq "On") { if(not getToolVer($ABI_VIEWER)) { printMsg("ERROR", "ABI Viewer is not installed"); return 0; } if(not $ABI_DUMPER_EE) { printMsg("ERROR", "ABI Dumper EE is not installed"); return 0; } } if($ABIDiff ne "On") { $Cols-=1; } if($Profile->{"CompatRate"} eq "Off") { $Cols-=$RCol; } if($Profile->{"ShowTotalProblems"} ne "On") { $Cols-=$RCol; } if(not defined $DB->{"Soname"}{$V1}) { detectSoname($V1); } if(not defined $DB->{"Soname"}{$V2}) { detectSoname($V2); } if($V2 eq "current") { # NOTE: additional check of consistency if(defined $DB->{"ABIDump"}{$V2}) { my $IPath = $Profile->{"Versions"}{$V2}{"Installed"}; foreach my $Md (sort keys(%{$DB->{"ABIDump"}{$V2}})) { if(not -e $IPath."/".$DB->{"ABIDump"}{$V2}{$Md}{"Object"}) { print STDERR "WARNING: It's necessary to regenerate ABI dump for $V2 (missed object)\n"; delete($DB->{"ABIDump"}{$V2}); last; } } if(defined $DB->{"ABIDump"}{$V2}) { foreach my $Obj (sort keys(%{$DB->{"Soname"}{$V2}})) { if(not defined $DB->{"ABIDump"}{$V2}{getMd5($Obj)}) { if(not defined $FailedDump{$V2}{$Obj}) { print STDERR "WARNING: It's necessary to regenerate ABI dump for $V2 (missed object dump)\n"; delete($DB->{"ABIDump"}{$V2}); last; } } } } } } if(defined $In::Opt{"RegenDump"} and $Profile->{"RegenDump"} ne "Off" and not defined $DoneDump{$V1}) { print "INFO: Regenerating ABI dump for $V1\n"; delete($DB->{"ABIDump"}{$V1}); } if(not defined $DB->{"ABIDump"}{$V1}) { createABIDump($V1); } if(not defined $DB->{"ABIDump"}{$V2}) { createABIDump($V2); } my $D1 = $DB->{"ABIDump"}{$V1}; my $D2 = $DB->{"ABIDump"}{$V2}; if(not $D1 or not $D2) { return 0; } my (@Objects1, @Objects2) = (); foreach my $Md5 (sort keys(%{$D1})) { my $Obj = $D1->{$Md5}{"Object"}; if(skipLib($Obj)) { next; } push(@Objects1, $Obj); } foreach my $Md5 (sort keys(%{$D2})) { my $Obj = $D2->{$Md5}{"Object"}; if(skipLib($Obj)) { next; } push(@Objects2, $Obj); } if($Profile->{"Mode"} eq "Kernel") { # move vmlinux to the top of the report @Objects1 = sort {lc(getFilename($a)) cmp lc(getFilename($b))} @Objects1; @Objects2 = sort {lc(getFilename($a)) cmp lc(getFilename($b))} @Objects2; @Objects1 = sort {($b eq "vmlinux") cmp ($a eq "vmlinux")} @Objects1; } else { @Objects1 = sort {lc($a) cmp lc($b)} @Objects1; @Objects2 = sort {lc($a) cmp lc($b)} @Objects2; } my %SonameObject2 = (); my %ShortName2 = (); my %SShortName2 = (); if(defined $DB->{"Soname"}{$V2}) { foreach my $Object2 (keys(%{$DB->{"Soname"}{$V2}})) { if($DB->{"Soname"}{$V2}{$Object2} ne "None") { $SonameObject2{$DB->{"Soname"}{$V2}{$Object2}}{$Object2} = 1; } } } foreach my $Object2 (@Objects2) { if(my $Short = getObjectName($Object2, "Short")) { $ShortName2{$Short}{$Object2} = 1; } if(my $SShort = getObjectName($Object2, "SuperShort")) { $SShortName2{$SShort}{$Object2} = 1; } } my (%Added, %Removed, %Mapped, %Mapped_R, %ChangedSoname, %RenamedObject) = (); # Match objects foreach my $Object1 (@Objects1) { my $Object2 = undef; # Try to match by SONAME my $Soname1 = undef; if(defined $DB->{"Soname"}{$V1} and defined $DB->{"Soname"}{$V1}{$Object1} and $DB->{"Soname"}{$V1}{$Object1} ne "None") { $Soname1 = $DB->{"Soname"}{$V1}{$Object1}; } if($Soname1) { if(defined $SonameObject2{$Soname1}) { my @Pair = keys(%{$SonameObject2{$Soname1}}); if($#Pair==0) { $Object2 = $Pair[0]; } else { printMsg("ERROR", "two or more objects with the same SONAME found"); } } } # Try to match by name if(not $Object2) { if(grep {$_ eq $Object1} @Objects2) { $Object2 = $Object1; } } # Try to match by short name if(not $Object2) { my $Short = getObjectName($Object1, "Short"); if(defined $ShortName2{$Short}) { my @Pair = keys(%{$ShortName2{$Short}}); if($#Pair==0) { $Object2 = $Pair[0]; } } } # Try to match by very short name if(not $Object2) { my $SShort = getObjectName($Object1, "SuperShort"); if(defined $SShortName2{$SShort}) { my @Pair = keys(%{$SShortName2{$SShort}}); if($#Pair==0) { $Object2 = $Pair[0]; } } } if($Object2) { $Mapped{$Object1} = $Object2; $Mapped_R{$Object2} = $Object1; } else { $Removed{$Object1} = 1; } } foreach my $Object2 (@Objects2) { if(not defined $Mapped_R{$Object2}) { $Added{$Object2} = 1; } } if(not keys(%Mapped)) { if($#Objects1==0 and $#Objects2==0) { $Mapped{$Objects1[0]} = $Objects2[0]; $RenamedObject{$Objects1[0]} = $Objects2[0]; delete($Removed{$Objects1[0]}); delete($Added{$Objects2[0]}); } } my @Objects = sort {lc($a) cmp lc($b)} keys(%Mapped); # Detect changed SONAME foreach my $Object1 (@Objects) { my $Object2 = $Mapped{$Object1}; my ($Soname1, $Soname2) = (getFilename($Object1), getFilename($Object2)); if(defined $DB->{"Soname"}{$V1} and defined $DB->{"Soname"}{$V1}{$Object1} and $DB->{"Soname"}{$V1}{$Object1} ne "None") { $Soname1 = $DB->{"Soname"}{$V1}{$Object1}; } if(defined $DB->{"Soname"}{$V2} and defined $DB->{"Soname"}{$V2}{$Object2} and $DB->{"Soname"}{$V2}{$Object2} ne "None") { $Soname2 = $DB->{"Soname"}{$V2}{$Object2}; } if($Soname1 and $Soname2 and $Soname1 ne $Soname2) { $ChangedSoname{$Object1}{"From"} = $Soname1; $ChangedSoname{$Object1}{"To"} = $Soname2; } } if(not $ObjectsReport) { if($In::Opt{"Rebuild"}) { # Remove old reports my $CDir = "compat_report/$TARGET_LIB/$V1/$V2"; if(-d $CDir) { rmtree($CDir); } } foreach my $Object1 (@Objects) { if(skipLib($Object1)) { next; } compareABIs($V1, $V2, $Object1, $Mapped{$Object1}); if($ABIDiff eq "On") { diffABIs($V1, $V2, $Object1, $Mapped{$Object1}); } } } my $Report = ""; $Report .= getHead("objects_report"); $Report .= "

Objects ABI report: $V1 vs $V2

\n"; # API/ABI changes report $Report .= "
\n"; $Report .= "
\n"; $Report .= "\n"; $Report .= ""; my $Cs = ""; my $Rs = ""; if($Profile->{"SourceCompat"} eq "On") { $Cs = " colspan='2'"; $Rs = " rowspan='2'"; } $Report .= "Object\n"; if($Profile->{"CompatRate"} ne "Off") { $Report .= "Backward
Compatibility\n"; } $Report .= "Added
Symbols\n"; $Report .= "Removed
Symbols\n"; if($Profile->{"ShowTotalProblems"} eq "On") { $Report .= "Total
Changes\n"; } if($ABIDiff eq "On") { $Report .= "ABI
Diff*\n"; } $Report .= "
\n"; if($Profile->{"SourceCompat"} eq "On" and ($Profile->{"CompatRate"} ne "Off" or $Profile->{"ShowTotalProblems"} eq "On")) { $Report .= ""; if($Profile->{"CompatRate"} ne "Off") { $Report .= "\n"; $Report .= "\n"; } if($Profile->{"ShowTotalProblems"} eq "On") { $Report .= "\n"; $Report .= "\n"; } $Report .= "\n"; } foreach my $Object2 (@Objects2) { my $Name = dropPrefix($Object2); if(defined $Added{$Object2}) { $Report .= "\n"; $Report .= "\n"; $Report .= "\n"; $Report .= "\n"; } } foreach my $Object1 (@Objects1) { if(skipLib($Object1)) { next; } $Report .= "\n"; my $Name = $Object1; if($Profile->{"Mode"} eq "Kernel") { $Name=~s/\A.*\///g; } else { $Name = dropPrefix($Name); } if($Mapped{$Object1}) { if(defined $ChangedSoname{$Object1}) { $Name .= "
"; $Name .= "
"; $Name .= "(changed SONAME from
\"".$ChangedSoname{$Object1}{"From"}."\"
to
\"".$ChangedSoname{$Object1}{"To"}."\")
"; } elsif(defined $RenamedObject{$Object1}) { $Name .= "
"; $Name .= "
"; $Name .= "(changed file name from
\"".getFilename($Object1)."\"
to
\"".$RenamedObject{$Object1}."\")
"; } } $Report .= "\n"; if($Mapped{$Object1}) { my $Md5 = getMd5($Object1, $Mapped{$Object1}); if(defined $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}) { my $ABIReport_D = $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}; my $BC_D = 100 - $ABIReport_D->{"Affected"}; my $AddedSymbols = $ABIReport_D->{"Added"}; my $RemovedSymbols = $ABIReport_D->{"Removed"}; my $TotalProblems = $ABIReport_D->{"TotalProblems"}; my $BC_D_Source = 100 - $ABIReport_D->{"Source_Affected"}; my $TotalProblems_Source = $ABIReport_D->{"Source_TotalProblems"}; my $Changed = ($AddedSymbols or $RemovedSymbols or $TotalProblems); if($Profile->{"CompatRate"} ne "Off") { my $CClass = "ok"; if($BC_D eq "100") { if($TotalProblems) { $CClass = "warning"; } } else { if(int($BC_D)>=90) { $CClass = "warning"; } elsif(int($BC_D)>=80) { $CClass = "almost_compatible"; } else { $CClass = "incompatible"; } } $Report .= "\n"; if($Profile->{"SourceCompat"} eq "On") { if(defined $ABIReport_D->{"Source_Affected"}) { my $CClass_Source = "ok"; if($BC_D_Source eq "100") { if($TotalProblems_Source) { $CClass_Source = "warning"; } } else { if(int($BC_D_Source)>=90) { $CClass_Source = "warning"; } elsif(int($BC_D_Source)>=80) { $CClass_Source = "almost_compatible"; } else { $CClass_Source = "incompatible"; } } $Report .= "\n"; } else { $Report .= "\n"; } } } if($AddedSymbols) { $Report .= "\n"; } else { $Report .= "\n"; } if($RemovedSymbols) { $Report .= "\n"; } else { $Report .= "\n"; } if($Profile->{"ShowTotalProblems"} eq "On") { if($TotalProblems) { $Report .= "\n"; } else { $Report .= "\n"; } if($Profile->{"SourceCompat"} eq "On") { if(not defined $TotalProblems_Source) { $Report .= "\n"; } elsif($TotalProblems_Source) { $Report .= "\n"; } else { $Report .= "\n"; } } } if($ABIDiff eq "On") { if(my $DiffPath = $DB->{"ABIDiff_D"}{$V1}{$V2}{$Md5}{"Path"}) { $Report .= "\n"; } else { $Report .= "\n"; } } } else { foreach (1 .. $Cols) { $Report .= "\n"; } } } elsif(defined $Removed{$Object1}) { $Report .= "\n"; } $Report .= "\n"; } $Report .= "
BCSCBCSC
$NameAdded to package
$Name"; if(not $Changed and $Profile->{"HideEmpty"}) { $Report .= formatNum($BC_D)."%"; } else { $Report .= "".formatNum($BC_D)."%"; } $Report .= ""; if(not $Changed and $Profile->{"HideEmpty"}) { $Report .= formatNum($BC_D_Source)."%"; } else { $Report .= "".formatNum($BC_D_Source)."%"; } $Report .= "N/A".$AddedSymbols.$LinkNew."0".$RemovedSymbols.$LinkRemoved."0$TotalProblems0N/A$TotalProblems_Source0diffN/AN/ARemoved from package
\n"; $Report .= getSign("Other"); my $Title = showTitle().": Objects ABI report between $V1 and $V2 versions"; my $Keywords = showTitle().", ABI, changes, compatibility, report"; my $Desc = "ABI changes/compatibility report between $V1 and $V2 versions of the $TARGET_LIB"; $Report = composeHTML_Head("objects_report", $Title, $Keywords, $Desc, "report.css")."\n\n$Report\n\n\n"; my $Dir = "objects_report/$TARGET_LIB/$V1/$V2"; my $Output = $Dir."/report.html"; writeFile($Output, $Report); my ($Affected_T, $AddedSymbols_T, $RemovedSymbols_T, $TotalProblems_T) = (0, 0, 0, 0); my ($Affected_T_Source, $TotalProblems_T_Source, $SourceReport_Available) = (0, 0, 0); my $TotalFuncs = 0; foreach my $Object (@Objects) { my $Md5 = getMd5($Object, $Mapped{$Object}); if(defined $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}) { my $ABIReport_D = $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}; my $Dump = $DB->{"ABIDump"}{$V1}{getMd5($Object)}; my $Funcs = countSymbolsF($Dump, $V1); $Affected_T += $ABIReport_D->{"Affected"} * $Funcs; $AddedSymbols_T += $ABIReport_D->{"Added"}; $RemovedSymbols_T += $ABIReport_D->{"Removed"}; $TotalProblems_T += $ABIReport_D->{"TotalProblems"}; if($Profile->{"SourceCompat"} eq "On") { if(defined $ABIReport_D->{"Source_Affected"}) { $Affected_T_Source += $ABIReport_D->{"Source_Affected"} * $Funcs; $TotalProblems_T_Source += $ABIReport_D->{"Source_TotalProblems"}; $SourceReport_Available = 1; } } $TotalFuncs += $Funcs; } } my ($AddedByObjects_T, $RemovedByObjects_T) = (0, 0); foreach my $Object (keys(%Added)) { my $Dump = $DB->{"ABIDump"}{$V2}{getMd5($Object)}; $AddedByObjects_T += countSymbolsF($Dump, $V2); } foreach my $Object (keys(%Removed)) { my $Dump = $DB->{"ABIDump"}{$V1}{getMd5($Object)}; $RemovedByObjects_T += countSymbolsF($Dump, $V1); } my $BC = 100; if($TotalFuncs) { $BC -= $Affected_T/$TotalFuncs; } if(my $Rm = keys(%Removed) and $#Objects1>=0) { if(my $T = $TotalFuncs + $RemovedByObjects_T) { $BC *= (1 - $RemovedByObjects_T/$T); } } $BC = formatNum($BC); my $BC_Source = 100; if($Profile->{"SourceCompat"} eq "On" and $SourceReport_Available) { if($TotalFuncs) { $BC_Source -= $Affected_T_Source/$TotalFuncs; } if(my $Rm = keys(%Removed) and $#Objects1>=0) { if(my $T = $TotalFuncs + $RemovedByObjects_T) { $BC_Source *= (1 - $RemovedByObjects_T/$T); } } $BC_Source = formatNum($BC_Source); } $DB->{"ABIReport"}{$V1}{$V2}{"Path"} = $Output; $DB->{"ABIReport"}{$V1}{$V2}{"BC"} = $BC; $DB->{"ABIReport"}{$V1}{$V2}{"Added"} = $AddedSymbols_T; $DB->{"ABIReport"}{$V1}{$V2}{"Removed"} = $RemovedSymbols_T; $DB->{"ABIReport"}{$V1}{$V2}{"TotalProblems"} = $TotalProblems_T; if($Profile->{"SourceCompat"} eq "On" and $SourceReport_Available) { $DB->{"ABIReport"}{$V1}{$V2}{"Source_BC"} = $BC_Source; $DB->{"ABIReport"}{$V1}{$V2}{"Source_TotalProblems"} = $TotalProblems_T_Source; } $DB->{"ABIReport"}{$V1}{$V2}{"ObjectsAdded"} = keys(%Added); $DB->{"ABIReport"}{$V1}{$V2}{"ObjectsRemoved"} = keys(%Removed); $DB->{"ABIReport"}{$V1}{$V2}{"ObjectsAddedSymbols"} = $AddedByObjects_T; $DB->{"ABIReport"}{$V1}{$V2}{"ObjectsRemovedSymbols"} = $RemovedByObjects_T; $DB->{"ABIReport"}{$V1}{$V2}{"ChangedSoname"} = keys(%ChangedSoname); $DB->{"ABIReport"}{$V1}{$V2}{"TotalObjects"} = $#Objects1 + 1; my @Meta = (); push(@Meta, "\"BC\": \"".$BC."\""); push(@Meta, "\"Added\": ".$AddedSymbols_T); push(@Meta, "\"Removed\": ".$RemovedSymbols_T); push(@Meta, "\"TotalProblems\": ".$TotalProblems_T); if($Profile->{"SourceCompat"} eq "On") { push(@Meta, "\"Source_BC\": ".$BC_Source); push(@Meta, "\"Source_TotalProblems\": ".$TotalProblems_T_Source); } push(@Meta, "\"ObjectsAdded\": ".keys(%Added)); push(@Meta, "\"ObjectsRemoved\": ".keys(%Removed)); push(@Meta, "\"ObjectsAddedSymbols\": ".$AddedByObjects_T); push(@Meta, "\"ObjectsRemovedSymbols\": ".$RemovedByObjects_T); push(@Meta, "\"ChangedSoname\": ".keys(%ChangedSoname)); push(@Meta, "\"TotalObjects\": ".($#Objects1 + 1)); writeFile($Dir."/meta.json", "{\n ".join(",\n ", @Meta)."\n}"); } sub getMd5(@) { my $S = join("", @_); my $Md5 = `echo -n \"$S\" | md5sum`; $Md5=~s/\s.*//g; # use Digest::MD5 qw(md5_hex); # my $Md5 = md5_hex(@_); return substr($Md5, 0, $MD5_LEN); } sub createABIView_Object($$) { my ($V, $Obj) = @_; if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"ABIView_D"}{$V} and defined $DB->{"ABIView_D"}{$V}{getMd5($Obj)}) { if(not updateRequired($V)) { return 0; } } } printMsg("INFO", "Creating ABI View for $Obj ($V)"); my $Md5 = getMd5($Obj); my $Dump = $DB->{"ABIDump"}{$V}{$Md5}{"Path"}; my $Dir = "abi_view/$TARGET_LIB/$V"; $Dir .= "/".$Md5; my $Output = $Dir."/symbols.html"; my $DumpDir = getDirname($Dump); if(not -d $DumpDir."/debug") { printMsg("ERROR", "please rebuild ABI dumps"); return 1; } my $Cmd = $ABI_VIEWER." -skip-std -vnum \"$V\" -output \"$Dir\" \"".$DumpDir."\""; qx/$Cmd/; # execute $DB->{"ABIView_D"}{$V}{$Md5}{"Path"} = $Output; return 0; } sub diffABIs($$$$) { my ($V1, $V2, $Obj1, $Obj2) = @_; my $Md5 = getMd5($Obj1, $Obj2); if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"ABIDiff_D"}{$V1}{$V2} and defined $DB->{"ABIDiff_D"}{$V1}{$V2}{$Md5}) { if(not updateRequired($V2)) { return 0; } } } delete($DB->{"ABIDiff_D"}{$V1}{$V2}{$Md5}); # empty cache printMsg("INFO", "Creating ABI diff for $Obj1 ($V1) and $Obj2 ($V2)"); my $Dump1 = $DB->{"ABIDump"}{$V1}{getMd5($Obj1)}; my $Dump2 = $DB->{"ABIDump"}{$V2}{getMd5($Obj2)}; my $Dir = "abi_diff/$TARGET_LIB/$V1/$V2/$Md5"; my $Output = $Dir."/symbols.html"; my $Cmd = $ABI_VIEWER." -diff -skip-std -vnum1 \"$V1\" -vnum2 \"$V2\" -output \"$Dir\" \"".getDirname($Dump1->{"Path"})."\" \"".getDirname($Dump2->{"Path"})."\""; qx/$Cmd/; # execute $DB->{"ABIDiff_D"}{$V1}{$V2}{$Md5}{"Path"} = $Output; } sub compareABIs($$$$) { my ($V1, $V2, $Obj1, $Obj2) = @_; my $Md5 = getMd5($Obj1, $Obj2); if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"ABIReport_D"}{$V1}{$V2} and defined $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}) { if(not updateRequired($V2)) { return 0; } } } delete($DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}); # empty cache printMsg("INFO", "Creating ABICC report for $Obj1 ($V1) and $Obj2 ($V2)"); my $TmpDir = $TMP_DIR."/abicc/"; mkpath($TmpDir); my $Dump1 = $DB->{"ABIDump"}{$V1}{getMd5($Obj1)}; my $Dump2 = $DB->{"ABIDump"}{$V2}{getMd5($Obj2)}; my $Dump1_Meta = readProfile(readFile(getDirname($Dump1->{"Path"})."/meta.json")); my $Dump2_Meta = readProfile(readFile(getDirname($Dump2->{"Path"})."/meta.json")); if(not $Dump1_Meta->{"PublicABI"}) { # support for old versions of ABI Tracker printMsg("INFO", "It's necessary to re-generate ABI dump for $V1"); if(not -d $Profile->{"Versions"}{$V1}{"Installed"}) { exitStatus("Error", "the version \'$V1\' is not installed"); } $DB->{"ABIDump"}{$V1} = undef; createABIDump($V1); } if(not $Dump2_Meta->{"PublicABI"}) { # support for old versions of ABI Tracker printMsg("INFO", "It's necessary to re-generate ABI dump for $V2"); if(not -d $Profile->{"Versions"}{$V2}{"Installed"}) { exitStatus("Error", "the version \'$V2\' is not installed"); } $DB->{"ABIDump"}{$V2} = undef; createABIDump($V2); } my $Dir = "compat_report/$TARGET_LIB/$V1/$V2/$Md5"; my $Output = $Dir."/abi_compat_report.html"; my $BinReport = $Dir."/abi_compat_report.html"; my $SrcReport = $Dir."/src_compat_report.html"; my $CompatOpt = "-bin -bin-report-path \"$BinReport\""; if($Profile->{"SourceCompat"} eq "On") { $CompatOpt .= " -src -src-report-path \"$SrcReport\""; } my $Module = getObjectName(getFilename($Obj1), "Short"); if(not $Module) { $Module = getFilename($Obj1); } my $Cmd = $ABI_CC." -l \"$Module\" -old \"".$Dump1->{"Path"}."\" -new \"".$Dump2->{"Path"}."\" ".$CompatOpt; if(my $AccOpts = getABICC_Options()) { $Cmd .= $AccOpts; } if($Profile->{"Mode"} eq "Kernel") { $Cmd .= " -limit-affected 2"; } if($In::Opt{"Debug"}) { printMsg("DEBUG", "executing $Cmd"); } qx/$Cmd/; # execute if(not -e $BinReport or ($Profile->{"SourceCompat"} eq "On" and not -e $SrcReport)) { rmtree($TmpDir); rmtree($Dir); return; } my ($Affected, $Added, $Removed) = (); my $Total = 0; my $Line = readLineNum($Output, 0); if($Line=~/affected:(.+?);/) { $Affected = $1; } if($Line=~/added:(.+?);/) { $Added = $1; } if($Line=~/removed:(.+?);/) { $Removed = $1; } while($Line=~s/(\w+_problems_\w+|changed_constants):(.+?);//) { $Total += $2; } my ($Affected_Source) = (); my $Total_Source = 0; if($Profile->{"SourceCompat"} eq "On") { my $SrcLine = readLineNum($SrcReport, 0); if($SrcLine=~/affected:(.+?);/) { $Affected_Source = $1; } while($SrcLine=~s/\w+_problems_\w+:(.+?);//) { $Total_Source += $1; } } my %Meta = (); $Meta{"Affected"} = $Affected; $Meta{"Added"} = $Added; $Meta{"Removed"} = $Removed; $Meta{"TotalProblems"} = $Total; $Meta{"Path"} = $BinReport; if($Profile->{"SourceCompat"} eq "On") { $Meta{"Source_Affected"} = $Affected_Source; $Meta{"Source_TotalProblems"} = $Total_Source; $Meta{"Source_ReportPath"} = $SrcReport; } $Meta{"Object1"} = $Obj1; $Meta{"Object2"} = $Obj2; $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5} = \%Meta; my @Meta = (); push(@Meta, "\"Affected\": \"".$Affected."\""); push(@Meta, "\"Added\": ".$Added); push(@Meta, "\"Removed\": ".$Removed); push(@Meta, "\"TotalProblems\": ".$Total); if($Profile->{"SourceCompat"} eq "On") { push(@Meta, "\"Source_Affected\": \"".$Affected_Source."\""); push(@Meta, "\"Source_TotalProblems\": \"".$Total_Source."\""); push(@Meta, "\"Source_ReportPath\": \"".$SrcReport."\""); } push(@Meta, "\"Object1\": \"".$Obj1."\""); push(@Meta, "\"Object2\": \"".$Obj2."\""); writeFile($Dir."/meta.json", "{\n ".join(",\n ", @Meta)."\n}"); my $Changed = ($Added or $Removed or $Total); if(not $Changed and $Profile->{"HideEmpty"}) { unlink($BinReport); if($Profile->{"SourceCompat"} eq "On") { unlink($SrcReport); } } rmtree($TmpDir); } sub getABICC_Options() { my $Opt = ""; if(my $SkipSymbols = $Profile->{"SkipSymbols"}) { $Opt .= " -skip-symbols \"$SkipSymbols\""; } if(my $SkipTypes = $Profile->{"SkipTypes"}) { $Opt .= " -skip-types \"$SkipTypes\""; } if(my $SkipInternalSymbols = $Profile->{"SkipInternalSymbols"}) { $Opt .= " -skip-internal-symbols \"$SkipInternalSymbols\""; } if(my $SkipInternalTypes = $Profile->{"SkipInternalTypes"}) { $Opt .= " -skip-internal-types \"$SkipInternalTypes\""; } if(my $SkipHeaders = $Profile->{"SkipHeaders"}) { my $TmpDir = $TMP_DIR."/abicc/"; writeFile($TmpDir."/headers.list", join("\n", @{$SkipHeaders})); $Opt .= " -skip-headers \"$TmpDir/headers.list\""; } if($Profile->{"SkipTypedefUncover"}) { $Opt .= " -skip-typedef-uncover"; } return $Opt; } sub createPkgdiff($$) { my ($V1, $V2) = @_; if($Profile->{"Versions"}{$V2}{"PkgDiff"} ne "On" and not (defined $In::Opt{"TargetVersion"} and defined $In::Opt{"TargetElement"})) { return 0; } if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"PackageDiff"}{$V1}{$V2}) { return 0; } } delete($DB->{"PackageDiff"}{$V1}{$V2}); # empty cache printMsg("INFO", "Creating package diff for $V1 and $V2"); my $Source1 = $Profile->{"Versions"}{$V1}{"Source"}; my $Source2 = $Profile->{"Versions"}{$V2}{"Source"}; my $Dir = "package_diff/$TARGET_LIB/$V1/$V2"; my $Output = $Dir."/report.html"; rmtree($Dir); my $Cmd = $PKGDIFF." -report-path \"$Output\" \"$Source1\" \"$Source2\""; my $Log = `$Cmd`; # execute if(-f $Output) { $DB->{"PackageDiff"}{$V1}{$V2}{"Path"} = $Output; if($Log=~/CHANGED\s*\((.+?)\%\)/) { $DB->{"PackageDiff"}{$V1}{$V2}{"Changed"} = $1; } } } sub getMaxPrefix(@) { my @Paths = @_; my %Prefix = (); foreach my $Path (@Paths) { my $P = getDirname($Path); do { $Prefix{$P}+=1; } while($P = getDirname($P)); } my @ByCount = sort {$Prefix{$b}<=>$Prefix{$a}} keys(%Prefix); my $Max = $Prefix{$ByCount[0]}; foreach my $P (sort {length($b)<=>length($a)} keys(%Prefix)) { if($Prefix{$P}==$Max) { return $P; } } return undef; } sub diffHeaders($$) { my ($V1, $V2) = @_; if($Profile->{"Versions"}{$V2}{"HeadersDiff"} ne "On" and not (defined $In::Opt{"TargetVersion"} and defined $In::Opt{"TargetElement"})) { return 0; } if(not $In::Opt{"Rebuild"}) { if(defined $DB->{"HeadersDiff"}{$V1}{$V2}) { if(not updateRequired($V2)) { return 0; } } } delete($DB->{"HeadersDiff"}{$V1}{$V2}); # empty cache printMsg("INFO", "Diff headers $V1 and $V2"); if(not checkCmd($RFCDIFF)) { printMsg("ERROR", "can't find \"$RFCDIFF\""); return 0; } my $I_Dir1 = $Profile->{"Versions"}{$V1}{"Installed"}; my $I_Dir2 = $Profile->{"Versions"}{$V2}{"Installed"}; if(not -d $I_Dir1) { return 0; } if(not -d $I_Dir2) { return 0; } my @AllFiles1 = findFiles($I_Dir1, "f"); my @AllFiles2 = findFiles($I_Dir2, "f"); my @Files1 = (); my @Files2 = (); foreach my $Path (@AllFiles1) { if(not isHeader($Path)) { next; } push(@Files1, $Path); } foreach my $Path (@AllFiles2) { if(not isHeader($Path)) { next; } push(@Files2, $Path); } my %Files1 = (); my %Files2 = (); my $Prefix1 = getMaxPrefix(@Files1); if(not $Prefix1) { $Prefix1 = $I_Dir1; } my $Prefix2 = getMaxPrefix(@Files2); if(not $Prefix2) { $Prefix2 = $I_Dir2; } my %Names1 = (); my %Names2 = (); foreach my $Path (@Files1) { if($Path=~/\A\Q$Prefix1\E\/*(.+?)\Z/) { $Files1{$1} = $Path; } $Names1{getFilename($Path)}{$Path} = 1; } foreach my $Path (@Files2) { if($Path=~/\A\Q$Prefix2\E\/*(.+?)\Z/) { $Files2{$1} = $Path; } $Names2{getFilename($Path)}{$Path} = 1; } my $TmpDir = $TMP_DIR."/diff/"; mkpath($TmpDir); my @Reports = (); foreach my $Path (sort {lc($a) cmp lc($b)} keys(%Files1)) { my $Path1 = $Files1{$Path}; my $Path2 = undef; if(defined $Files2{$Path}) { $Path2 = $Files2{$Path}; } if(not defined $Path2) { my $Name = getFilename($Path); if(defined $Names2{$Name}) { my @Paths2 = keys(%{$Names2{$Name}}); if($#Paths2==0) { $Path2 = $Paths2[0]; } else { # TODO } } } if(not defined $Path2) { next; } if(-s $Path1 == -s $Path2) { if(readFile($Path1) eq readFile($Path2)) { next; } } mkpath(getDirname($TmpDir."/".$Path)); my $Cmd_R = $RFCDIFF." --width 75 --stdout \"$Path1\" \"$Path2\" >$TmpDir/$Path 2>/dev/null"; qx/$Cmd_R/; # execute if(-s "$TmpDir/$Path") { push(@Reports, "$TmpDir/$Path"); } } my $Link = "This html diff was produced by rfcdiff 1.41."; $Link .= "The latest version is available from http://tools.ietf.org/tools/rfcdiff/"; my $Diff = ""; my $Total = 0; foreach my $Path (@Reports) { my $Content = readFile($Path); if((-s $Path)<3500 and $Content=~/The files are identical|No changes|Failed to create/i) { next; } my $RPath = $Path; $RPath=~s/\A$TmpDir\///; my $File = getFilename($Path); $Content=~s/<\!--(.|\n)+?-->\s*//g; $Content=~s/\A((.|\n)+)((.|\n)+)(<\/body>(.|\n)+)\Z/$3/; $Content=~s/(]*>)(.+)(<\/td>)/$1$3/; $Content=~s/(&&g; $Content=~s&&&g; $Content=~s&&&g; $Content=~s&&&g; if($Diff) { $Diff .= "

\n"; } $Diff .= $Content; $Total += 1; } my $Title = showTitle().": headers diff between $V1 and $V2 versions"; my $Keywords = showTitle().", header, diff"; my $Desc = "Diff for header files between $V1 and $V2 versions of $TARGET_LIB"; $Diff .= "
"; $Diff .= "
$Link
\n"; $Diff = "

Headers diff: $V1 vs $V2



".$Diff; $Diff = getHead("headers_diff").$Diff; $Diff = "
$Diff
"; $Diff = composeHTML_Head("headers_diff", $Title, $Keywords, $Desc, "headers_diff.css")."\n\n$Diff\n\n\n"; my $Output = "headers_diff/$TARGET_LIB/$V1/$V2"; writeFile($Output."/diff.html", $Diff); $DB->{"HeadersDiff"}{$V1}{$V2}{"Path"} = $Output."/diff.html"; $DB->{"HeadersDiff"}{$V1}{$V2}{"Total"} = $Total; writeFile($Output."/meta.json", "{\n \"Total\": $Total\n}"); rmtree($TmpDir); } sub showTitle() { if(defined $Profile->{"Title"}) { return $Profile->{"Title"}; } return $TARGET_LIB; } sub getHead($) { my $Sel = $_[0]; my $UrlPr = getTop($Sel); my $ReportHeader = "ABI
Tracker"; if(defined $Profile->{"ReportHeader"}) { $ReportHeader = $Profile->{"ReportHeader"}; } my $Head = ""; $Head .= "\n"; $Head .= ""; $Head .= ""; if(not defined $Profile->{"ReportHeader"}) { $Head .= ""; if($Sel ne "global_index") { $Head .= ""; } } $Head .= "\n
"; if($TARGET_LIB) { $Head .= "

".$ReportHeader."

"; } else { $Head .= "

".$ReportHeader."

"; } $Head .= "
"; $Head .= ""; $Head .= "

(".showTitle().")

"; $Head .= "
\n"; $Head .= "
\n"; $Head .= "
\n"; $Head .= "
\n"; return $Head; } sub getSign($) { my $T = $_[0]; my $Sign = ""; $Sign .= "
\n"; $Sign .= "
\n"; $Sign .= "
\n"; if($T eq "Home") { $Sign .= "\n"; } else { $Sign .= "\n"; } $Sign .= "
\n"; return $Sign; } sub getVersionsList() { my @Versions = keys(%{$Profile->{"Versions"}}); @Versions = sort {int($Profile->{"Versions"}{$a}{"Pos"})<=>int($Profile->{"Versions"}{$b}{"Pos"})} @Versions; if(my $Minimal = $Profile->{"MinimalVersion"}) { if(defined $Profile->{"Versions"}{$Minimal}) { my $MinPos = $Profile->{"Versions"}{$Minimal}{"Pos"}; my @Part = (); foreach (@Versions) { if($Profile->{"Versions"}{$_}{"Pos"}<=$MinPos) { push(@Part, $_); } } @Versions = @Part; } } return @Versions; } sub writeCss() { writeFile("css/common.css", readModule("Styles", "Common.css")); writeFile("css/report.css", readModule("Styles", "Report.css")); writeFile("css/headers_diff.css", readModule("Styles", "HeadersDiff.css")); writeFile("css/changelog.css", readModule("Styles", "Changelog.css")); } sub writeJs() { writeFile("js/index.js", readModule("Js", "Index.js")); } sub writeImages() { my $ImgDir = $MODULES_DIR."/Internals/Images"; if(not -d "images/") { mkpath("images/"); } foreach my $Img (listDir($ImgDir)) { copy($ImgDir."/".$Img, "images/"); } } sub createTimeline() { $DB->{"Updated"} = time; writeCss(); writeJs(); writeImages(); my $Title = showTitle().": API/ABI changes review"; my $Desc = "API/ABI compatibility analysis reports for ".showTitle(); my $Content = composeHTML_Head("timeline", $Title, $TARGET_LIB.", ABI, API, compatibility, report", $Desc, "report.css"); $Content .= "\n"; my @Rss = (); my $RssLink = $HomePage."tracker/timeline/$TARGET_LIB"; my @Versions = getVersionsList(); if(not @Versions or $#Versions<1) { printMsg("INFO", "No index created"); return; } my $CompatRate = "On"; my $Soname = "On"; my $Changelog = "Off"; my $HeadersDiff = "Off"; my $PkgDiff = "Off"; if($Profile->{"CompatRate"} eq "Off") { $CompatRate = "Off"; } if($Profile->{"Soname"} eq "Off") { $Soname = "Off"; } # High-detailed analysis for Enterprise usage (non-free) my $ABIView = "Off"; foreach my $V (@Versions) { if($Profile->{"Versions"}{$V}{"Changelog"} ne "Off") { $Changelog = "On"; } if($Profile->{"Versions"}{$V}{"HeadersDiff"} eq "On") { $HeadersDiff = "On"; } if($Profile->{"Versions"}{$V}{"PkgDiff"} eq "On") { $PkgDiff = "On"; } if($Profile->{"Versions"}{$V}{"ABIView"} eq "On") { $ABIView = "On"; } } my $Cols = 11; my $RCol = 1; if($Profile->{"SourceCompat"} eq "On") { $Cols += 2; $RCol = 2; } if($CompatRate eq "Off") { $Cols-=$RCol; } if($Profile->{"ShowTotalProblems"} ne "On") { $Cols-=$RCol; } if($Soname eq "Off") { $Cols-=1; } if($Changelog eq "Off") { $Cols-=1; } if($HeadersDiff eq "Off") { $Cols-=1; } if($PkgDiff eq "Off") { $Cols-=1; } if($ABIView eq "Off") { $Cols-=1; } $Content .= getHead("timeline"); my $ContentHeader = "API/ABI changes review"; if(defined $Profile->{"ContentHeader"}) { $ContentHeader = $Profile->{"ContentHeader"}; } if($In::Opt{"GenRss"}) { $ContentHeader .= " RSS"; } $Content .= "

".$ContentHeader."

\n"; $Content .= "
"; $Content .= "
"; my $GraphPath = "graph/$TARGET_LIB/graph.svg"; my $ShowGraph = (-f $GraphPath); my $ShowSponsor = (defined $In::Opt{"Sponsors"}); my $RightSide = ($ShowGraph or $ShowSponsor); if($RightSide) { $Content .= "\n"; $Content .= "\n"; $Content .= "\n"; $Content .= "
\n"; } my $Cs = ""; my $Rs = ""; if($Profile->{"SourceCompat"} eq "On") { $Cs = " colspan='2'"; $Rs = " rowspan='2'"; } $Content .= "\n"; $Content .= "\n"; $Content .= "Version\n"; $Content .= "Date\n"; if($Soname ne "Off") { $Content .= "Soname\n"; } if($Changelog ne "Off") { $Content .= "Change
Log\n"; } if($CompatRate ne "Off") { $Content .= "Backward
Compatibility\n"; } $Content .= "Added
Symbols\n"; $Content .= "Removed
Symbols\n"; if($Profile->{"ShowTotalProblems"} eq "On") { $Content .= "Total
Changes\n"; } if($HeadersDiff ne "Off") { $Content .= "Headers
Diff\n"; } if($PkgDiff ne "Off") { $Content .= "Package
Diff\n"; } if($ABIView ne "Off") { $Content .= "ABI
View*\n"; } $Content .= "
\n"; if($Profile->{"SourceCompat"} eq "On" and ($CompatRate ne "Off" or $Profile->{"ShowTotalProblems"} eq "On")) { $Content .= "\n"; if($CompatRate ne "Off") { $Content .= "\n"; $Content .= "\n"; } if($Profile->{"ShowTotalProblems"} eq "On") { $Content .= "\n"; $Content .= "\n"; } $Content .= "\n"; } foreach my $P (0 .. $#Versions) { my $V = $Versions[$P]; my $O_V = undef; if($P<$#Versions) { $O_V = $Versions[$P+1]; } my $ABIReport = undef; my $HDiff = undef; my $PackageDiff = undef; my $ABIViewReport = undef; if(defined $DB->{"ABIReport"} and defined $DB->{"ABIReport"}{$O_V} and defined $DB->{"ABIReport"}{$O_V}{$V}) { $ABIReport = $DB->{"ABIReport"}{$O_V}{$V}; } if(defined $DB->{"HeadersDiff"} and defined $DB->{"HeadersDiff"}{$O_V} and defined $DB->{"HeadersDiff"}{$O_V}{$V}) { $HDiff = $DB->{"HeadersDiff"}{$O_V}{$V}; } if(defined $DB->{"PackageDiff"} and defined $DB->{"PackageDiff"}{$O_V} and defined $DB->{"PackageDiff"}{$O_V}{$V}) { $PackageDiff = $DB->{"PackageDiff"}{$O_V}{$V}; } if(defined $DB->{"ABIView"} and defined $DB->{"ABIView"}{$V}) { $ABIViewReport = $DB->{"ABIView"}{$V}; } my $Date = "N/A"; my $Sover = "N/A"; if(defined $DB->{"Date"} and defined $DB->{"Date"}{$V}) { $Date = $DB->{"Date"}{$V}; } if(defined $DB->{"Sover"} and defined $DB->{"Sover"}{$V}) { $Sover = $DB->{"Sover"}{$V}; } my $Anchor = $V; if($V ne "current") { $Anchor = "v".$Anchor; } my $VTitle = getFilename($Profile->{"Versions"}{$V}{"Source"}); my $VShow = $V; if($V eq "current") { $VTitle = "current in ".getScmInfo(); if(my $Br = $Profile->{"Branch"}) { $VShow = getScmName(); if(length($Br)>10) { $Br = substr($Br, 0, 7)." ..."; } $VShow .= "
(".$Br.")"; } else { if(defined $Profile->{"Git"} or defined $Profile->{"Hg"}) { $VShow = "master"; } elsif(defined $Profile->{"Svn"}) { $VShow = "trunk"; } } } $Content .= ""; $Content .= "\n"; $Content .= "\n"; if($Soname ne "Off") { $Content .= "\n"; } if($Changelog ne "Off") { my $Chglog = $DB->{"Changelog"}{$V}; if($Chglog and $Chglog ne "Off" and $Profile->{"Versions"}{$V}{"Changelog"} ne "Off") { $Content .= "\n"; } elsif(index($Profile->{"Versions"}{$V}{"Changelog"}, "://")!=-1) { $Content .= "\n"; } else { $Content .= "\n"; } } if($CompatRate ne "Off") { if(defined $ABIReport) { my $BC = $ABIReport->{"BC"}; my $ObjectsAdded = $ABIReport->{"ObjectsAdded"}; my $ObjectsRemoved = $ABIReport->{"ObjectsRemoved"}; my $ChangedSoname = $ABIReport->{"ChangedSoname"}; my $TotalProblems = $ABIReport->{"TotalProblems"}; my $BC_Source = $ABIReport->{"Source_BC"}; my $TotalProblems_Source = $ABIReport->{"Source_TotalProblems"}; my @Note = (); if($ChangedSoname) { push(@Note, "changed SONAME"); } if($ObjectsAdded) { push(@Note, "added $ObjectsAdded object".getS($ObjectsAdded).""); } if($ObjectsRemoved) { push(@Note, "removed $ObjectsRemoved object".getS($ObjectsRemoved).""); } my $CClass = "ok"; if($BC ne "100") { if(int($BC)>=90) { $CClass = "warning"; } elsif(int($BC)>=80) { $CClass = "almost_compatible"; } else { $CClass = "incompatible"; } } elsif($TotalProblems) { $CClass = "warning"; } my $BC_Summary = "$BC%"; if(@Note) { $BC_Summary .= "
\n"; $BC_Summary .= "
\n"; $BC_Summary .= "".join("
", @Note)."
\n"; } if($Profile->{"SourceCompat"} eq "On") { my $CClass_Source = "ok"; if($BC_Source ne "100") { if(int($BC_Source)>=90) { $CClass_Source = "warning"; } elsif(int($BC_Source)>=80) { $CClass_Source = "almost_compatible"; } else { $CClass_Source = "incompatible"; } } elsif($TotalProblems_Source) { $CClass_Source = "warning"; } my $BC_Summary_Source = "$BC_Source%"; if(not defined $BC_Source) { $BC_Summary_Source = "N/A"; $CClass_Source = ""; } if($BC_Summary eq $BC_Summary_Source and $CClass eq $CClass_Source) { $Content .= "\n"; } else { $Content .= "\n"; $Content .= "\n"; } } else { $Content .= "\n"; } } else { $Content .= "\n"; if($Profile->{"SourceCompat"} eq "On") { $Content .= "\n"; } } } if(defined $ABIReport) { if(my $Added = $ABIReport->{"Added"}) { $Content .= "\n"; } else { $Content .= "\n"; } } else { $Content .= "\n"; } if(defined $ABIReport) { if(my $Removed = $ABIReport->{"Removed"}) { $Content .= "\n"; } else { $Content .= "\n"; } } else { $Content .= "\n"; } if($Profile->{"ShowTotalProblems"} eq "On") { if(defined $ABIReport) { if(my $TotalProblems = $ABIReport->{"TotalProblems"}) { $Content .= "\n"; } else { $Content .= "\n"; } if($Profile->{"SourceCompat"} eq "On") { if(not defined $ABIReport->{"Source_TotalProblems"}) { $Content .= "\n"; } elsif(my $TotalProblems_Source = $ABIReport->{"Source_TotalProblems"}) { $Content .= "\n"; } else { $Content .= "\n"; } } } else { $Content .= "\n"; if($Profile->{"SourceCompat"} eq "On") { $Content .= "\n"; } } } if($HeadersDiff ne "Off") { if(defined $HDiff and $Profile->{"Versions"}{$V}{"HeadersDiff"} eq "On") { if(my $ChangedHeaders = $HDiff->{"Total"}) { $Content .= "\n"; } else { $Content .= "\n"; } } else { $Content .= "\n"; } } if($PkgDiff ne "Off") { if(defined $PackageDiff and $Profile->{"Versions"}{$V}{"PkgDiff"} eq "On") { if(my $Changed = $PackageDiff->{"Changed"}) { $Content .= "\n"; } else { $Content .= "\n"; } } else { $Content .= "\n"; } } if($ABIView ne "Off") { if(defined $ABIViewReport and $Profile->{"Versions"}{$V}{"ABIView"} eq "On") { $Content .= "\n"; } else { $Content .= "\n"; } } $Content .= "\n"; if(my $Comment = $Profile->{"Versions"}{$V}{"Comment"}) { $Content .= "\n"; } if($In::Opt{"GenRss"} and defined $ABIReport and $V ne "current") { my @RssSum = ("Binary compatibility: ".$ABIReport->{"BC"}."%"); if(my $TotalProblems = $ABIReport->{"TotalProblems"}) { if($ABIReport->{"BC"} eq 100) { push(@RssSum, "$TotalProblems warning".getS($TotalProblems)); } else { push(@RssSum, "$TotalProblems problem".getS($TotalProblems)); } } if($ABIReport->{"ChangedSoname"}) { push(@RssSum, "changed SONAME"); } if(my $ObjectsAdded = $ABIReport->{"ObjectsAdded"}) { push(@RssSum, "added $ObjectsAdded object".getS($ObjectsAdded)); } if(my $ObjectsRemoved = $ABIReport->{"ObjectsRemoved"}) { push(@RssSum, "removed $ObjectsRemoved object".getS($ObjectsRemoved)); } if(my $Added = $ABIReport->{"Added"}) { push(@RssSum, "added $Added symbol".getS($Added)); } if(my $Removed = $ABIReport->{"Removed"}) { push(@RssSum, "removed $Removed symbol".getS($Removed)); } my $Desc = join(", ", @RssSum)."."; if($Profile->{"SourceCompat"} eq "On" and defined $ABIReport->{"Source_BC"}) { my @RssSum_Source = ("Source compatibility: ".$ABIReport->{"Source_BC"}."%"); if(my $TotalProblems_Source = $ABIReport->{"Source_TotalProblems"}) { if($ABIReport->{"Source_BC"} eq 100) { push(@RssSum_Source, "$TotalProblems_Source warning".getS($TotalProblems_Source)); } else { push(@RssSum_Source, "$TotalProblems_Source problem".getS($TotalProblems_Source)); } } $Desc .= " ".join(", ", @RssSum_Source)."."; } my $RssItem = "\n"; $RssItem .= " ".showTitle()." $V\n"; $RssItem .= " $RssLink\n"; $RssItem .= " ".$Desc."\n"; $RssItem .= " ".getRssDate($DB->{"Date"}{$V})."\n"; $RssItem .= ""; $RssItem=~s/\n/\n /gs; push(@Rss, " ".$RssItem); } } $Content .= "
BCSCBCSC
$VShow".showDate($V, $Date)."".$Sover."changelog{"Versions"}{$V}{"Changelog"}."\'>changelogN/A$BC_Summary$BC_Summary$BC_Summary_Source$BC_SummaryN/AN/A".$Added.$LinkNew."0N/A".$Removed.$LinkRemoved."0N/A$TotalProblems0N/A$TotalProblems_Source0N/AN/A$ChangedHeaders0N/A$Changed%0N/AviewN/A
NOTE: $Comment
\n"; $Content .= "
\n"; if(defined $Profile->{"Maintainer"}) { my $M = $Profile->{"Maintainer"}; if(defined $Profile->{"MaintainerUrl"}) { $M = "$M"; } $Content .= "Maintained by $M. "; } my $Date = localtime($DB->{"Updated"}); $Date=~s/(\d\d:\d\d):\d\d/$1/; $Content .= "Last updated on ".$Date."."; $Content .= "
\n"; $Content .= "
\n"; $Content .= "Generated by ABI Tracker, ABICC and ABI Dumper tools.\n"; if($RightSide) { $Content .= "
\n"; if($ShowSponsor) { if(not defined $LibrarySponsor{$TARGET_LIB}) { $Content .= "
\n"; $Content .= "Become a sponsor
of this report"; $Content .= "
\n"; } $Content .= "
\n"; } if($ShowGraph) { $Content .= "Timeline of ABI changes\n"; $Content .= "
\n"; $Content .= "
\n"; $Content .= "
\n"; $Content .= "

\n"; } if($ShowSponsor) { my %Weight = ( "Bronze" => 1, "Silver" => 2, "Gold" => 3, "Diamond" => 4 ); if(defined $LibrarySponsor{$TARGET_LIB}) { my $Sponsors = $LibrarySponsor{$TARGET_LIB}; $Content .= "

\n"; } $Content .= "
\n"; } $Content .= "
\n"; } $Content .= getSign("Home"); $Content .= ""; my $Output = "timeline/".$TARGET_LIB."/index.html"; writeFile($Output, $Content); printMsg("INFO", "The index has been generated to: $Output"); if($In::Opt{"GenRss"}) { my $RssFeed = "\n"; $RssFeed .= "\n\n"; $RssFeed .= "\n"; $RssFeed .= "ABI changes review for ".showTitle()."\n"; $RssFeed .= "$RssLink\n"; $RssFeed .= "Binary compatibility analysis reports for ".showTitle()."\n"; $RssFeed .= join("\n", @Rss)."\n"; $RssFeed .= "\n\n"; $RssFeed .= "\n"; writeFile("rss/".$TARGET_LIB."/feed.rss", $RssFeed); } } sub createJsonReport($) { my $Dir = $_[0]; if(not -d $Dir) { exitStatus("Access_Error", "can't access directory \'$Dir\'"); } my $MaxLen_C = 9; my $MaxLen_V = 16; my @Common = (); my %ShowKey = ( "Source_BC" => "Src_BC", "Source_TotalProblems" => "Src_TotalProblems" ); foreach my $K ("Title", "SourceUrl", "Tracker", "Maintainer") { my $Sp = ""; foreach (0 .. $MaxLen_C - length($K)) { $Sp .= " "; } my $Val = undef; if(defined $Profile->{$K}) { $Val = $Profile->{$K}; } elsif($K eq "Tracker") { $Val = $HomePage."tracker/timeline/".$TARGET_LIB."/"; } elsif($K eq "Title") { $Val = $TARGET_LIB; } if($Val) { push(@Common, "\"$K\": ".$Sp."\"$Val\""); } } my @RInfo = (); my @Versions = getVersionsList(); foreach my $P (0 .. $#Versions) { my $V = $Versions[$P]; if($V eq "current") { next; } my $O_V = undef; if($P<$#Versions) { $O_V = $Versions[$P+1]; } if(defined $DB->{"ABIReport"} and defined $DB->{"ABIReport"}{$O_V} and defined $DB->{"ABIReport"}{$O_V}{$V}) { my $ABIReport = $DB->{"ABIReport"}{$O_V}{$V}; my @VInfo = (); foreach my $K ("Version", "From", "BC", "Added", "Removed", "TotalProblems", "Source_BC", "Source_TotalProblems", "ObjectsAdded", "ObjectsRemoved", "ChangedSoname", "TotalObjects") { my $Val = undef; if(defined $ABIReport->{$K}) { $Val = $ABIReport->{$K}; } elsif($K eq "Version") { $Val = $V; } elsif($K eq "From") { $Val = $O_V; } else { next; } if($K eq "BC" or $K eq "Source_BC") { $Val .= "%"; } my $SK = $K; if(defined $ShowKey{$K}) { $SK = $ShowKey{$K}; } my $Sp = ""; foreach (0 .. $MaxLen_V - length($SK)) { $Sp .= " "; } if($K!~/BC|Version/ and int($Val) eq $Val) { # integer push(@VInfo, "\"$SK\": $Sp".$Val); } else { # string push(@VInfo, "\"$SK\": $Sp\"".$Val."\""); } } push(@RInfo, "{\n ".join(",\n ", @VInfo)."\n }"); } } my $Report = "{\n ".join(",\n ", @Common).",\n\n \"Reports\": [\n ".join(",\n ", @RInfo)."]\n}\n"; writeFile($Dir."/$TARGET_LIB.json", $Report); } sub createGlobalIndex() { my @Libs = (); if(not -d "timeline") { exitStatus("Error", "can't find timeline/ directory"); } foreach my $File (listDir("timeline")) { if($File ne "index.html") { push(@Libs, $File); } } if($#Libs<=0) { # for two or more libraries #return 0; } writeCss(); writeJs(); writeImages(); my $Title = "ABI Tracker: Maintained libraries"; my $Desc = "List of maintained libraries"; my $Content = composeHTML_Head("global_index", $Title, "", $Desc, "report.css", "index.js"); $Content .= "\n"; $Content .= getHead("global_index"); $Content .= "

Maintained libraries (".($#Libs+1).")

\n"; $Content .= "
\n"; if($#Libs>=10) { my $E = "applyFilter(this, 'List', 'Header', 'Note')"; $Content .= ""; $Content .= "\n"; $Content .= "\n"; $Content .= "\n"; $Content .= "\n"; $Content .= "
\n"; $Content .= "Filter: "; $Content .= "\n"; $Content .= "\n"; $Content .= "
\n"; $Content .= "\n"; } $Content .= "

\n"; $Content .= "\n"; $Content .= "\n"; $Content .= "\n"; $Content .= "\n"; # $Content .= "\n"; $Content .= "\n"; my %LibAttr = (); foreach my $L (sort @Libs) { my $Title = $L; # my ($M, $MUrl); my $DB_P = "db/$L/$DB_NAME"; if(-f $DB_P) { my $DB = eval(readFile($DB_P)); if(defined $DB->{"Title"}) { $Title = $DB->{"Title"}; } } $LibAttr{$L}{"Title"} = $Title; # $LibAttr{$L}{"Maintainer"} = $M; # $LibAttr{$L}{"MaintainerUrl"} = $MUrl; } foreach my $L (sort {lc($LibAttr{$a}{"Title"}) cmp lc($LibAttr{$b}{"Title"})} @Libs) { $Content .= ""; $Content .= ""; $Content .= ""; # my $M = $LibAttr{$L}{"Maintainer"}; # if(my $MUrl = $LibAttr{$L}{"MaintainerUrl"}) { # $M = "$M"; # } # $Content .= "\n"; $Content .= "\n"; } $Content .= "
".$LibAttr{$L}{"Title"}."review$M
"; $Content .= getSign("Other"); $Content .= ""; my $Output = "index.html"; writeFile($Output, $Content); printMsg("INFO", "The global index has been generated to: $Output"); } sub showDate($$) { my ($V, $Date) = @_; my ($D, $T) = ($Date, ""); if($Date=~/(.+) (.+)/) { ($D, $T) = ($1, $2); } if($V eq "current") { $T=~s/(\d+\:\d+)\:\d+/$1/; return $D."
".$T; } return $D; } sub readDB($) { my $Path = $_[0]; if(-f $Path) { my $P = eval(readFile($Path)); if(not $P) { exitStatus("Error", "please remove 'use strict' from code and retry"); } return $P; } return {}; } sub writeDB($) { my $Path = $_[0]; writeFile($Path, Dumper($DB)); } sub checkFiles() { my $HDiffs = "headers_diff/$TARGET_LIB"; foreach my $V1 (listDir($HDiffs)) { foreach my $V2 (listDir($HDiffs."/".$V1)) { if(not defined $DB->{"HeadersDiff"}{$V1}{$V2}) { $DB->{"HeadersDiff"}{$V1}{$V2}{"Path"} = $HDiffs."/".$V1."/".$V2."/diff.html"; my $Meta = readProfile(readFile($HDiffs."/".$V1."/".$V2."/meta.json")); $DB->{"HeadersDiff"}{$V1}{$V2}{"Total"} = $Meta->{"Total"}; } } } my $PkgDiffs = "package_diff/$TARGET_LIB"; foreach my $V1 (listDir($PkgDiffs)) { foreach my $V2 (listDir($PkgDiffs."/".$V1)) { if(not defined $DB->{"PackageDiff"}{$V1}{$V2}) { $DB->{"PackageDiff"}{$V1}{$V2}{"Path"} = $PkgDiffs."/".$V1."/".$V2."/report.html"; my $Line = readLineNum($DB->{"PackageDiff"}{$V1}{$V2}{"Path"}, 0); if($Line=~/changed:(.+?);/) { $DB->{"PackageDiff"}{$V1}{$V2}{"Changed"} = $1; } } } } my $Changelogs = "changelog/$TARGET_LIB"; foreach my $V (listDir($Changelogs)) { if(not defined $DB->{"Changelog"}{$V}) { $DB->{"Changelog"}{$V} = $Changelogs."/".$V."/log.html"; } } my $Dumps = "abi_dump/$TARGET_LIB"; foreach my $V (listDir($Dumps)) { foreach my $Md5 (listDir($Dumps."/".$V)) { if(not defined $DB->{"ABIDump"}{$V}{$Md5}) { my %Info = (); my $Dir = $Dumps."/".$V."/".$Md5; $Info{"Path"} = $Dir."/ABI.dump"; if(-e $Info{"Path"}.".".$COMPRESS) { $Info{"Path"} .= ".".$COMPRESS; } my $Meta = readProfile(readFile($Dir."/meta.json")); $Info{"Object"} = $Meta->{"Object"}; $Info{"Lang"} = $Meta->{"Lang"}; $Info{"TotalSymbols"} = $Meta->{"TotalSymbols"}; $Info{"Version"} = $Meta->{"Version"}; $DB->{"ABIDump"}{$V}{$Md5} = \%Info; } } } my $ABIReports_D = "compat_report/$TARGET_LIB"; foreach my $V1 (listDir($ABIReports_D)) { foreach my $V2 (listDir($ABIReports_D."/".$V1)) { foreach my $Md5 (listDir($ABIReports_D."/".$V1."/".$V2)) { if(not defined $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}) { my %Info = (); my $Dir = $ABIReports_D."/".$V1."/".$V2."/".$Md5; $Info{"Path"} = $Dir."/abi_compat_report.html"; my $Meta = readProfile(readFile($Dir."/meta.json")); $Info{"Affected"} = $Meta->{"Affected"}; $Info{"Added"} = $Meta->{"Added"}; $Info{"Removed"} = $Meta->{"Removed"}; $Info{"TotalProblems"} = $Meta->{"TotalProblems"}; if($Profile->{"SourceCompat"} eq "On") { $Info{"Source_Affected"} = $Meta->{"Source_Affected"}; $Info{"Source_TotalProblems"} = $Meta->{"Source_TotalProblems"}; $Info{"Source_ReportPath"} = $Meta->{"Source_ReportPath"}; } $Info{"Object1"} = $Meta->{"Object1"}; $Info{"Object2"} = $Meta->{"Object2"}; $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5} = \%Info; } } } } my $ABIReports = "objects_report/$TARGET_LIB"; foreach my $V1 (listDir($ABIReports)) { foreach my $V2 (listDir($ABIReports."/".$V1)) { if(not defined $DB->{"ABIReport"}{$V1}{$V2}) { my %Info = (); my $Dir = $ABIReports."/".$V1."/".$V2; $Info{"Path"} = $Dir."/report.html"; my $Meta = readProfile(readFile($Dir."/meta.json")); $Info{"BC"} = $Meta->{"BC"}; $Info{"Added"} = $Meta->{"Added"}; $Info{"Removed"} = $Meta->{"Removed"}; $Info{"TotalProblems"} = $Meta->{"TotalProblems"}; if($Profile->{"SourceCompat"} eq "On") { $Info{"Source_BC"} = $Meta->{"Source_BC"}; $Info{"Source_TotalProblems"} = $Meta->{"Source_TotalProblems"}; } $Info{"ObjectsAdded"} = $Meta->{"ObjectsAdded"}; $Info{"ObjectsRemoved"} = $Meta->{"ObjectsRemoved"}; $Info{"ChangedSoname"} = $Meta->{"ChangedSoname"}; $DB->{"ABIReport"}{$V1}{$V2} = \%Info; } } } my $ABIViews_D = "abi_view/$TARGET_LIB"; foreach my $V (listDir($ABIViews_D)) { foreach my $Md5 (listDir($ABIViews_D."/".$V)) { if(not defined $DB->{"ABIView_D"}{$V}{$Md5}) { $DB->{"ABIView_D"}{$V}{$Md5}{"Path"} = $ABIViews_D."/".$V."/".$Md5."/symbols.html"; } } } my $ABIViews = "objects_view/$TARGET_LIB"; foreach my $V (listDir($ABIViews)) { if(not defined $DB->{"ABIView"}{$V}) { $DB->{"ABIView"}{$V}{"Path"} = $ABIViews."/".$V."/report.html"; } } } sub checkDB() { foreach my $V1 (keys(%{$DB->{"HeadersDiff"}})) { foreach my $V2 (keys(%{$DB->{"HeadersDiff"}{$V1}})) { if(not -e $DB->{"HeadersDiff"}{$V1}{$V2}{"Path"}) { delete($DB->{"HeadersDiff"}{$V1}{$V2}); if(not keys(%{$DB->{"HeadersDiff"}{$V1}})) { delete($DB->{"HeadersDiff"}{$V1}); } } } } foreach my $V1 (keys(%{$DB->{"PackageDiff"}})) { foreach my $V2 (keys(%{$DB->{"PackageDiff"}{$V1}})) { if(not -e $DB->{"PackageDiff"}{$V1}{$V2}{"Path"}) { delete($DB->{"PackageDiff"}{$V1}{$V2}); if(not keys(%{$DB->{"PackageDiff"}{$V1}})) { delete($DB->{"PackageDiff"}{$V1}); } } } } foreach my $V (keys(%{$DB->{"Changelog"}})) { if($DB->{"Changelog"}{$V} ne "Off") { if(not -e $DB->{"Changelog"}{$V}) { delete($DB->{"Changelog"}{$V}); } } } foreach my $V (keys(%{$DB->{"ABIDump"}})) { foreach my $Md5 (keys(%{$DB->{"ABIDump"}{$V}})) { if(not -e $DB->{"ABIDump"}{$V}{$Md5}{"Path"}) { delete($DB->{"ABIDump"}{$V}{$Md5}); } } if(not keys(%{$DB->{"ABIDump"}{$V}})) { delete($DB->{"ABIDump"}{$V}); } } foreach my $V1 (keys(%{$DB->{"ABIReport_D"}})) { foreach my $V2 (keys(%{$DB->{"ABIReport_D"}{$V1}})) { foreach my $Md5 (keys(%{$DB->{"ABIReport_D"}{$V1}{$V2}})) { if(not -e $DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}{"Path"}) { delete($DB->{"ABIReport_D"}{$V1}{$V2}{$Md5}); if(not keys(%{$DB->{"ABIReport_D"}{$V1}{$V2}})) { delete($DB->{"ABIReport_D"}{$V1}{$V2}); } if(not keys(%{$DB->{"ABIReport_D"}{$V1}})) { delete($DB->{"ABIReport_D"}{$V1}); } } } } } foreach my $V1 (keys(%{$DB->{"ABIReport"}})) { foreach my $V2 (keys(%{$DB->{"ABIReport"}{$V1}})) { if(not -e $DB->{"ABIReport"}{$V1}{$V2}{"Path"}) { delete($DB->{"ABIReport"}{$V1}{$V2}); if(not keys(%{$DB->{"ABIReport"}{$V1}})) { delete($DB->{"ABIReport"}{$V1}); } } } } foreach my $V (keys(%{$DB->{"ABIView_D"}})) { foreach my $Md5 (keys(%{$DB->{"ABIView_D"}{$V}})) { if(not -e $DB->{"ABIView_D"}{$V}{$Md5}{"Path"}) { delete($DB->{"ABIView_D"}{$V}{$Md5}); if(not keys(%{$DB->{"ABIView_D"}{$V}})) { delete($DB->{"ABIView_D"}{$V}); } } } } foreach my $V (keys(%{$DB->{"ABIView"}})) { if(not -e $DB->{"ABIView"}{$V}{"Path"}) { delete($DB->{"ABIView"}{$V}); } } foreach my $V (keys(%{$DB->{"Soname"}})) { if($V eq "current") { if(defined $Profile->{"Versions"}{$V}) { my $IPath = $Profile->{"Versions"}{$V}{"Installed"}; foreach my $Obj (keys(%{$DB->{"Soname"}{$V}})) { if(not -e $IPath."/".$Obj) { delete($DB->{"Soname"}{$V}); delete($DB->{"Sover"}{$V}); last; } } } else { delete($DB->{"Soname"}{$V}); delete($DB->{"Sover"}{$V}); } } } } sub safeExit() { chdir($ORIG_DIR); printMsg("INFO", "\nGot INT signal"); printMsg("INFO", "Exiting"); if($DB_PATH) { writeDB($DB_PATH); } exit(1); } sub getToolVer($) { my $T = $_[0]; return `$T -dumpversion`; } sub getToolVerInfo($) { my $T = $_[0]; return `$T -version`; } sub scenario() { $Data::Dumper::Sortkeys = 1; $SIG{INT} = \&safeExit; if($In::Opt{"Rebuild"}) { $In::Opt{"Build"} = 1; } if($In::Opt{"TargetElement"}) { if($In::Opt{"TargetElement"}!~/\A(date|dates|soname|changelog|abidump|abireport|rfcdiff|headersdiff|pkgdiff|packagediff|abiview|graph|objectsreport|compress)\Z/) { exitStatus("Error", "the value of -target option should be one of the following: date, soname, changelog, abidump, abireport, rfcdiff, pkgdiff."); } } if($In::Opt{"TargetElement"} eq "objectsreport") { $In::Opt{"TargetElement"} = "abireport"; $ObjectsReport = 1; } if($In::Opt{"DumpVersion"}) { printMsg("INFO", $TOOL_VERSION); exit(0); } if($In::Opt{"Help"}) { printMsg("INFO", $HelpMessage); exit(0); } if(-d "archives_report") { exitStatus("Error", "Can't execute inside the Java API tracker home directory"); } # check ABI Dumper if(my $Version = getToolVer($ABI_DUMPER)) { if(cmpVersions_S($Version, $ABI_DUMPER_VERSION)<0) { exitStatus("Module_Error", "the version of ABI Dumper should be $ABI_DUMPER_VERSION or newer"); } if(getToolVerInfo($ABI_DUMPER)=~/EE/) { $ABI_DUMPER_EE = 1; } } else { exitStatus("Module_Error", "cannot find \'$ABI_DUMPER\'"); } # check ABI CC if(my $Version = getToolVer($ABI_CC)) { if(cmpVersions_S($Version, $ABI_CC_VERSION)<0) { exitStatus("Module_Error", "the version of ABI Compliance Checker should be $ABI_CC_VERSION or newer"); } } else { exitStatus("Module_Error", "cannot find \'$ABI_CC\'"); } my @Reports = ("timeline", "package_diff", "headers_diff", "changelog", "abi_dump", "objects_report", "objects_view", "compat_report", "abi_view", "graph"); if(my $Profile_Path = $ARGV[0]) { if(not $Profile_Path) { exitStatus("Error", "profile path is not specified"); } if(not -e $Profile_Path) { exitStatus("Access_Error", "can't access \'$Profile_Path\'"); } $Profile = readProfile(readFile($Profile_Path)); if(defined $Profile->{"ShowTotalChanges"}) { $Profile->{"ShowTotalProblems"} = $Profile->{"ShowTotalChanges"}; } if($Profile->{"ReportStyle"} eq "SimpleLinks") { $LinkClass = ""; $LinkNew = ""; $LinkRemoved = ""; } if(not $Profile->{"Name"}) { exitStatus("Error", "name of the library is not specified in profile"); } foreach my $V (sort keys(%{$Profile->{"Versions"}})) { if($Profile->{"Versions"}{$V}{"Deleted"} and $Profile->{"Versions"}{$V}{"Deleted"} ne "Off") { # do not show this version in the report delete($Profile->{"Versions"}{$V}); next; } if(skipVersion($V)) { delete($Profile->{"Versions"}{$V}); next; } } $TARGET_LIB = $Profile->{"Name"}; $DB_PATH = "db/".$TARGET_LIB."/".$DB_NAME; if(my $SponsorsFile = $In::Opt{"Sponsors"}) { if(not -f $SponsorsFile) { exitStatus("Access_Error", "can't access \'$SponsorsFile\'"); } my $Supports = readProfile(readFile($SponsorsFile)); my $CurDate = getDate(); foreach my $N (sort {$a<=>$b} keys(%{$Supports->{"Supports"}})) { my $Support = $Supports->{"Supports"}{$N}; my $Till = delete($Support->{"Till"}); if(($Till cmp $CurDate) == -1) { next; } my $Libs = delete($Support->{"Libraries"}); foreach my $L (@{$Libs}) { if($L eq "*") { $L = $TARGET_LIB; } $LibrarySponsor{$L}{$Support->{"Name"}} = $Support; } } } $In::Opt{"TargetLib"} = $TARGET_LIB; $In::Opt{"DBPath"} = $DB_PATH; if($In::Opt{"Clear"}) { printMsg("INFO", "Remove $DB_PATH"); unlink($DB_PATH); foreach my $Dir (@Reports) { printMsg("INFO", "Remove $Dir/$TARGET_LIB"); rmtree($Dir."/".$TARGET_LIB); } exit(0); } $DB = readDB($DB_PATH); $DB->{"Maintainer"} = $Profile->{"Maintainer"}; $DB->{"MaintainerUrl"} = $Profile->{"MaintainerUrl"}; $DB->{"Title"} = $Profile->{"Title"}; checkDB(); checkFiles(); if($In::Opt{"CleanUnused"}) { cleanUnused(); } if($In::Opt{"Build"}) { writeDB($DB_PATH); buildData(); } writeDB($DB_PATH); if(my $ToDir = $In::Opt{"JsonReport"}) { createJsonReport($ToDir); } else { createTimeline(); } } if($In::Opt{"GlobalIndex"}) { createGlobalIndex(); } if(my $ToDir = $In::Opt{"Deploy"}) { printMsg("INFO", "Deploy to $ToDir"); $ToDir = abs_path($ToDir); if(not -d $ToDir) { mkpath($ToDir); } if($TARGET_LIB) { # clear deploy directory foreach my $Dir (@Reports) { rmtree($ToDir."/".$Dir."/".$TARGET_LIB); } # copy reports foreach my $Dir (@Reports, "db") { if(-d $Dir."/".$TARGET_LIB) { printMsg("INFO", "Copy $Dir/$TARGET_LIB"); mkpath($ToDir."/".$Dir); system("cp -fr \"$Dir/$TARGET_LIB\" \"$ToDir/$Dir/\""); } } printMsg("INFO", "Copy css"); system("cp -fr css \"$ToDir/\""); } else { # clear deploy directory foreach my $Dir (@Reports) { rmtree($ToDir."/".$Dir); } # copy reports foreach my $Dir (@Reports, "db") { if(-d $Dir) { printMsg("INFO", "Copy $Dir"); system("cp -fr \"$Dir\" \"$ToDir/\""); } } printMsg("INFO", "Copy css"); system("cp -fr css \"$ToDir/\""); } } } scenario(); abi-tracker-1.11/modules/000077500000000000000000000000001315145562600153005ustar00rootroot00000000000000abi-tracker-1.11/modules/Internals/000077500000000000000000000000001315145562600172375ustar00rootroot00000000000000abi-tracker-1.11/modules/Internals/Basic.pm000066400000000000000000000115441315145562600206230ustar00rootroot00000000000000################################################################## # A module with simple functions # # Copyright (C) 2015-2017 Andrey Ponomarenko's ABI Laboratory # # Written by Andrey Ponomarenko # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License or the GNU Lesser # General Public License as published by the Free Software Foundation. # # 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 # and the GNU Lesser General Public License along with this program. # If not, see . ################################################################## use strict; use POSIX qw(strftime); use Fcntl; sub findFiles(@) { my ($Path, $Type, $Regex, $Name) = @_; my $Cmd = "find \"$Path\""; if($Type) { $Cmd .= " -type ".$Type; } if($Regex) { $Cmd .= " -regex \"".$Regex."\""; } if($Name) { $Cmd .= " -name \"".$Name."\""; } my @Res = split(/\n/, `$Cmd`); return @Res; } sub readBytes($) { # ELF: 7f454c46 sysopen(FILE, $_[0], O_RDONLY); sysread(FILE, my $Header, 4); close(FILE); my @Bytes = map { sprintf('%02x', ord($_)) } split (//, $Header); return join("", @Bytes); } sub listDir($) { my $Path = $_[0]; return () if(not $Path); opendir(my $DH, $Path); return () if(not $DH); my @Contents = grep { $_ ne "." && $_ ne ".." } readdir($DH); return @Contents; } sub getFilename($) { # much faster than basename() from File::Basename module if($_[0] and $_[0]=~/([^\/\\]+)[\/\\]*\Z/) { return $1; } return ""; } sub getDirname($) { # much faster than dirname() from File::Basename module if($_[0] and $_[0]=~/\A(.*?)[\/\\]+[^\/\\]*[\/\\]*\Z/) { return $1; } return ""; } sub readFile($) { my $Path = $_[0]; return "" if(not $Path or not -f $Path); open(FILE, $Path); local $/ = undef; my $Content = ; close(FILE); return $Content; } sub appendFile($$) { my ($Path, $Content) = @_; return if(not $Path); if(my $Dir = getDirname($Path)) { mkpath($Dir); } open(FILE, ">>", $Path) || die ("can't open file \'$Path\': $!\n"); print FILE $Content; close(FILE); } sub writeFile($$) { my ($Path, $Content) = @_; return if(not $Path); if(my $Dir = getDirname($Path)) { mkpath($Dir); } open(FILE, ">", $Path) || die ("can't open file \'$Path\': $!\n"); print FILE $Content; close(FILE); } sub extractPackage($$) { my ($Path, $OutDir) = @_; if($Path=~/\.(tar\.\w+|tgz|tbz2)\Z/i) { return "tar -xf $Path --directory=$OutDir"; } elsif($Path=~/\.zip\Z/i) { return "unzip $Path -d $OutDir"; } return undef; } sub readLineNum($$) { my ($Path, $Num) = @_; open (FILE, $Path) or return undef; foreach (1 ... $Num) { ; } my $Line = ; close(FILE); return $Line; } sub isHeader($) { my $Path = $_[0]; return ($Path=~/\.(h|hh|hp|hxx|hpp|h\+\+|tcc)\Z/i); } sub cmpVersions_S($$) { # compare two versions in dotted-numeric format my ($V1, $V2) = @_; return 0 if($V1 eq $V2); my @V1Parts = split(/\./, $V1); my @V2Parts = split(/\./, $V2); for (my $i = 0; $i <= $#V1Parts && $i <= $#V2Parts; $i++) { return -1 if(int($V1Parts[$i]) < int($V2Parts[$i])); return 1 if(int($V1Parts[$i]) > int($V2Parts[$i])); } return -1 if($#V1Parts < $#V2Parts); return 1 if($#V1Parts > $#V2Parts); return 0; } sub checkCmd($) { my $Cmd = $_[0]; foreach my $Path (sort {length($a)<=>length($b)} split(/:/, $ENV{"PATH"})) { if(-x $Path."/".$Cmd) { return 1; } } return 0; } sub getMajor($$) { my ($V, $L) = @_; $V=~s/[\-_]/./g; my @P = split(/\./, $V); if($#P>=$L) { return join(".", splice(@P, 0, $L)); } return $V; } sub formatNum($) { my $Num = $_[0]; if($Num=~/\A(\d+\.\d\d)/) { return $1; } return $Num } sub fNum($) { my $N = $_[0]; if(length($N)==1) { return "0".$N; } return $N; } sub getDate() { my ($D, $M, $Y) = (localtime)[3, 4, 5]; return (1900+$Y)."-".fNum($M+1)."-".fNum($D); } sub getRssDate($) { my $Date = $_[0]; my ($Year, $Mon, $Mday, $Hour, $Min) = split(/[\s\-:]+/, $Date); return strftime('%a, %d %b %Y %T', 0, $Min, $Hour, $Mday, $Mon-1, $Year-1900)." ".strftime('%z', localtime); } sub getS($) { if($_[0]>1) { return "s"; } return ""; } return 1; abi-tracker-1.11/modules/Internals/Images/000077500000000000000000000000001315145562600204445ustar00rootroot00000000000000abi-tracker-1.11/modules/Internals/Images/RSS.png000066400000000000000000000021731315145562600216240ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs N Nw#IDATx]]S#ڒQD"M(*^H$‹'τ>H!TPi C%:JQT~=Ws'+3{uZܽdVbWQI?Bo ; a+Fq2/;HobH%ūxKHDg srI@|;1mǫ4܍>U%!_`MW#h_UK 7Ve?6L XոO~WmxT(ל['a\1.- [q41 D.qt8I.Ғ0cބ>F+q.旰Ӌ{O$6}!an|Gp NLw$M3`v8A8.msl6䱊(M4&\^ ^+hʢ)Aj,؞+$,֘PgL e0!,nα?OOl\aLI<$sCdHzEJ^D{.6\c6(DjpPl;*TvC`gVӢ}TreƠ0cnW|:kK7(f =²#œpޅwu Vꮍz2GwP!fq=BE؊Vu, 8_Ost\KB֨ҘEشRFD?o2N*܆q,uPBhDczTBE4{K1$ĂX_>]:\7D?K8^@թF;~i-蝝~ P|s2QxeXIg_SHM_±WDڶ wXnN[P)&K6E&S8{*c*s{aᕜ>#9lB 9vP&Њ-¥VdL JO_ʰlp%k<_ ->Nd+7&lŜI/7/>.,_k(&RSSSSSSSSSs/ u`IENDB`abi-tracker-1.11/modules/Internals/Input.pm000066400000000000000000000016731315145562600207030ustar00rootroot00000000000000################################################################## # A module to handle input data # # Copyright (C) 2017 Andrey Ponomarenko's ABI Laboratory # # Written by Andrey Ponomarenko # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License or the GNU Lesser # General Public License as published by the Free Software Foundation. # # 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 # and the GNU Lesser General Public License along with this program. # If not, see . ################################################################## package In; # Input options our %Opt; return 1; abi-tracker-1.11/modules/Internals/Js/000077500000000000000000000000001315145562600176135ustar00rootroot00000000000000abi-tracker-1.11/modules/Internals/Js/Index.js000066400000000000000000000022421315145562600212200ustar00rootroot00000000000000function show_item(item) { item.style.display = ''; item.style.visibility = 'visible'; } function hide_item(item) { item.style.display = 'none'; item.style.visibility = 'hidden'; } function applyFilter(filter, table_id, header_id, note_id) { var table = document.getElementById(table_id); var header = document.getElementById(header_id); var note = document.getElementById(note_id); var pattern = filter.value.toLowerCase(); var count = 0; for (var i = 0; row = table.rows[i]; i++) { if(row.id==header_id) continue; var show = 0; if(pattern=='') { show = 1; } else { var text = row.cells[0].innerHTML.toLowerCase(); if(text.indexOf(pattern)!=-1) { show = 1; } } if(show) { show_item(row); count += 1; } else { hide_item(row); } } if(count==0) { hide_item(header); show_item(note); } else { show_item(header); hide_item(note); } } abi-tracker-1.11/modules/Internals/Styles/000077500000000000000000000000001315145562600205225ustar00rootroot00000000000000abi-tracker-1.11/modules/Internals/Styles/Changelog.css000066400000000000000000000005621315145562600231260ustar00rootroot00000000000000div.changelog { cursor:text; font-family:Monaco, Consolas, 'DejaVu Sans Mono', 'Droid Sans Mono', Monospace; font-size:14px; padding:1em; border:1px solid #777777; color:#222222; background-color:#eff3f2; word-wrap:break-word; max-width:640px; display: inline-block; text-align:left; } pre.wrap { white-space:pre-wrap; } abi-tracker-1.11/modules/Internals/Styles/Common.css000066400000000000000000000011261315145562600224640ustar00rootroot00000000000000body { padding-left:15px; padding:5px; background-color:White; color:Black; } h1 { font-size:1.7em; margin:0px; padding:0px; } hr { color:Black; background-color:Black; height:1px; border:0; } .tool { font-size:1.55em; } a.tool { text-decoration:none; color:Black; } div.sponsor, div.become_sponsor { padding-left:80px; font-size:1.7em; font-weight:bold; color:#ACACAC; } div.sponsor { font-size:1.7em; } img.sponsor { height:50px; padding-left:5px; } .rss { height:1.2em; vertical-align:bottom; } abi-tracker-1.11/modules/Internals/Styles/HeadersDiff.css000066400000000000000000000021771315145562600234070ustar00rootroot00000000000000.diff_tbl tr { } .diff_tbl td { white-space: pre; font-family: "DejaVu Sans Mono", "Droid Sans Mono", Monaco, Monospace; vertical-align: top; font-size: 14px; } .diff_tbl th { font-size: 16px; } .small { font-size: 0.6em; font-style: italic; font-family: Verdana, Helvetica, sans-serif; } .left { background-color: #EEE; } .right { background-color: #FFF; } .diff { background-color: #CCF; } .lblock { background-color: #BFB; } .rblock { background-color: #FF8; } .insert { background-color: #8FF; } .delete { background-color: #ACF; } .void { background-color: #FFB; } .cont { background-color: #EEE; } .linebr { background-color: #AAA; } .lineno { color: red; background-color: #FFF; font-size: 0.7em; text-align: right; padding: 0 2px; } .elipsis{ background-color: #AAA; } .left .cont { background-color: #DDD; } .right .cont { background-color: #EEE; } .lblock .cont { background-color: #9D9; } .rblock .cont { background-color: #DD6; } .insert .cont { background-color: #0DD; } .delete .cont { background-color: #8AD; } .stats, .stats td, .stats th { background-color: #EEE; padding: 2px 0; } abi-tracker-1.11/modules/Internals/Styles/Report.css000066400000000000000000000030351315145562600225100ustar00rootroot00000000000000table.summary { font-family:"DejaVu Sans Mono", "Monaco", monospace; font-size:0.94em; border-collapse:collapse; table-layout:fixed; } table.summary tr, table.summary td, table.summary th { border:1px solid #777777; border-collapse:collapse; padding:0.2em; padding-left:7px; padding-right:7px; text-align:center; } table.summary th { background:#f2f2f2; white-space:nowrap; } table.summary td { padding-top:20px; padding-bottom:20px; white-space:nowrap; } a.home { font-size:1.2em; text-decoration:none; } a.num { color:#000000; text-decoration:none; } a.num:hover { text-decoration:underline; } a.info { text-decoration:none; } .note { font-size:0.82em; } .ok { background-color:#CCFFCC; } .warning { background-color:#F4F4AF; } .almost_compatible { background-color:#FFDAA3; } .incompatible, .removed { background-color:#FFCCCC; } .added { background-color:#C6DEFF; } table.summary td.object { text-align:left; max-width:24em; white-space:normal; word-wrap:break-word; } table.list td { max-width:6.65em; min-width:6em; white-space:normal; word-wrap:break-word; } table.summary td.comment { text-align:center; max-width:50px; white-space:normal; word-wrap:break-word; } table.summary td.sover { max-width:10em; white-space:normal; word-wrap:break-word; } table.summary th.bc { min-width:3em; } table.summary th.sc { min-width:3em; } .highlight tr:hover { background-color:#E0E0E0; } abi-tracker-1.11/modules/Internals/Utils.pm000066400000000000000000000053011315145562600206740ustar00rootroot00000000000000################################################################## # A module with basic functions # # Copyright (C) 2017 Andrey Ponomarenko's ABI Laboratory # # Written by Andrey Ponomarenko # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License or the GNU Lesser # General Public License as published by the Free Software Foundation. # # 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 # and the GNU Lesser General Public License along with this program. # If not, see . ################################################################## use strict; sub composeHTML_Head(@) { my $Page = shift(@_); my $Title = shift(@_); my $Keywords = shift(@_); my $Description = shift(@_); my $Styles = shift(@_); my $Scripts = undef; if(@_) { $Scripts = shift(@_); } my $TopDir = getTop($Page); my $CommonStyles = "common.css"; if($Styles) { $CommonStyles = ""; $Styles = ""; } if($Scripts) { $Scripts = ""; } if($In::Opt{"GenRss"} and $Page eq "timeline") { $Styles .= "\n "; } return " $CommonStyles $Styles $Scripts $Title \n"; } sub getTop($) { my $Page = $_[0]; my $Rel = ""; if($Page=~/\A(changelog|objects_view)\Z/) { $Rel = "../../.."; } elsif($Page=~/\A(objects_report|headers_diff)\Z/) { $Rel = "../../../.."; } elsif($Page=~/\A(timeline)\Z/) { $Rel = "../.."; } elsif($Page=~/\A(global_index)\Z/) { $Rel = "."; } return $Rel; } return 1; abi-tracker-1.11/modules/ignore.tags000066400000000000000000000017231315145562600174460ustar00rootroot00000000000000G_GNUC_EXTENSION G_GNUC_CONST G_GNUC_PURE G_GNUC_MALLOC G_GNUC_DEPRECATED G_GNUC_BEGIN_IGNORE_DEPRECATIONS G_GNUC_END_IGNORE_DEPRECATIONS G_GNUC_NORETURN G_GNUC_UNUSED G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT G_GNUC_FUNCTION G_GNUC_PRETTY_FUNCTION G_GNUC_NO_INSTRUMENT G_HAVE_GNUC_VISIBILITY G_GNUC_INTERNAL G_GNUC_MAY_ALIAS G_DEPRECATED GST_EXPORT=extern OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OPUS_ARG_NONNULL _GNUTLS_GCC_ATTR_DEPRECATED OSCAP_DEPRECATED __THROW __wur __nonnull EINA_CONST EINA_DEPRECATED EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL EINA_MALLOC BSON_GNUC_WARN_UNUSED_RESULT BSON_GNUC_DEPRECATED_FOR BSON_GNUC_CONST BSON_GNUC_DEPRECATED SFTP_DEPRECATED MagickExport WandExport MagickPPExport _NOEXCEPT _LIBCPP_FUNC_VIS NCURSES_EXPORT_VAR NCURSES_EXPORT FT_EXPORT=extern GIT_EXTERN=extern PR_EXTERN=extern AP_DECLARE=extern AP_DECLARE_NONSTD=extern AP_DECLARE_HOOK=extern AP_CORE_DECLARE=extern AP_CORE_DECLARE_NONSTD=extern GIT_INLINE=extern RSVG_VAR=extern