From 6a5d5e40b8a64444040d76b8d6fdf03ad8baf0ac80105615f5d074e0af2b606c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 16 Aug 2023 16:39:14 +0200 Subject: [PATCH] Sync from SUSE:ALP:Source:Standard:1.0 build-compare revision 65b78e8c1ef1fe9e73e3e30088f5d627 --- .gitattributes | 23 + COPYING | 339 +++++++++++ _service | 12 + build-compare.changes | 1087 ++++++++++++++++++++++++++++++++++ build-compare.spec | 69 +++ functions.sh | 460 +++++++++++++++ pkg-diff.sh | 1293 +++++++++++++++++++++++++++++++++++++++++ same-build-result.sh | 244 ++++++++ srpm-check.sh | 94 +++ 9 files changed, 3621 insertions(+) create mode 100644 .gitattributes create mode 100644 COPYING create mode 100644 _service create mode 100644 build-compare.changes create mode 100644 build-compare.spec create mode 100644 functions.sh create mode 100644 pkg-diff.sh create mode 100644 same-build-result.sh create mode 100644 srpm-check.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..88de850 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + 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. diff --git a/_service b/_service new file mode 100644 index 0000000..abd0f4f --- /dev/null +++ b/_service @@ -0,0 +1,12 @@ + + + %ci.%h + https://github.com/openSUSE/build-compare.git + git + + + *.tar + */build-compare.* */*.sh */COPYING + + + diff --git a/build-compare.changes b/build-compare.changes new file mode 100644 index 0000000..077306c --- /dev/null +++ b/build-compare.changes @@ -0,0 +1,1087 @@ +------------------------------------------------------------------- +Sat Jun 17 17:17:17 UTC 2023 - olaf@aepfle.de + +- Filter dune language version in dune-package files + +------------------------------------------------------------------- +Wed May 3 17:32:18 UTC 2023 - Oleg Girko + +- Fix filtering compiled Python modules to handle Python >= 3.7 + +------------------------------------------------------------------- +Fri Apr 28 21:21:21 UTC 2023 - olaf@aepfle.de + +- remove timestamps from png files + +------------------------------------------------------------------- +Sat Apr 8 23:58:34 UTC 2023 - Oleg Girko + +- Ignore more sections when comparing ELF executable files + +------------------------------------------------------------------- +Fri Nov 25 23:51:35 UTC 2022 - Stefan Brüns + +- Trim "PROVIDES" from source rpms (#59, bsc#1205998) + +------------------------------------------------------------------- +Mon Sep 19 08:02:40 UTC 2022 - Dirk Müller + +- move license to licensedir +- spec file cleanups + +------------------------------------------------------------------- +Fri Sep 2 07:15:18 UTC 2022 - Martin Kampas + +- fix compatibility with older sed (#55) + +------------------------------------------------------------------- +Tue Aug 23 06:53:29 UTC 2022 - Martin Kampas + +- handle more setuid/setgid ELF variants (#54) + +------------------------------------------------------------------- +Mon Jun 20 12:34:56 UTC 2022 - olaf@aepfle.de + +- fix objdump parsing for non-executable sections (#53) + +------------------------------------------------------------------- +Mon Jun 13 13:13:13 UTC 2022 - olaf@aepfle.de + +- fix objdump parsing (#52) + +------------------------------------------------------------------- +Fri Mar 4 12:34:56 UTC 2022 - olaf@aepfle.de + +- handle -a also in same-build-result.sh +- Find rpmlint.log in more places +- fix logic error in appstream comparison +- rework exit handling in same-build-result.sh +- Fix result in case no rpmlint.log exist +- remove count of checks and packages from rpmlint.log +- remove Check time report from rpmlint.log +- ELF diffing performance improvements +- unpack packages in parallel +- Add zstd handling + +------------------------------------------------------------------- +Wed Feb 23 08:13:27 UTC 2022 - Stefan Seyfried + +- Add extra handling for KMP versions + +------------------------------------------------------------------- +Tue Sep 21 19:19:19 UTC 2021 - Stephan Kulow + +- Fix build-compare for shadow package + +------------------------------------------------------------------- +Mon Sep 20 08:25:27 UTC 2021 - Andreas Schwab + +- Properly drop another duration from rpmlint.log + +------------------------------------------------------------------- +Mon Sep 6 07:15:06 UTC 2021 - bwiedemann@suse.de + +- Drop another duration from rpmlint.log + +------------------------------------------------------------------- +Wed Aug 11 20:30:40 UTC 2021 - olaf@aepfle.de + +- Handle another Date: variant in DocBook generated man pages + +------------------------------------------------------------------- +Mon Jul 27 06:06:06 UTC 2020 - bwiedemann@suse.de + +- Make output more diffable and readable +- Fix regression in compare_archive +- Fix unit tests + +------------------------------------------------------------------- +Fri May 29 19:20:21 UTC 2020 - olaf@aepfle.de + +- Remove usage of readarray to remain compatible with bash3 + +------------------------------------------------------------------- +Fri May 29 07:30:51 UTC 2020 - olaf@aepfle.de + +- Colltect a list of known rpm tags and use it to build the + queryformat string for the tags listed below (bsc#1172232) + conflict obsolete oldsuggests provide recommend require suggest supplement + +------------------------------------------------------------------- +Thu May 14 07:07:07 UTC 2020 - olaf@aepfle.de + +- Trim first line of man page to catch overly verbose tools (now Pandoc) + +------------------------------------------------------------------- +Wed May 13 13:13:13 UTC 2020 - olaf@aepfle.de + +- compare also posttrans scripts, and pretrans + verifyscript + +------------------------------------------------------------------- +Tue May 5 05:05:05 UTC 2020 - olaf@aepfle.de + +- handle oddly named ZIP archives +- touch watchdog every 15 instead of 57 minutes + +------------------------------------------------------------------- +Tue Mar 31 09:09:09 UTC 2020 - olaf@aepfle.de + +- gtk-doc: filter version info from html files + +------------------------------------------------------------------- +Fri Jan 10 19:16:29 UTC 2020 - olaf@aepfle.de + +- compare archives in separate directory to preserve existing files +- consider only files and symlinks in verify_before_processing + +------------------------------------------------------------------- +Tue Jan 7 13:59:43 UTC 2020 - olaf@aepfle.de + +- this new decade must be handled in man pages created by docbook.xml +- use bash Process Substitution in diff_two_files +- use bash Process Substitution when processing ELF files +- move normalizing code from check_single_file into separate function +- better input verification in check_single_file +- split verification from diff_two_files into separate function +- move check for ignored files out of check_single_file +- separate helper functions from code in pkg-diff +- touch host watchdog when producing output and in loops (issue#35) +- add functions to touch host watchdog +- always run cleanup in check_compressed_file +- use EXIT handler in pkg-diff to remove tmpfiles + +------------------------------------------------------------------- +Wed Aug 14 13:27:38 UTC 2019 - John Vandenberg + +- pkg-diff.sh: Ignore R build timestamp & temp paths + https://github.com/openSUSE/build-compare/pull/34 + +------------------------------------------------------------------- +Tue Feb 19 09:30:20 UTC 2019 - olaf@aepfle.de + +- javadoc: filter dc.created +- Support filenames with spaces +- jar: always list files without date+size +- Fix differing jars reported as identical + +------------------------------------------------------------------- +Tue Aug 28 20:14:53 UTC 2018 - ol@infoserver.lv + +- Ignore value of Release header when comparing spec files + +------------------------------------------------------------------- +Fri Jul 6 14:01:17 UTC 2018 - olaf@aepfle.de + +- pkg-diff: fix diff returning 0 + +------------------------------------------------------------------- +Wed Jul 4 05:58:13 UTC 2018 - olaf@aepfle.de + +- Match also ELF pie executable (bsc#1097339) + +------------------------------------------------------------------- +Wed Jul 4 05:42:05 UTC 2018 - olaf@aepfle.de + +- Remove trailing space from two match patterns + +------------------------------------------------------------------- +Tue Jun 26 06:45:38 UTC 2018 - olaf@aepfle.de + +- Recognize "setuid ELF nn-bit xSB shared object" ELF binaries + +------------------------------------------------------------------- +Mon May 28 13:26:44 UTC 2018 - olaf@aepfle.de + +- Avoid large temporary files from hexdump output and avoid + diff(1) runing OOM by using a fifo (issue#24) + +------------------------------------------------------------------- +Fri Apr 13 07:10:30 UTC 2018 - olaf@aepfle.de + +- check rpm capabilities for recommends/suggests + +------------------------------------------------------------------- +Fri Dec 8 16:57:00 UTC 2017 - ol@infoserver.lv + +- Ignore /usr/lib/.build-id differences in package filelist + +------------------------------------------------------------------- +Mon Dec 4 10:21:44 UTC 2017 - olaf@aepfle.de + +- Treat .egg files as zip + +------------------------------------------------------------------- +Wed Nov 8 06:04:42 UTC 2017 - olaf@aepfle.de + +- srpm check requires cpio + +------------------------------------------------------------------- +Mon Nov 6 15:15:04 UTC 2017 - olaf@aepfle.de + +- Fix usage of cmp_spec and unrpm in srpm-check.sh + +------------------------------------------------------------------- +Fri Nov 3 14:03:04 UTC 2017 - olaf@aepfle.de + +- Catch empty rpm -qp --qf output for tags not understood by rpm + +------------------------------------------------------------------- +Fri Oct 20 06:53:18 UTC 2017 - olaf@aepfle.de + +- Remove newly introduced files-duplicate check from rpmlint + In case files are hardlinked, the source and destination is + scrambled in rpm output: the pkg will be republished. + In case files are not hardlinked, the source and destination + is scrambled in rpmlint output: the pkg will be republished + +------------------------------------------------------------------- +Thu Jul 27 12:05:25 UTC 2017 - olaf@aepfle.de + +- Compare also supplements and recomments (issue#18) + +------------------------------------------------------------------- +Fri Mar 31 13:44:11 UTC 2017 - olaf@aepfle.de + +- Handle timestamp and checksum in xen.efi + +------------------------------------------------------------------- +Wed Mar 22 19:05:36 UTC 2017 - olaf@aepfle.de + +- Handle _kf5_htmldir, it HAD to be different... + +------------------------------------------------------------------- +Tue Mar 21 11:17:26 UTC 2017 - olaf@aepfle.de + +- Handle /usr/share/vdr/locale/ + +------------------------------------------------------------------- +Sun Feb 12 08:41:01 UTC 2017 - olaf@aepfle.de + +- Remove warning file-contains-date-and-time from rpmlint.log + +------------------------------------------------------------------- +Thu Jan 5 11:01:53 UTC 2017 - olaf@aepfle.de + +- Fix name-version-release regex for release without dots + +------------------------------------------------------------------- +Wed Dec 14 08:44:11 UTC 2016 - olaf@aepfle.de + +- Remove warning about python mtime mismatch, a republish will not help (bsc#915948) +- Handle yet another variant of numbered anchor in html file + +------------------------------------------------------------------- +Wed Nov 9 06:48:22 UTC 2016 - olaf@aepfle.de + +- Ignore /etc/ld.so.cache +- Ignore /etc/machine-id + +------------------------------------------------------------------- +Tue Nov 8 08:06:30 UTC 2016 - olaf@aepfle.de + +- Ignore /etc/hosts +- Handle every path matching /share/man/ as man page + +------------------------------------------------------------------- +Mon Nov 7 03:54:00 UTC 2016 - ol@infoserver.lv + +- Ignore .gnu_debugdata section when comparing ELF files. + +------------------------------------------------------------------- +Wed Oct 12 16:40:24 CEST 2016 - ro@suse.de + +- pkg-diff.sh: use option --speed-large-files for diffing + disassembler output (bsc#1003528) + +------------------------------------------------------------------- +Wed Sep 21 07:18:37 UTC 2016 - olaf@aepfle.de + +- Handle broken symlinks + +------------------------------------------------------------------- +Thu Aug 25 14:27:34 UTC 2016 - olaf@aepfle.de + +- Update strip_numbered_anchors to catch more random identifiers + +------------------------------------------------------------------- +Wed Aug 24 13:22:12 UTC 2016 - liezhi.yang@windriver.com + +- functions.sh: improve deb and ipk checking +- Add support for deb and ipk packaging +- pkg-diff.sh: check for fifo (named fifo) +- pkg-diff.sh: remove space in the end for ftype +- pkg-diff.sh: check_single_file(): return at once when same +- functions.sh: run rpm once to make it faster + +------------------------------------------------------------------- +Fri Aug 5 13:44:51 UTC 2016 - olaf@aepfle.de + +- Handle unknown ELF files as different. + +------------------------------------------------------------------- +Wed Apr 6 07:06:58 UTC 2016 - olaf@aepfle.de + +- add used utilities to Requires + +------------------------------------------------------------------- +Tue Mar 8 18:00:40 UTC 2016 - olaf@aepfle.de + +- Remove hacks from /var/adm/update-scripts|messages case + +------------------------------------------------------------------- +Tue Mar 8 16:48:48 UTC 2016 - olaf@aepfle.de + +- Handle /var/adm/update-messages in scripts and filelist + +------------------------------------------------------------------- +Mon Mar 7 11:56:28 UTC 2016 - olaf@aepfle.de + +- Whitespace in javadoc case +- Whitespace changes in html case +- Move case kde/gtk html up in the case list +- Move case rdoc html up in the case list +- Add option -a to same-build-result.sh and loop through all rpms +- Rework sorting of rpm files in same-build-result.sh +- Better diagnostic if number of subpackages changes +- Create tmpfiles earlier in same-build-result.sh +- Handle all javadoc html files + +------------------------------------------------------------------- +Fri Mar 4 18:50:32 UTC 2016 - olaf@aepfle.de + +- Handle yet another variant of elc timestamps + +------------------------------------------------------------------- +Thu Mar 3 12:44:04 UTC 2016 - olaf@aepfle.de + +- Handle timestamp in dvi files +- Handle Last-modified HTML META tag +- Handle yet another variant of javadoc timestamps + +------------------------------------------------------------------- +Fri Jan 1 10:11:14 UTC 2016 - schwab@suse.de + +- Fix quoting in find expression + +------------------------------------------------------------------- +Thu Oct 22 06:29:44 UTC 2015 - olaf@aepfle.de + +- Remove filename-too-long-for-joliet from rpmlint.log + +------------------------------------------------------------------- +Mon Oct 12 13:59:31 UTC 2015 - olaf@aepfle.de + +- Filter out durations from rpmlint progress report + +------------------------------------------------------------------- +Fri Oct 2 09:00:52 UTC 2015 - olaf@aepfle.de + +- Handle texi2html 5.0 timestamps + +------------------------------------------------------------------- +Fri Aug 21 12:57:57 UTC 2015 - seife+obs@b1-systems.com + +- avoid -kmp packages with "filename-too-long-for-joliet" + triggering constant republishing + +------------------------------------------------------------------- +Wed Jul 15 09:50:58 UTC 2015 - olaf@aepfle.de + +- 2015.07.15 +- Handle more texi2html generated files and patterns + +------------------------------------------------------------------- +Wed Jun 17 14:25:06 UTC 2015 - olaf@aepfle.de + +- 2015.06.17 +- Fix regex to handle /lib/(modules|firmware)/version-release-any properly + +------------------------------------------------------------------- +Tue Apr 28 11:52:12 UTC 2015 - olaf@aepfle.de + +- 2015.04.28 +- Filter InitrdID in /linuxrc.config +- Hexdump old and new file in parallel +- Sort cpio file list with files to compare +- Extract old and new files in parallel +- Ignore block device nodes +- Ignore character device nodes +- Always clean tmpdir on exit in pkg-diff.sh +- Handle squashfs files + +------------------------------------------------------------------- +Mon Apr 13 08:55:39 UTC 2015 - olaf@aepfle.de + +- 2015.04.13 +- Show hint if pkg-diff.sh returns non-zero +- Adjust intending in same-build-result.sh +- Handle /usr/src/packages/OTHER +- Handle "setuid directory" + +------------------------------------------------------------------- +Fri Mar 20 18:58:22 UTC 2015 - olaf@aepfle.de + +- 2015.03.20 +- Convert correct png file before comparison +- Avoid name clashes when comparing png files +- Handle filename changes gracefully when comparing unknown filetypes +- Use generic helper to compare png files + +------------------------------------------------------------------- +Thu Feb 12 10:41:45 UTC 2015 - olaf@aepfle.de + +- Handle also .o files as ELF relocatable objects + +------------------------------------------------------------------- +Thu Feb 12 08:22:09 UTC 2015 - randy.e.witt@linux.intel.com + +- Rename rpm-check.sh to pkg-diff.sh + +------------------------------------------------------------------- +Tue Feb 10 15:35:25 UTC 2015 - olaf@aepfle.de + +- 2015.02.10 +- Trim objdump output properly +- Trim .TH also in localized man pages (bnc#915941) +- Remove also DVIPSSource from .ps files + +------------------------------------------------------------------- +Tue Feb 10 15:33:32 UTC 2015 - randy.e.witt@linux.intel.com + +- Print section differences even if assembly has differences. +- Add support for nested rpms. +- Make rpm-check work for "packages" other than rpm. +- Tell which section was different when doing ELF comparisons. +- Error when one of the rpms is not found + +------------------------------------------------------------------- +Fri Feb 6 10:35:56 UTC 2015 - olaf@aepfle.de + +- 2015.02.06 +- Remove more javadoc references (bnc#916161) +- Handle *.war files like *.jar files +- Trim name-version-release string in update-scripts + +------------------------------------------------------------------- +Wed Feb 4 15:53:05 UTC 2015 - olaf@aepfle.de + +- 2015.02.04 +- Handle ruby gem files, they are tar archives (bnc#916047) +- Remove Creator: and CreationDate: tags from .ps files (bnc#915952) +- Correct regex for hostname in libtool (bnc#916268) + +------------------------------------------------------------------- +Tue Feb 3 11:34:39 UTC 2015 - olaf@aepfle.de + +- 2015.02.03 +- Trim .TH also in perl man pages (bnc#915941) +- Trim first line of man page to catch overly verbose tools +- Use correct offset for patching mtime out of .pyc files +- Add BuildIgnore to allow bootstrap in sle11 + +------------------------------------------------------------------- +Mon Feb 2 10:05:40 UTC 2015 - olaf@aepfle.de + +- 2015.02.02 +- Trim VERSION-RELEASE also in rpmlint log +- Adjust regex for spec comparing in src.rpm +- handle also stick and setuid directory from file(1) output + +------------------------------------------------------------------- +Wed Jan 21 08:34:32 UTC 2015 - olaf@aepfle.de + +- 2015.01.21 +- Remove leading spaces from file(1) output +- Force removal of tmpdir to handle files marked as read-only + +------------------------------------------------------------------- +Fri Jan 9 09:37:34 UTC 2015 - olaf@aepfle.de + +- 2015.01.14 +- Trim VERSION-RELEASE instead of RELEASE because the release number + will match other substrings. +- Use regex instead in sed /regex/ to match dots properly +- Handle plain cpio archives from gfxboot +- Add patterns for .TH header in man pages to handle all cases + +------------------------------------------------------------------- +Wed Nov 26 08:58:45 UTC 2014 - ohering@suse.de + +- 2014.11.25 +- correctly handle cmp_spec return code if file checksum differs +- handle also bz2 and xz compressed files with odd name + +------------------------------------------------------------------- +Tue Nov 18 11:58:51 UTC 2014 - ohering@suse.de + +- 2014.11.15 +- show sorted differences of rpmlint log (bnc#904092) +- handle kernel and kmp packages, but support for kernel* is disabled +- minor style fixes +- handle cpio archives +- handle absolute symlinks correctly +- handle all ELF sections, not only the ones starting with dot + +------------------------------------------------------------------- +Wed Nov 12 09:29:24 UTC 2014 - schwab@suse.de + +- Use $(...) instead of `...` to avoid losing backslash quoting + +------------------------------------------------------------------- +Fri Nov 7 11:12:10 UTC 2014 - ohering@suse.de + +- Update check-all option to really keep going and check all files +- Add check to recursively look into gzip files with odd suffix + to properly handle /usr/share/vlc/skins2/default.vlt + +------------------------------------------------------------------- +Sat Aug 2 19:37:18 UTC 2014 - johannesobermayr@gmx.de + +- Fix quoting . + +------------------------------------------------------------------- +Tue Jul 29 15:07:04 UTC 2014 - johannesobermayr@gmx.de + +- Remove numbered anchors from all Docbook / HTML files (bnc#889629). + +------------------------------------------------------------------- +Tue Jul 22 06:45:25 UTC 2014 - meissner@suse.com + +- if all ELF sections except build-id and .gnu_debuglink compare equal, + this is the same binary. + +------------------------------------------------------------------- +Thu Jul 17 06:46:47 UTC 2014 - meissner@suse.com + +- Allow file list changes where the release number is encoded + in the filename. +- compare post-update message and scripts (fixes fetchmsttfonts + constant republish) as they have the release number hardcoded. + +------------------------------------------------------------------- +Tue Jul 15 11:42:09 CEST 2014 - ohering@suse.de + +- Fix shell syntax error in rpm-check.sh +- 2014.07.15 + +------------------------------------------------------------------- +Mon Jul 7 08:28:45 UTC 2014 - aj@suse.com + +- Fix last patch to not use non-existant file (bnc#877078). + +------------------------------------------------------------------- +Fri May 9 18:30:26 UTC 2014 - johannesobermayr@gmx.de + +- Don't compare .note.gnu.build-id and .gnu_debuglink sections in ELF + binaries (bnc#877078). +- Don't compare debuginfo packages. + +------------------------------------------------------------------- +Thu Oct 17 12:44:19 UTC 2013 - schwab@suse.de + +- Also look into MSB shared objects + +------------------------------------------------------------------- +Thu May 24 10:17:15 UTC 2012 - aj@suse.de + +- Only handle files, not directories when searching for packages. + Patch by Matthieu Tanguay-Carel . + +------------------------------------------------------------------- +Tue May 8 12:35:21 UTC 2012 - aj@suse.de + +- Further handling of pdf files (bnc#760867), patch by + David Haller . + +------------------------------------------------------------------- +Mon May 7 14:50:43 UTC 2012 - aj@suse.de + +- Further handling of pdf files (bnc#760867). + +------------------------------------------------------------------- +Mon May 7 11:30:28 UTC 2012 - aj@suse.de + +- Handle /ID in pdf files (bnc#760867). + +------------------------------------------------------------------- +Wed Apr 4 18:25:48 UTC 2012 - reddwarf@opensuse.org + +- Handle gtk-doc documentation + +------------------------------------------------------------------- +Thu Mar 8 21:44:36 UTC 2012 - reddwarf@opensuse.org + +- Improve kde index.cache handling + +------------------------------------------------------------------- +Wed Feb 22 11:12:13 UTC 2012 - aj@suse.de + +- Remove release from pre/post scripts. + +------------------------------------------------------------------- +Wed Feb 22 11:07:53 UTC 2012 - coolo@suse.com + +- I changed my mind, appdata.xml is too hard to get right. So + we need to support variable binary names for the appdata + +------------------------------------------------------------------- +Sat Feb 18 18:27:40 UTC 2012 - aj@suse.de + +- Quote dot in release to not have false matches. + +------------------------------------------------------------------- +Thu Feb 16 21:00:31 UTC 2012 - coolo@suse.com + +- fix missing test in shell script + +------------------------------------------------------------------- +Thu Feb 16 13:39:21 UTC 2012 - coolo@suse.com + +- !unchanged if rpmlint.log was new created +- !unchanged if appdata.xml was new or updated + +------------------------------------------------------------------- +Mon Feb 6 11:53:57 UTC 2012 - aj@suse.de + +- Fix off-by-one error in rpmlint processing that hit packages with + just one binary package. + +------------------------------------------------------------------- +Sun Feb 5 12:16:49 UTC 2012 - aj@suse.de + +- Improve rpmlint check. + +------------------------------------------------------------------- +Sun Feb 5 12:11:35 UTC 2012 - aj@suse.de + +- Take care of date format change of unzip. + +------------------------------------------------------------------- +Sun Feb 5 10:43:49 UTC 2012 - aj@suse.de + +- Replace all occurences of release in rpmlint, take care of + temporary files in rpmlint + +------------------------------------------------------------------- +Sun Feb 5 09:23:56 UTC 2012 - aj@suse.de + +- Use separate invocation lines for .TH lines to catch + some better. + +------------------------------------------------------------------- +Thu Jan 26 10:01:55 UTC 2012 - aj@suse.de + +- Remove release from rpmlint.log before comparing. + +------------------------------------------------------------------- +Fri Jan 20 08:49:39 UTC 2012 - aj@suse.de + +- Sort rpmlint.log files first since the order is non-deterministic. + +------------------------------------------------------------------- +Thu Jan 12 12:59:31 UTC 2012 - aj@suse.de + +- Fix syntax in same-build-result.sh. + +------------------------------------------------------------------- +Mon Jan 9 13:15:33 UTC 2012 - aj@suse.de + +- Compare rpmlint.log if it exists. + +------------------------------------------------------------------- +Sat Sep 17 21:08:18 UTC 2011 - jengelh@medozas.de + +- Remove redundant tags/sections from specfile + +------------------------------------------------------------------- +Wed Aug 31 14:11:39 UTC 2011 - coolo@suse.com + +- comparing fileclass was no good idea after all + +------------------------------------------------------------------- +Mon Jul 11 13:58:52 CEST 2011 - dmueller@suse.de + +- also compare fileclass + +------------------------------------------------------------------- +Fri May 20 18:29:57 UTC 2011 - aj@suse.de + +- Remove debug echo output. + +------------------------------------------------------------------- +Tue Apr 19 11:47:57 UTC 2011 - aj@suse.de + +- Handle libreoffice-bootstrap. + +------------------------------------------------------------------- +Tue Mar 15 08:36:26 UTC 2011 - aj@suse.de + +- Use perl -e instead of -E (bnc#679562). + +------------------------------------------------------------------- +Mon Feb 28 14:00:35 UTC 2011 - aj@suse.de + +- Increase version. + +------------------------------------------------------------------- +Mon Feb 28 13:51:29 UTC 2011 - mls@suse.de + +- Check also the first part of the release to e.g. handle rebuild of complete + distribution (bnc#674991). + +------------------------------------------------------------------- +Thu Oct 28 09:49:14 UTC 2010 - aj@suse.de + +- If source file is different, do not compare binaries with check-all. + +------------------------------------------------------------------- +Wed Oct 27 11:59:15 UTC 2010 - aj@suse.de + +- Handle /usr/lib/texmf/doc/man as well + +------------------------------------------------------------------- +Tue Oct 26 19:43:39 UTC 2010 - aj@suse.de + +- Ignore metafont formats. + +------------------------------------------------------------------- +Tue Oct 26 08:37:35 UTC 2010 - aj@suse.de + +- Enable check-all to check for all differences in all packages. + +------------------------------------------------------------------- +Fri Oct 22 18:27:48 UTC 2010 - aj@suse.de + +- Handle new zip date. +- Handle heartbeat man page. + +------------------------------------------------------------------- +Sun Sep 26 10:03:25 UTC 2010 - aj@suse.de + +- Fix man regex. + +------------------------------------------------------------------- +Wed Sep 22 13:24:19 UTC 2010 - coolo@novell.com + +- ignore texlive's fmt files as discussed with werner + +------------------------------------------------------------------- +Mon Sep 20 19:24:10 UTC 2010 - aj@suse.de + +- Handle man pages generated from docbook. +- Handle rubygem documentation. + +------------------------------------------------------------------- +Mon Sep 20 18:45:01 UTC 2010 - aj@suse.de + +- Create common file functions.sh and cleanup code. + +------------------------------------------------------------------- +Mon Sep 20 15:21:55 UTC 2010 - lnussel@suse.de + +- exclude delta rpms + +------------------------------------------------------------------- +Mon Sep 20 07:58:59 UTC 2010 - aj@suse.de + +- Create script for just checking source rpms. + + +------------------------------------------------------------------- +Thu Sep 9 20:02:33 UTC 2010 - aj@suse.de + +- Handle another date format for man pages found in coreutils. +- Handle more html files, e.g. kdelibs4 and libvdpau. + +------------------------------------------------------------------- +Thu Sep 9 07:58:35 UTC 2010 - aj@suse.de + +- Handle weekday in man page. + +------------------------------------------------------------------- +Tue Aug 31 11:57:26 UTC 2010 - aj@suse.de + +- Refine texi2html rule (found in zsh) + +------------------------------------------------------------------- +Fri Aug 27 08:59:22 UTC 2010 - aj@suse.de + +- Handle png files with timestamp if convert is installed. + +------------------------------------------------------------------- +Fri Aug 27 06:50:13 UTC 2010 - aj@suse.de + +- Handle one more doxygen variation. + +------------------------------------------------------------------- +Sun May 23 12:19:56 UTC 2010 - aj@suse.de + +- Release is at end of line, avoid wrong matches. + +------------------------------------------------------------------- +Fri May 21 21:46:47 UTC 2010 - cmorve69@yahoo.es + +- Improved ELF executable detection (bnc#604049). + +------------------------------------------------------------------- +Thu May 20 08:23:52 UTC 2010 - aj@suse.de + +- Don't skip cross-x86_64-gcc-icecream-backend binary rpms: tighten + the checks for -32bit packages. + +------------------------------------------------------------------- +Sun May 16 12:55:43 UTC 2010 - aj@suse.de + +- Further man pages tweek. + +------------------------------------------------------------------- +Sun May 16 11:28:14 UTC 2010 - aj@suse.de + +- further kde meinproc tuning. + +------------------------------------------------------------------- +Thu May 13 07:25:46 UTC 2010 - aj@suse.de + +- Further fixes for kde meinproc (bnc#604049). + +------------------------------------------------------------------- +Wed May 12 13:54:59 UTC 2010 - aj@suse.de + +- Fix doxygen docu handling. + +------------------------------------------------------------------- +Wed May 12 12:33:02 UTC 2010 - aj@suse.de + +- Handle one more GNU Classpath version. +- Further improve man page regexp. + +------------------------------------------------------------------- +Tue May 11 20:12:59 UTC 2010 - aj@suse.de + +- Improve man page regexp. + +------------------------------------------------------------------- +Tue May 11 12:51:51 UTC 2010 - aj@suse.de + +- Improve kde index.cache handling as suggested by Cristian Morales + Vega in bnc#604049. + +------------------------------------------------------------------- +Tue May 11 07:12:09 UTC 2010 - aj@suse.de + +- Handle deprecated-list.html generated by javadoc. +- Handle doxygen docu. +- Handle /etc/sendmail.cf as well. +- Improve texi2html regexp to handle qemu. + +------------------------------------------------------------------- +Mon May 10 12:27:16 UTC 2010 - aj@suse.de + +- Handle kde index.cache files (bnc#604049). +- Fix for handling of man pages and javadoc files. + +------------------------------------------------------------------- +Mon May 10 09:13:38 UTC 2010 - aj@suse.de + +- Handle kdelibs4 + +------------------------------------------------------------------- +Sat May 8 19:41:30 UTC 2010 - aj@suse.de + +- Fix typo in last change - thanks Dirk Müller. + +------------------------------------------------------------------- +Fri May 7 13:05:57 UTC 2010 - aj@suse.de + +- Handle sendmail .cf files. + +------------------------------------------------------------------- +Tue Mar 23 13:37:47 UTC 2010 - aj@suse.de + +- Handle mono files. +- Mount /proc if it's not mounted already to work around bug in + build script. + +------------------------------------------------------------------- +Sun Mar 14 09:22:39 UTC 2010 - aj@suse.de + +- Improve last regexp to fix virt-utils. + +------------------------------------------------------------------- +Sat Mar 6 04:01:36 UTC 2010 - aj@suse.de + +- Improve regexp for last change. + +------------------------------------------------------------------- +Fri Mar 5 09:46:01 UTC 2010 - aj@suse.de + +- Handle more man files. + +------------------------------------------------------------------- +Sun Dec 13 12:59:16 UTC 2009 - aj@suse.de + +- Handle libtool writing the hostname + +------------------------------------------------------------------- +Wed Nov 18 06:48:27 UTC 2009 - aj@suse.de + +- Some more gjdoc dates (found in ant-antlr). + +------------------------------------------------------------------- +Thu Oct 22 09:03:46 UTC 2009 - coolo@novell.com + +- take out debugging code + +------------------------------------------------------------------- +Wed Oct 14 07:14:37 UTC 2009 - aj@suse.de + +- Replace external /usr/bin/unrpm by small function to get + rid of dependency of build.rpm. + +------------------------------------------------------------------- +Thu Sep 24 06:47:22 UTC 2009 - aj@suse.de + +- Add comments. + +------------------------------------------------------------------- +Wed Sep 23 15:17:49 UTC 2009 - aj@suse.de + +- Handle noarch subpackage in sort correctly. + +------------------------------------------------------------------- +Tue Aug 25 10:28:17 CEST 2009 - mls@suse.de + +- the COPYRIGHT tag does not exist, map it back to LICENSE to + be backward compatible + +------------------------------------------------------------------- +Mon Aug 17 22:24:50 CEST 2009 - aj@suse.de + +- Handle texi2html output. + +------------------------------------------------------------------- +Thu Aug 6 09:23:17 CEST 2009 - aj@suse.de + +- adjust gjdoc sed to match "August 1" and similar one-digit days. + +------------------------------------------------------------------- +Tue Aug 4 08:05:22 CEST 2009 - aj@suse.de + +- Compare mono files with cmp, just in case (handles rfc). + +------------------------------------------------------------------- +Sun Aug 2 07:15:45 CEST 2009 - aj@suse.de + +- Sort jar filelists before compare. + +------------------------------------------------------------------- +Mon Jul 27 10:36:49 CEST 2009 - aj@suse.de + +- Fail rpm-check if unrpm does not exist (noticed with package + build). + +------------------------------------------------------------------- +Sun Jul 26 21:06:06 CEST 2009 - aj@suse.de + +- Fix problem found with building gettext-tools: tar packages + directories. + +------------------------------------------------------------------- +Thu Jul 23 15:30:30 CEST 2009 - aj@suse.de + +- Update version number. + +------------------------------------------------------------------- +Tue Jul 21 16:41:39 CEST 2009 - aj@suse.de + +- Handle emacs bytecompiled files. +- Handle /usr/share/man/man3/*3pm perl man pages. +- Handle /var/adm/perl-modules/*. +- Handle fonts.dir, fonts.scale and encoding.dir. + +------------------------------------------------------------------- +Tue Jul 21 13:02:36 CEST 2009 - aj@suse.de + +- Add return value for .a case so that it can succeed. + +------------------------------------------------------------------- +Mon Jul 20 15:50:46 CEST 2009 - aj@suse.de + +- Fix typo in same-build-results.sh +- Ignore javadoc build stamp in javadoc html files. +- Use jar,fastjar or unzip to extract jar files. + +------------------------------------------------------------------- +Wed Jul 15 13:31:30 CEST 2009 - coolo@novell.com + +- overwrite duplicated files in zip files + +------------------------------------------------------------------- +Tue Jul 14 11:46:04 CEST 2009 - coolo@novell.com + +- support .jar and .zip files +- fix support of gzipped files + +------------------------------------------------------------------- +Mon May 4 15:19:04 CEST 2009 - coolo@suse.de + +- compare content of *.tar too + +------------------------------------------------------------------- +Mon May 4 14:17:07 CEST 2009 - coolo@suse.de + +- if objdump fails, fall back to hexdump (bnc#489965) + +------------------------------------------------------------------- +Mon May 4 14:10:24 CEST 2009 - coolo@suse.de + +- ignore dates in mo files (bnc#489198) + +------------------------------------------------------------------- +Tue Apr 28 13:47:36 CEST 2009 - mmarek@suse.cz + +- rpm-check.sh: add option --check-all to check all packaged files + (useful for debugging) + +------------------------------------------------------------------- +Sun Feb 8 21:48:27 CET 2009 - coolo@suse.de + +- fix handling of hardlinks to compressed files + +------------------------------------------------------------------- +Sat Feb 7 21:05:30 CET 2009 - coolo@suse.de + +- fix handling of -32bit and -64bit + +------------------------------------------------------------------- +Sat Feb 7 14:58:48 CET 2009 - coolo@suse.de + +- fix command line order + +------------------------------------------------------------------- +Fri Feb 6 19:25:20 CET 2009 - coolo@suse.de + +- use --no-show-raw-insn for objdump -d + +------------------------------------------------------------------- +Fri Feb 6 18:18:15 CET 2009 - coolo@suse.de + +- hopefully fixed shell quoting for rpm command line + +------------------------------------------------------------------- +Thu Feb 5 17:34:29 CET 2009 - coolo@suse.de + +- fix 2 bugs +- don't ignore source rpms - changed sources should output + changed source rpms, no matter if they create the same binaries + (think of changed copyright header in spec files) + +------------------------------------------------------------------- +Tue Jan 27 14:27:19 CET 2009 - adrian@suse.de + +- Create initial package based on the work of Matz and Coolo + This package provides script for the main build script to be able + to check if a new build has the same result than the former one. + The Build Service is able to skip the new build than. +- changes in source rpms are currently ignored, is that okay ? + diff --git a/build-compare.spec b/build-compare.spec new file mode 100644 index 0000000..388cce0 --- /dev/null +++ b/build-compare.spec @@ -0,0 +1,69 @@ +# +# spec file for package build-compare +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: build-compare +Version: 20230617T171717.50241a8 +Release: 0 +Summary: Build Result Compare Script +License: GPL-2.0-or-later +Group: Development/Tools/Building +URL: https://github.com/openSUSE/build-compare +Source1: COPYING +Source2: same-build-result.sh +Source3: pkg-diff.sh +Source4: functions.sh +Source5: srpm-check.sh +BuildRoot: %{_tmppath}/%{name}-%{version}-build +#!BuildIgnore: build-compare +BuildArch: noarch +%if 0%{?suse_version} +Requires: bash +Requires: coreutils +Requires: cpio +Requires: diffutils +Requires: file +Requires: gawk +Requires: grep +Requires: rpm +Requires: sed +%endif + +%description +This package contains scripts to find out if the build result differs +to a former build. + +%prep +%setup -q -c -T +install -p -m 0644 %{SOURCE1} . + +%build + +%install +mkdir -p %{buildroot}%{_prefix}/lib/build/ +install -m 0755 %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{buildroot}%{_prefix}/lib/build/ + +%files +%if 0%{?suse_version} < 1500 +%defattr(-,root,root) +%doc COPYING +%else +%license COPYING +%endif +%{_prefix}/lib/build + +%changelog diff --git a/functions.sh b/functions.sh new file mode 100644 index 0000000..266755e --- /dev/null +++ b/functions.sh @@ -0,0 +1,460 @@ +#! /bin/bash +# +# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany. +# Licensed under GPL v2, see COPYING file for details. +# +# Written by Michael Matz and Stephan Coolo +# Enhanced by Andreas Jaeger + +# library of functions used by scripts + +RPM="rpm -qp --nodigest --nosignature" + +declare -a rpm_querytags +collect_rpm_querytags() { + rpm_querytags=( $(rpm --querytags) ) +} +# returns 0 if tag is known, returns 1 if unknown +rpmtag_known() { + local needle="\<${1}\>" + local haystack="${rpm_querytags[@]}" + [[ "${haystack}" =~ ${needle} ]] + return $? +} + +set_rpm_meta_global_variables() { + + local pkg=$1 + local rpm_tags= + local out=`mktemp` + local t v qt + local -a type variant list + +# Name, Version, Release +QF_NAME="%{NAME}" +QF_VER_REL="%{VERSION}-%{RELEASE}" +QF_NAME_VER_REL="%{NAME}-%{VERSION}-%{RELEASE}" + +QF_PROVIDES= +type=( + CONFLICT + OBSOLETE + OLDSUGGESTS + PROVIDE + RECOMMEND + REQUIRE + SUGGEST + SUPPLEMENT +) +variant=( + NAME + FLAGS + VERSION +) +for t in "${type[@]}" +do + unset list + list=() + for v in "${variant[@]}" + do + qt="${t}${v}" + rpmtag_known "${qt}" || continue + list+=("%{${qt}}") + done + QF_PROVIDES+="${t}\\n[${list[@]}\\n]\\n" +done + +# don't look at RELEASE, it contains our build number +QF_TAGS="%{NAME} %{VERSION} %{EPOCH}\\n" +QF_TAGS="${QF_TAGS}%{SUMMARY}\\n%{DESCRIPTION}\\n" +# the DISTURL tag can be used as checkin ID +QF_TAGS="${QF_TAGS}%{VENDOR} %{DISTRIBUTION} %{DISTURL}\\n" +QF_TAGS="${QF_TAGS}%{LICENSE}\\n" +QF_TAGS="${QF_TAGS}%{GROUP} %{URL} %{EXCLUDEARCH} %{EXCLUDEOS} %{EXCLUSIVEARCH}\\n" +QF_TAGS="${QF_TAGS}%{EXCLUSIVEOS} %{RPMVERSION} %{PLATFORM}\\n" +QF_TAGS="${QF_TAGS}%{PAYLOADFORMAT} %{PAYLOADCOMPRESSOR} %{PAYLOADFLAGS}\\n" + +# XXX We also need to check the existence (but not the content (!)) +# of SIGGPG (and perhaps the other SIG*) +# XXX We don't look at triggers +# Only the first ChangeLog entry; should be enough +QF_TAGS="${QF_TAGS}%{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n" + +# scripts, might contain release number +QF_SCRIPT= +type=( + PRETRANS + PREIN + POSTIN + PREUN + POSTUN + POSTTRANS + VERIFYSCRIPT +) +variant=( + PROG + FLAGS + '' +) +for t in "${type[@]}" +do + unset list + list=() + for v in "${variant[@]}" + do + qt="${t}${v}" + rpmtag_known "${qt}" || continue + list+=("%{${qt}}") + done + QF_SCRIPT+="${t}\\n[${list[@]}\\n]\\n" +done + +# Now the files. We leave out mtime and size. For normal files +# the size will influence the MD5 anyway. For directories the sizes can +# differ, depending on which file system the package was built. To not +# have to filter out directories we simply ignore all sizes. +# Also leave out FILEDEVICES, FILEINODES (depends on the build host), +# FILECOLORS, FILECLASS (normally useful but file output contains mtimes), +# FILEDEPENDSX and FILEDEPENDSN. +# Also FILELANGS (or?) +QF_FILELIST="[%{FILENAMES} %{FILEFLAGS} %{FILESTATES} %{FILEMODES:octal} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILERDEVS} %{FILEVERIFYFLAGS} %{FILELINKTOS}\n]\\n" +# ??? what to do with FILEPROVIDE and FILEREQUIRE? + +QF_CHECKSUM="[%{FILENAMES} %{FILEMD5S} %{FILEFLAGS}\n]\\n" + +QF_SOURCERPM="%{SOURCERPM}\\n" + +QF_ALL="\n___QF_NAME___\n${QF_NAME}\n___QF_NAME___\n" +QF_ALL="$QF_ALL\n___QF_TAGS___\n${QF_TAGS}\n___QF_TAGS___\n" +QF_ALL="$QF_ALL\n___QF_VER_REL___\n${QF_VER_REL}\n___QF_VER_REL___\n" +QF_ALL="$QF_ALL\n___QF_NAME_VER_REL___\n${QF_NAME_VER_REL}\n___QF_NAME_VER_REL___\n" +QF_ALL="$QF_ALL\n___QF_PROVIDES___\n${QF_PROVIDES}\n___QF_PROVIDES___\n" +QF_ALL="$QF_ALL\n___QF_SCRIPT___\n${QF_SCRIPT}\n___QF_SCRIPT___\n" +QF_ALL="$QF_ALL\n___QF_FILELIST___\n${QF_FILELIST}\n___QF_FILELIST___\n" +QF_ALL="$QF_ALL\n___QF_CHECKSUM___\n${QF_CHECKSUM}\n___QF_CHECKSUM___\n" +QF_ALL="$QF_ALL\n___QF_SOURCERPM___\n${QF_SOURCERPM}\n___QF_SOURCERPM___\n" +} + +check_header() +{ + $RPM --qf "$1" "$2" +} + +# Trim version-release string: +# - it is used as direntry below certain paths +# - it is assigned to some variable in scripts, at the end of a line +# - it is used in PROVIDES, at the end of a line +# - special-case KMP package: +# PROVIDES version_k.*-release at end of line, trim release +# [ 23s] -acpi_call-kmp-default 8 1.2.2_k5.17.0_rc5_1.ga9b2c1d-6.110 +# [ 23s] +acpi_call-kmp-default 8 1.2.2_k5.17.0_rc5_1.ga9b2c1d-6.111 +# Trim name-version-release string: +# - it is used in update-scripts which are called by libzypp +# - special-case KMP package: +# [ 64s] PREIN +# [ 64s] /bin/sh (none) /usr/lib/module-init-tools/kernel-scriptlets/kmp-pre --name "acpi_call-kmp-default" \ +# [ 64s] - --version "1.2.2_k5.17.0_rc5_1.ga9b2c1d" --release "6.112" --kernelrelease "5.17.0-rc5-1.ga9b2c1d" \ +# [ 64s] + --version "1.2.2_k5.17.0_rc5_1.ga9b2c1d" --release "6.113" --kernelrelease "5.17.0-rc5-1.ga9b2c1d" \ +function trim_release_old() +{ + local rel_regex_l=${version_release_old_regex_l##*-} + sed -e " + /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_old_regex_l\$\|$version_release_old_regex_l)\)/{s,$version_release_old_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_old_regex_s,@VERSION@-@RELEASE_SHORT@,g} + s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_old_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g + s/\(\/var\/adm\/update-messages\/\)${name_ver_rel_old_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g + s/\(^[^[:blank:]].*-kmp-.*[[:blank:]].*_k.*-\)${rel_regex_l}$/\1@RELEASE_LONG@/g + s/--release \"${rel_regex_l}\" --kernel/--release \"@RELEASE_LONG@\" --kernel/g + /\/usr\/lib\/\.build-id/d + " +} +function trim_release_new() +{ + local rel_regex_l=${version_release_new_regex_l##*-} + sed -e " + /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_new_regex_l\$\|$version_release_new_regex_l)\)/{s,$version_release_new_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_new_regex_s,@VERSION@-@RELEASE_SHORT@,g} + s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_new_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g + s/\(\/var\/adm\/update-messages\/\)${name_ver_rel_new_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g + s/\(^[^[:blank:]].*-kmp-.*[[:blank:]].*_k.*-\)${rel_regex_l}$/\1@RELEASE_LONG@/g + s/--release \"${rel_regex_l}\" --kernel/--release \"@RELEASE_LONG@\" --kernel/g + /\/usr\/lib\/\.build-id/d + " +} +# Get single directory or filename with long or short release string +function grep_release_old() +{ + grep -E "(/boot|/lib/modules|/lib/firmware|/usr/src|/var/adm/update-scripts)/[^/]*(${version_release_old_regex_l}(\$|[^/]+\$)|${version_release_old_regex_s}(\$|[^/]+\$))" +} +function grep_release_new() +{ + grep -E "(/boot|/lib/modules|/lib/firmware|/usr/src|/var/adm/update-scripts)/[^/]*(${version_release_new_regex_l}(\$|[^/]+\$)|${version_release_new_regex_s}(\$|[^/]+\$))" +} + +#usage unpackage $dir +# Unpack files in directory $dir +# like /usr/bin/unpackage - just for one file and with no options +function unpackage() +{ + local file + local dir + file=$1 + dir=$2 + mkdir -p $dir + pushd $dir 1>/dev/null + case $file in + *.bz2) + bzip2 -d $file + ;; + *.gz) + gzip -d $file + ;; + *.xz) + xz -d $file + ;; + *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2) + tar xf $file + ;; + *.rpm) + CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet" + rpm2cpio $file | cpio ${CPIO_OPTS} + ;; + *.ipk|*.deb) + ar x $file + tar xf control.tar.gz + rm control.tar.gz + tar xf data.tar.[xg]z + rm data.tar.[xg]z + ;; + esac + popd 1>/dev/null +} + +# Run diff command on the files +# $1: printed info +# $2: file1 +# $3: file2 +# $4, $5: rpm_meta_old and rpm_meta_new, for cleanup. +function comp_file() +{ + echo "comparing $1" + if ! diff --label old-$1 --label new-$1 -au $2 $3; then + if test -z "$check_all"; then + rm $2 $3 $4 $5 + return 1 + fi + difffound=1 + fi + return 0 +} + +# Get var's value from specfile. +# $1: var name +# $2: specfile +function get_value() +{ + sed -n -e "/^___${1}___/,/^___${1}___/p" $2 | sed -e "/^___${1}___/d" +} + +# Set version_release_old_regex_s, version_release_old_regex_l and +# name_ver_rel_old_regex_l, also the new ones. +function set_regex() { + local rel_old=${version_release_old##*-} + local rel_new=${version_release_new##*-} + + # Short version without B_CNT + # release may not contain a dot + case "${rel_old}" in + *.*) + version_release_old_regex_s=${version_release_old%.*} + ;; + *) + version_release_old_regex_s=${version_release_old} + ;; + esac + # Remember to quote the . which is in release + version_release_old_regex_s=${version_release_old_regex_s//./\\.} + # Long version with B_CNT + version_release_old_regex_l=${version_release_old//./\\.} + name_ver_rel_old_regex_l=${name_ver_rel_old//./\\.} + + case "${rel_new}" in + *.*) + version_release_new_regex_s=${version_release_new%.*} + ;; + *) + version_release_new_regex_s=${version_release_new} + ;; + esac + version_release_new_regex_s=${version_release_new_regex_s//./\\.} + version_release_new_regex_l=${version_release_new//./\\.} + name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.} +} + +# Trim a block starting with a keyword and ending with an empty line +# $1: enable +# $2: keyword +function trim_section() { + if test "${1}" -gt 0 ; then + sed -e "/^${2}$/,/^$/d" + else + cat + fi +} + +# Compare just the rpm meta data of two rpms +# Returns: +# 0 in case of same content +# 1 in case of errors or difference +# 2 in case of differences that need further investigation +# Sets ${files[@]} array with list of files that need further investigation +function cmp_rpm_meta () +{ + local RES + local f + local sh=$1 + local oldrpm=$2 + local newrpm=$3 + local tmpdir="$(mktemp -d)" + local file1="$tmpdir/file1" + local file2="$tmpdir/file2" + local rpm_meta_old="$tmpdir/rpm-meta-old" + local rpm_meta_new="$tmpdir/rpm-meta-new" + + collect_rpm_querytags + set_rpm_meta_global_variables $oldrpm + + check_header "$QF_ALL" $oldrpm > $rpm_meta_old + check_header "$QF_ALL" $newrpm > $rpm_meta_new + + # rpm returns 0 even in case of error + if test -s $rpm_meta_old && test -s $rpm_meta_new ; then + : some output provided, all query tags understood by rpm + else + ls -l $rpm_meta_old $rpm_meta_new + echo "empty 'rpm -qp' output..." + rm -rf "$tmpdir" + return 1 + fi + + name_new="$(get_value QF_NAME $rpm_meta_new)" + version_release_new="$(get_value QF_VER_REL $rpm_meta_new)" + name_ver_rel_new="$(get_value QF_NAME_VER_REL $rpm_meta_new)" + + version_release_old="$(get_value QF_VER_REL $rpm_meta_old)" + name_ver_rel_old="$(get_value QF_NAME_VER_REL $rpm_meta_old)" + + set_regex + + # Check the whole spec file at first, return 0 immediately if they + # are the same. + trim_release_old < $rpm_meta_old > $file1 + trim_release_new < $rpm_meta_new > $file2 + echo "comparing the rpm tags of $name_new" + if diff --speed-large-files --label old-rpm-tags --label new-rpm-tags -au0 $file1 $file2; then + rm -rf "$tmpdir" + return 0 + fi + + get_value QF_TAGS $rpm_meta_old > $file1 + get_value QF_TAGS $rpm_meta_new > $file2 + if ! comp_file rpmtags $file1 $file2 $rpm_meta_old $rpm_meta_new; then + rm -rf "$tmpdir" + return 1 + fi + + # This might happen when?! + echo "comparing RELEASE" + if [ "${version_release_old%.*}" != "${version_release_new%.*}" ] ; then + case $name_new in + kernel-*) + # Make sure all kernel packages have the same %RELEASE + echo "release prefix mismatch" + if test -z "$check_all"; then + rm -rf "$tmpdir" + return 1 + fi + difffound=1 + ;; + # Every other package is allowed to have a different RELEASE + *) ;; + esac + fi + + # Built packages provide the sourcerpm, for the sourcerpm itself it is "(none)" + [ "x$(get_value QF_SOURCERPM $rpm_meta_new)" == "x(none)" ] && is_sourcerpm=1 || is_sourcerpm=0 + + # FIXME: PROVIDE needs to be handled independent from the other tags + get_value QF_PROVIDES $rpm_meta_old | trim_section ${is_sourcerpm} 'PROVIDE' | trim_release_old | sort > $file1 + get_value QF_PROVIDES $rpm_meta_new | trim_section ${is_sourcerpm} 'PROVIDE' | trim_release_new | sort > $file2 + if ! comp_file PROVIDES $file1 $file2 $rpm_meta_old $rpm_meta_new; then + rm -rf "$tmpdir" + return 1 + fi + + get_value QF_SCRIPT $rpm_meta_old | trim_release_old > $file1 + get_value QF_SCRIPT $rpm_meta_new | trim_release_new > $file2 + if ! comp_file scripts $file1 $file2 $rpm_meta_old $rpm_meta_new; then + rm -rf "$tmpdir" + return 1 + fi + + # First check the file attributes and later the md5s + get_value QF_FILELIST $rpm_meta_old | trim_release_old > $file1 + get_value QF_FILELIST $rpm_meta_new | trim_release_new > $file2 + if ! comp_file filelist $file1 $file2 $rpm_meta_old $rpm_meta_new; then + rm -rf "$tmpdir" + return 1 + fi + + # now the md5sums. if they are different, we check more detailed + # if there are different filenames, we will already have aborted before + # file flag 64 means "ghost", filter those out. + get_value QF_CHECKSUM $rpm_meta_old | grep -v " 64$" | trim_release_old > $file1 + get_value QF_CHECKSUM $rpm_meta_new | grep -v " 64$" | trim_release_new > $file2 + RES=2 + # done if the same + files=() + echo "comparing file checksum" + if cmp -s $file1 $file2; then + RES=0 + else + # Get only files with different MD5sums + while read + do + : "${REPLY}" + files+=( "${REPLY}" ) + done < <(diff -U0 $file1 $file2 | sed --regexp-extended -n -e '/^\+\//{s/^\+//;s/ [0-9a-f]+ [0-9]+$//;p}') + fi + + if test -n "$sh"; then + echo "creating rename script" + # Create a temporary helper script to rename files/dirs with release in it + for f in `$RPM --qf '[%{FILENAMES} %{FILEFLAGS}\n]\n' "$oldrpm" | grep_release_old | grep -vw 64$ | awk '{ print $1}'` + do + echo mv -v \"old/${f}\" \"old/`echo ${f} | trim_release_old`\" + done >> "${sh}" + # + for f in `$RPM --qf '[%{FILENAMES} %{FILEFLAGS}\n]\n' "$newrpm" | grep_release_new | grep -vw 64$ | awk '{ print $1}'` + do + echo mv -v \"new/${f}\" \"new/`echo ${f} | trim_release_new`\" + done >> "${sh}" + fi + + rm -rf "$tmpdir" + [ "$difffound" = 1 ] && RES=1 + return $RES +} + +function adjust_controlfile() { + version_release_old="`sed -ne 's/^Version: \(.*\)/\1/p' $1/control`" + name_ver_rel_old="`sed -n -e 's/^Package: \(.*\)/\1/p' $1/control`-`sed -n -e 's/^Version: \(.*\)/\1/p' $1/control`" + version_release_new="`sed -ne 's/^Version: \(.*\)/\1/p' $2/control`" + name_ver_rel_new="`sed -n -e 's/^Package: \(.*\)/\1/p' $2/control`-`sed -n -e 's/^Version: \(.*\)/\1/p' $2/control`" + set_regex + trim_release_old < $1/control > $1/control.fixed + mv $1/control.fixed $1/control + trim_release_new < $2/control > $2/control.fixed + mv $2/control.fixed $2/control +} + + +# vim: tw=666 ts=2 shiftwidth=2 et diff --git a/pkg-diff.sh b/pkg-diff.sh new file mode 100644 index 0000000..a58182b --- /dev/null +++ b/pkg-diff.sh @@ -0,0 +1,1293 @@ +#! /bin/bash +# +# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany. +# Licensed under GPL v2, see COPYING file for details. +# +# Written by Michael Matz and Stephan Coolo +# Enhanced by Andreas Jaeger +declare -i watchdog_host_timeout_seconds='3600' +declare -i watchdog_touch_percent_prior_timeout='25' +declare -i watchdog_next_touch_seconds=0 + +function watchdog_reset +{ + local uptime idle + local -i next_touch now + + read uptime idle < /proc/uptime + + now="${uptime%.*}" + next_touch=$(( ${now} + ( (${watchdog_host_timeout_seconds} * ${watchdog_touch_percent_prior_timeout}) / 100 ) )) + watchdog_next_touch_seconds=${next_touch} +} + +function watchdog_touch +{ + local uptime idle + local -i next_touch now + + read uptime idle < /proc/uptime + + now="${uptime%.*}" + if test "${now}" -lt "${watchdog_next_touch_seconds}" + then + return + fi + echo 'build-compare touching host-watchdog.' + watchdog_reset +} + +function wprint +{ + echo "$@" + watchdog_reset +} + +filter_disasm() +{ + [[ $nofilter ]] && return + sed -e ' + s/^ *[0-9a-f]\+:// + s/\$0x[0-9a-f]\+/$something/ + s/callq *[0-9a-f]\+/callq / + s/# *[0-9a-f]\+/# / + s/\(0x\)\?[0-9a-f]\+(/offset(/ + s/[0-9a-f]\+ :/\1:/ + s/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/ + ' +} + +filter_xenefi() { + # PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows + perl -e "open fh, '+<', '$f'; seek fh, 0x80 + 0x08, SEEK_SET; print fh 'time'; seek fh, 0x80 + 0x58, SEEK_SET; print fh 'chck';" +} + +filter_pyc() { + perl -e ' + my $ts_off = 4; + my $f = shift; + open fh, "+<", $f; + my $data; + die "Unexpected EOF while reading $f" if read(fh, $data, 2) < 2; + my $magic1 = unpack "v", $data; + die "Unexpected EOF while reading $f" if read(fh, $data, 2) < 2; + my $magic2 = unpack "v", $data; + die "File $f is not a compiled Python module" if $magic2 != 0x0a0d; + if ($magic1 >= 3392 && $magic1 < 20000) { + $ts_off += 4; + die "Unexpected EOF while reading $f" if read(fh, $data, 4) < 4; + my $flags = unpack "V", $data; + $ts_off += 8 if $flags & 0x1; + } + seek fh, $ts_off, SEEK_SET; + print fh "0000"; + close fh; + ' "$f" +} + +filter_dvi() { + # Opcodes 247: pre; i[1], num[4], den[4], mag[4], k[1], x[k] + perl -e " + my \$rec; + open fh, '+<', '$f'; + my \$dummy = read fh, \$rec, 15; + (\$pre, \$i, \$num, \$den, \$mag, \$k) = unpack('C2 N3 C', \$rec); + seek fh, 15, SEEK_SET; + while (\$k > 0) { + print fh '0'; + \$k--; + } + " +} + +filter_png() { + perl -e ' + use strict; + use warnings; + my $a, my $b, my $c, my $d, my $f; + open ($f, "+<", shift); + $d = read($f, $c, 8); + ($a,$b) = unpack("N2", $c); + unless($a == 0x89504e47 && $b == 0x0d0a1a0a) { + die("bogus png file."); + } + sub fn { + my ($fd, $l) = @_; + my $d = sprintf("%d", $l + 4); + $d = pack("a$d", ""); + print($fd $d); + } + for ($d = read($f, $c, 8); $d > 0; $d = read($f, $c, 8)) { + ($a,$b) = unpack("N a4", $c); + if ($b eq "tIME") { + fn($f, $a); + } elsif ($b eq "tEXt") { + $d = read($f, $c, $a); + $b = unpack("Z$a", $c); + if ($b eq "date:create" || $b eq "date:modify") { + $d = seek($f, -$a, 1); + fn($f, $a); + } + } else { + $d = seek($f, $a + 4, 1); + } + } + close($f); + ' "$f" +} + +filter_emacs_lisp() { + sed -i -e ' + s|^;;; .ompiled by abuild@.* on ... ... .. ..:..:.. ....|;;; compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009| + s|^;;; from file .*\.el|;;; from file /home/abuild/rpmbuild/BUILD/anthy-9100h/src-util/elc.8411/anthy-azik.el| + s|^;;; emacs version .*|;;; emacs version 21.5 (beta34) "kale" XEmacs Lucid.| + s|^;;; bytecomp version .*|;;; bytecomp version 2.28 XEmacs; 2009-08-09.| + ' "$f" +} + +filter_pdf() { + # PDF files contain a unique ID, remove it + # Format of the ID is: + # /ID [<9ACE247A70CF9BEAFEE15E116259BD6D> <9ACE247A70CF9BEAFEE15E116259BD6D>] + # with optional spaces. pdftex creates also: + # /CreationDate (D:20120103083206Z) + # /ModDate (D:20120103083206Z) + # and possibly XML metadata as well + sed -i \ + '/obj/,/endobj/{ + s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g; + s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g; + s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g; + s%[^<]*%XXX%g; + s%[^<]*%XXX%g; + s%[^<]*%XXX%g; + s%[^<]*%XXX%g; + s%[^<]*%XXX%g; + }' "$f" +} + +filter_ps() { + sed -i -e ' + /^%%CreationDate:[[:blank:]]/d + /^%%Creator:[[:blank:]]groff[[:blank:]]version[[:blank:]]/d + /^%DVIPSSource:[[:blank:]]/d + ' "$f" +} + +filter_mo() { + sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," "$f" +} + +filter_linuxrc_config() { + sed -i '/^InitrdID:/s@^.*@InitrdID: something@' "$f" +} + +# call specified filter on old and new file +filter_generic() +{ + filtertype=$1 + [[ $nofilter ]] && return + local f + for f in "old/$file" "new/$file" ; do + eval "filter_$filtertype $f" + done +} + +# returns 0 if both files are identical +# returns 1 if files differ or one is missing +# returns 2 if files must be processed further +verify_before_processing() +{ + local file="$1" + local cmpout="$2" + + if test ! -e "old/$file"; then + wprint "Missing in old package: $file" + return 1 + fi + if test ! -e "new/$file"; then + wprint "Missing in new package: $file" + return 1 + fi + + # consider only files and symlinks + if test ! -f "old/$file"; then + return 0 + fi + if test ! -f "new/$file"; then + return 0 + fi + + if cmp -b "old/$file" "new/$file" > "${cmpout}" ; then + return 0 + fi + + if test -s "${cmpout}" ; then + # cmp produced output for futher processing + return 2 + fi + + # cmp failed + return 1 +} + +diff_two_files() +{ + local offset length + + verify_before_processing "${file}" "${dfile}" + case "$?" in + 0) return 0 ;; + 1) return 1 ;; + *) ;; + esac + + offset=`sed 's@^.*differ: byte @@;s@,.*@@' < $dfile` + wprint "$file differs at offset '$offset' ($ftype)" + offset=$(( ($offset >> 6) << 6 )) + length=512 + diff -u \ + --label "old $file (hex)" \ + --label "new $file (hex)" \ + <( hexdump -C -s $offset -n $length "old/$file" ) \ + <( hexdump -C -s $offset -n $length "new/$file" ) | $buildcompare_head + return 1 +} + +trim_man_first_line() +{ + # Handles the first line if it is like: + #.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) + #.\" Automatically generated by Pandoc 2.9.2.1 + #.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3. + local f=$1 + [[ $nofilter ]] && return + sed -i -e '1{ + s|^\.\\"[[:blank:]]\+Automatically[[:blank:]]generated[[:blank:]]by[[:blank:]].*|.\\" Automatically generated by SomeTool| + s|^\.\\"[[:blank:]]\+DO[[:blank:]]NOT[[:blank:]]MODIFY[[:blank:]]THIS[[:blank:]]FILE![[:blank:]]\+It[[:blank:]]was[[:blank:]]generated[[:blank:]]by[[:blank:]]help2man[[:blank:]].*|.\\" Overly verbose help2man| + }' $f +} + +trim_man_TH() +{ + # Handles lines like: + # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper" + # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard" + # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3" + # .TH QEMU-IMG 1 "2010-03-14" " " " " + # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1" + # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- + # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- + # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual" + # .TH gv 3guile "13 May 2010" + #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual" + # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation" + # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7" + # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- + # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands" + # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" "" + #.TH Locale::Po4a::Xml.pm 3pm "2015-01-30" "Po4a Tools" "Po4a Tools" + local f=$1 + [[ $nofilter ]] && return + # (.TH quoted section) (quoted_date)(*) + sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f + # (.TH unquoted section) (quoted_date)(*) + sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f + # (.TH quoted section) (unquoted_date)(*) + sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f + # (.TH unquoted section) (unquoted_date)(*) + sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f +} + +strip_numbered_anchors() +{ + # Remove numbered anchors on Docbook / HTML files. + # + # + # + # 1 TeX + # + # + #
+ #
+ + [[ $nofilter ]] && return + for f in old/$file new/$file; do + sed -ie ' + 1 { + : N + $ { + s@\(]\+id=\n\?"\)\(id[a-z0-9]\+\)\("[^>]*>\)@\1a_idN\3@g + s@\(]\+name=\n\?"\)\(id[a-z0-9]\+\)\("[^>]*>\)@\1a_nameN\3@g + s@\(]\+href="#\)\([^"]\+\)\("[^>]*>\)@\1href_anchor\3@g + s@\(]\+href="[^#]\+#\)\([^"]\+\)\("[^>]*>\)@\1href_anchor\3@g + s@\(]\+id="\)\([\.a-z0-9]\+\)\("[^>]*>\)@\1div_idN\3@g + } + N + b N + }' $f & + done + wait +} + + +check_compressed_file() +{ + local file=$1 + local ext=$2 + local tmpdir=`mktemp -d` + local ftype + local ret=0 + wprint "$ext file with odd filename: $file" + if test -n "$tmpdir"; then + mkdir $tmpdir/{old,new} + cp --parents --dereference old/$file $tmpdir/ + cp --parents --dereference new/$file $tmpdir/ + if pushd $tmpdir > /dev/null ; then + case "$ext" in + bz2) + mv old/$file{,.bz2} + mv new/$file{,.bz2} + bzip2 -d old/$file.bz2 & + bzip2 -d new/$file.bz2 & + wait + ;; + gzip) + mv old/$file{,.gz} + mv new/$file{,.gz} + gzip -d old/$file.gz & + gzip -d new/$file.gz & + wait + ;; + xz) + mv old/$file{,.xz} + mv new/$file{,.xz} + xz -d old/$file.xz & + xz -d new/$file.xz & + wait + ;; + zst) + mv old/$file{,.zst} + mv new/$file{,.zst} + zstd -d old/$file.zst & + zstd -d new/$file.zst & + wait + ;; + esac + ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'` + case $ftype in + POSIX\ tar\ archive) + wprint "$ext content is: $ftype" + mv old/$file{,.tar} + mv new/$file{,.tar} + if ! check_single_file ${file}.tar; then + ret=1 + fi + ;; + ASCII\ cpio\ archive\ *) + wprint "$ext content is: $ftype" + mv old/$file{,.cpio} + mv new/$file{,.cpio} + if ! check_single_file ${file}.cpio; then + ret=1 + fi + ;; + fifo*pipe*) + ftype_new="`/usr/bin/file new/$file | sed -e 's@^[^:]\+:[[:blank:]]*@@' -e 's@[[:blank:]]*$@@'`" + if [ "$ftype_new" != "$ftype" ]; then + ret=1 + fi + ;; + *) + wprint "unhandled $ext content: $ftype" + if ! diff_two_files; then + ret=1 + fi + ;; + esac + popd > /dev/null + fi + rm -rf "$tmpdir" + fi + return $ret +} + +# returns 0 if file should be skipped +file_is_on_ignorelist() +{ + local file="$1" + local ret=0 + + case "${file}" in + # Just debug information, we can skip them + *.exe.mdb|*.dll.mdb) ;; + + # binary dump of TeX and Metafont formats, we can ignore them for good + /var/lib/texmf/web2c/*/*fmt|\ + /var/lib/texmf/web2c/metafont/*.base|\ + /var/lib/texmf/web2c/metapost/*.mem) ;; + + # ruby documentation, file just contains a timestamp and nothing else + */created.rid) ;; + + # R binary cache of DESCRIPTION + /usr/lib*/R/library/*/Meta/package.rds) ;; + + # binary cache of interpreted R code + /usr/lib*/R/library/*/R/*.rd[bx]) ;; + + # LibreOffice log file + /usr/lib/libreoffice/solver/inc/*/deliver.log) ;; + + # packaged by libguestfs + */ld.so.cache|*/etc/machine-id) ;; + + # everything else will be processed + *) ret=1 ;; + esac + + return ${ret} +} + +# void +normalize_file() +{ + local file="$1" + local f + + case "$file" in + *.spec) + sed -i -e "s,Release:.*$release1,Release: @RELEASE@," "old/$file" + sed -i -e "s,Release:.*$release2,Release: @RELEASE@," "new/$file" + ;; + */xen*.efi) + filter_generic xenefi + ;; + *.pyc|*.pyo) + filter_generic pyc + ;; + *.dvi) + filter_generic dvi + ;; + *.png) + filter_generic png + ;; + /usr/share/locale/*/LC_MESSAGES/*.mo|\ + /usr/share/locale-bundle/*/LC_MESSAGES/*.mo|\ + /usr/share/vdr/locale/*/LC_MESSAGES/*.mo) + filter_generic mo + ;; + */rdoc/files/*.html) + # ruby documentation + # Mon Sep 20 19:02:43 +0000 2010 + for f in old/$file new/$file; do + sed -i -e 's%[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]%Mon Sep 20 19:02:43 +0000 2010%g' $f + done + strip_numbered_anchors + ;; + /usr/share/doc/HTML/*/*/index.cache|\ + /usr/share/doc//HTML/*/*/*/index.cache|\ + /usr/share/doc/kde/HTML/*/*/index.cache|\ + /usr/share/doc/kde/HTML/*/*/*/index.cache|\ + /usr/share/gtk-doc/html/*/*.html|\ + /usr/share/gtk-doc/html/*/*.devhelp2) + # various kde and gtk packages + strip_numbered_anchors + for f in old/$file new/$file; do + sed -i -e ' + /^/{ + : next + n + /^<\/head>/{ + b end_head + } + s/^// + b next + } + : end_head + ' $f + done + ;; + /usr/share/doc/packages/*/*.html|\ + /usr/share/doc/packages/*/*/*.html|\ + /usr/share/doc/*/html/*.html|\ + /usr/share/doc/kde/HTML/*/*/*.html) + for f in old/$file new/$file; do + sed -i -e ' + s|META NAME="Last-modified" CONTENT="[^"]\+"|META NAME="Last-modified" CONTENT="Thu Mar 3 10:32:44 2016"| + s||| + s| + # + # + # + # + # + # + sed -i -e ' + /^/{ + : next + n + /^<\/head>/{ + b end_head + } + s/^// + t next + s/^\(\)/\1 some-date-removed-by-build-compare \5/ + t next + s/^\(\)/\1 some-date-removed-by-build-compare \3/ + t next + s/^\(\)/\1 some-date-removed-by-build-compare \3/ + t next + s/^// + t next + s/^// + b next + } + : end_head + s%Generated by Gjdoc HtmlDoclet [0-9,.]*, part of GNU Classpath Tools, on .*, 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.%Generated by Gjdoc.% + s%, on [A-Z][a-z]* [0-9]*, 20?? [0-9]*:??:?? \(a|p\)\.m\. GMT.

%, on January 1, 2009 0:00:00 a.m. GMT.

% + s%\), on [a-zA-Z]* [0-9][0-9], 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.

%% + ' $f + # deprecated-list is randomly ordered, sort it for comparison + case $f in + */deprecated-list.html) + [[ $nofilter ]] || sort -o $f $f + ;; + esac + done + ;; + /usr/share/javadoc/gjdoc.properties|\ + /usr/share/javadoc/*/gjdoc.properties) + for f in old/$file new/$file; do + sed -i -e 's|^#[A-Z][a-z]\{2\} [A-Z][a-z]\{2\} [0-9]\{2\} ..:..:.. GMT 20..$|#Fri Jan 01 11:27:36 GMT 2009|' $f + done + ;; + */fonts.scale|\ + */fonts.dir|\ + */encodings.dir) + for f in old/$file new/$file; do + # sort files before comparing + [[ $nofilter ]] || sort -o $f $f + done + ;; + /var/adm/perl-modules/*) + for f in old/$file new/$file; do + sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C|=head2 Wed Jul 1 00:00:00 2009: C|' $f + done + ;; + /usr/share/man/man3/*3pm) + for f in old/$file new/$file; do + sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f + trim_man_TH $f + trim_man_first_line $f + done + ;; + */share/man/*|\ + /usr/lib/texmf/doc/man/*/*) + for f in old/$file new/$file; do + trim_man_TH $f + trim_man_first_line $f + # generated by docbook xml: + #.\" Date: 09/13/2010 + # Generator: DocBook XSL Stylesheets v1.78.1 + #.\" Date: 2021-08-05 + sed -i -e ' + s|Date: [0-1][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]|Date: DD/MM/YYYY| + s|Date: [0-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9]|Date: YYYY-MM-DD| + ' $f + done + ;; + *.elc) + filter_generic emacs_lisp + ;; + */libtool) + for f in old/$file new/$file; do + sed -i -e 's|^# Libtool was configured on host [A-Za-z0-9]*:$|# Libtool was configured on host x42:|' $f + done + ;; + /etc/mail/*cf|\ + /etc/sendmail.cf) + # from sendmail package + for f in old/$file new/$file; do + # - ##### built by abuild@build33 on Thu May 6 11:21:17 UTC 2010 + sed -i -e 's|built by abuild@[a-z0-9]* on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] .* 20[0-9][0-9]|built by abuild@build42 on Thu May 6 11:21:17 UTC 2010|' $f + done + ;; + /usr/lib*/R/library/*/DESCRIPTION) + # Simulate R CMD INSTALL --built-timestamp='' + # Built: R 3.6.1; x86_64-suse-linux-gnu; 2019-08-13 04:19:49 UTC; unix + sed -i -e 's|\(Built: [^;]*; [^;]*; \)20[0-9][0-9]-[01][0-9]-[0123][0-9] [012][0-9]:[0-5][0-9]:[0-5][0-9] UTC\(; .*\)$|\1\2|' old/$file new/$file + ;; + */Linux*Env.Set.sh) + # LibreOffice files, contains: + # Generated on: Mon Apr 18 13:19:22 UTC 2011 + for f in old/$file new/$file; do + sed -i -e 's%^# Generated on:.*UTC 201[0-9] *$%# Generated on: Sometime%g' $f + done + ;; + /var/adm/update-messages/*|\ + /var/adm/update-scripts/*) + # fetchmsttfonts embeds the release number in the update shell script. + sed -i "s/${name_ver_rel_old_regex_l}/@NAME_VER_REL@/" old/$file + sed -i "s/${name_ver_rel_new_regex_l}/@NAME_VER_REL@/" new/$file + ;; + *.ps) + filter_generic ps + ;; + *.pdf) + filter_generic pdf + ;; + */linuxrc.config) + filter_generic linuxrc_config + ;; + */etc/hosts) + # packaged by libguestfs + sed -i 's/^127.0.0.1[[:blank:]].*/127.0.0.1 hst/' "old/$file" + sed -i 's/^127.0.0.1[[:blank:]].*/127.0.0.1 hst/' "new/$file" + ;; + */dune-package) + sed -i '1s@^(lang dune [^)]\+)@(lang dune 0.0)@' "old/$file" "new/$file" + ;; + esac +} + +archive_a() +{ + local cmd=$1 + local file=$2 + case "${cmd}" in + f) + test -x "$(type -P ar)" && return 0 + echo "ERROR: ar missing for ${file}" + return 1 + ;; + l) + ar t "${file}" + test "$?" = "0" && return 0 + return 1 + ;; + x) + ar x "${file}" + test "$?" = "0" && return 0 + return 1 + ;; + esac +} + +archive_cpio() +{ + local cmd=$1 + local file=$2 + case "${cmd}" in + f) + test -x "$(type -P cpio)" && return 0 + echo "ERROR: cpio missing for ${file}" + return 1 + ;; + l) + cpio --quiet --list --force-local < "${file}" + test "$?" = "0" && return 0 + return 1 + ;; + x) + cpio --quiet --extract --force-local < "${file}" + test "$?" = "0" && return 0 + return 1 + ;; + esac +} + +archive_squashfs() +{ + local cmd=$1 + local file=$2 + case "${cmd}" in + f) + test -x "$(type -P unsquashfs)" && return 0 + echo "ERROR: unsquashfs missing for ${file}" + return 1 + ;; + l) + unsquashfs -no-progress -ls -dest '' "${file}" | grep -Ev '^(Parallel unsquashfs:|[0-9]+ inodes )' + test "$?" = "0" && return 0 + return 1 + ;; + x) + unsquashfs -no-progress -dest "." "${file}" + test "$?" = "0" && return 0 + return 1 + ;; + esac +} + +archive_tar() +{ + local cmd=$1 + local file=$2 + case "${cmd}" in + f) + test -x "$(type -P tar)" && return 0 + echo "ERROR: tar missing for ${file}" + return 1 + ;; + l) + tar tf "${file}" + test "$?" = "0" && return 0 + return 1 + ;; + x) + tar xf "${file}" + test "$?" = "0" && return 0 + return 1 + ;; + esac +} + +UNJAR= +archive_zip() +{ + local cmd=$1 + local file=$2 + case "${cmd}" in + f) + if test -x "$(type -P fastjar)" + then + UNJAR="${_}" + elif test -x "$(type -P jar)" + then + UNJAR="${_}" + elif test -x "$(type -P unzip)" + then + UNJAR="${_}" + else + echo "ERROR: jar/fastjar/unzip missing for ${file}" + return 1 + fi + return 0 + ;; + l) + case "${UNJAR##*/}" in + jar|fastjar) + "${UNJAR}" -tf "${file}" + ;; + unzip) + "${UNJAR}" -Z -1 "${file}" + ;; + esac + test "$?" = "0" && return 0 + return 1 + ;; + x) + case "${UNJAR##*/}" in + jar|fastjar) + "${UNJAR}" -xf "${file}" + ;; + unzip) + "${UNJAR}" -oqq "${file}" + ;; + esac + test "$?" = "0" && return 0 + return 1 + ;; + esac +} + +# returns 0 if content is identical +# returns 1 if at least one file differs +# handler f returns 1 if required tool for inspection is missing +# handler l lists content, returns 1 if tool failed +# handler x extracts content, returns 1 if tool failed +compare_archive() +{ + local file="$1" + local handler="$2" + local old="`readlink -f \"old/$file\"`" + local new="`readlink -f \"new/$file\"`" + local f + local -a content + local -i ret=1 + local -a filelist + + "${handler}" 'f' "${file}" || return 1 + + mkdir -p "d/old/${file}" "d/new/${file}" + if pushd "d" > /dev/null + then + "${handler}" 'l' "${old}" | ${sort} > 'co' + test "${PIPESTATUS[0]}" = "0" || return 1 + "${handler}" 'l' "${new}" | ${sort} > 'cn' + test "${PIPESTATUS[0]}" = "0" || return 1 + if cmp -s 'co' 'cn' + then + if pushd "old/${file}" > /dev/null + then + "${handler}" 'x' "${old}" || return 1 + popd > /dev/null + fi + if pushd "new/${file}" > /dev/null + then + "${handler}" 'x' "${new}" || return 1 + popd > /dev/null + fi + while read + do + : "${REPLY}" + filelist+=( "${REPLY}" ) + done < 'cn' + ret=0 + for f in "${filelist[@]}" + do + if ! check_single_file "${file}/${f}" + then + ret=1 + if test -z "$check_all" + then + break + fi + fi + watchdog_touch + done + else + wprint "$file has different file list" + diff -u 'co' 'cn' + fi + popd > /dev/null + rm -rf "d" + fi + + return ${ret} +} + +check_single_file() +{ + local file="$1" + local ret=0 + local i + local failed + local elfdiff elf_executable_sections + local sections + local -a pipestatus + + if file_is_on_ignorelist "${file}" + then + return 0 + fi + + verify_before_processing "${file}" "${dfile}" + case "$?" in + 0) return 0 ;; + 1) test -z "$check_all" && return 1 ;; + *) ;; + esac + + normalize_file "${file}" + + case "$file" in + *.a) + compare_archive "${file}" 'archive_a' + return $? + ;; + *.cpio) + compare_archive "${file}" 'archive_cpio' + return $? + ;; + *.squashfs) + compare_archive "${file}" 'archive_squashfs' + return $? + ;; + *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2|*.tar.zst) + compare_archive "${file}" 'archive_tar' + return $? + ;; + *.zip|*.egg|*.jar|*.war) + compare_archive "${file}" 'archive_zip' + return $? + ;; + *.bz2) + bunzip2 -c old/$file > old/${file/.bz2/} + bunzip2 -c new/$file > new/${file/.bz2/} + check_single_file ${file/.bz2/} + return $? + ;; + *.gz) + gunzip -c old/$file > old/${file/.gz/} + gunzip -c new/$file > new/${file/.gz/} + check_single_file ${file/.gz/} + return $? + ;; + *.zst) + zstd -dc old/$file > old/${file/.zst/} + zstd -dc new/$file > new/${file/.zst/} + check_single_file ${file/.zst/} + return $? + ;; + *.rpm) + $self_script -a old/$file new/$file + return $? + ;; + esac + + ftype=`/usr/bin/file "old/$file" | sed -e 's@^[^:]\+:[[:blank:]]*@@' -e 's@[[:blank:]]*$@@'` + case $ftype in + PE32\ executable*Mono\/\.Net\ assembly*) + wprint "PE32 Mono/.Net assembly: $file" + if [ -x /usr/bin/monodis ] ; then + monodis "old/$file" 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file1} + monodis "new/$file" 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file2} + if ! cmp -s "${file1}" "${file2}"; then + wprint "$file differs ($ftype)" + diff --speed-large-files -u \ + --label "old $file (monodis)" "${file1}" \ + --label "new $file (monodis)" "${file2}" + return 1 + fi + else + wprint "Cannot compare, no monodis installed" + return 1 + fi + ;; + ELF*executable*|\ + set?id\ ELF*executable*|\ + ELF*[LM]SB\ relocatable*|\ + set?id\ ELF*[LM]SB\ relocatable*|\ + ELF*[LM]SB\ shared\ object*|\ + set?id\ ELF*[LM]SB\ shared\ object*|\ + ELF*[LM]SB\ pie\ executable*|\ + set?id\ ELF*[LM]SB\ pie\ executable*) + local sections=($( + $OBJDUMP -s new/$file | + sed -n --regexp-extended -e ' + /Contents of section .*:/ { + s,.* (.*):,-j \1,g + /\.build-id/d + /\.gnu_debuglink/d + /\.gnu_debugdata/d + /\.note\.package/d + /\.note\.go\.buildid/d + p + } + ')) + (cd old && exec $OBJDUMP -s ${sections[@]} ./$file ) > old/$file.objdump & + (cd new && exec $OBJDUMP -s ${sections[@]} ./$file ) > new/$file.objdump & + wait + if ! test -s old/$file.objdump + then + wprint "ELF section: objdump failed for old/$file" + elfdiff='failed' + fi + if ! test -s new/$file.objdump + then + wprint "ELF section: objdump failed for new/$file" + elfdiff='failed' + fi + if test -z "${elfdiff}" + then + diff --speed-large-files --unified \ + --label "old $file (objdump)" \ + --label "new $file (objdump)" \ + old/$file.objdump new/$file.objdump > $dfile + ret=$? + if test "$ret" != "0" + then + wprint "$file differs in ELF sections" + $buildcompare_head $dfile + elfdiff='elfdiff' + fi + fi + if test -z "$elfdiff" + then + rm old/$file.objdump new/$file.objdump & + return 0 + fi + watchdog_touch + (cd old && exec $OBJDUMP -d --no-show-raw-insn ./$file | filter_disasm + echo "${PIPESTATUS[@]}" > $file1 ) > old/$file.objdump & + (cd new && exec $OBJDUMP -d --no-show-raw-insn ./$file | filter_disasm + echo "${PIPESTATUS[@]}" > $file2 ) > new/$file.objdump & + wait + read i < ${file1} + pipestatus=( $i ) + if [[ ${pipestatus[*]} =~ [1-9] ]] + then + wprint "ELF disassembly: pipe command failed for old/$file" + elf_executable_sections='failed' + fi + read i < ${file2} + pipestatus=( $i ) + if [[ ${pipestatus[*]} =~ [1-9] ]] + then + wprint "ELF disassembly: pipe command failed for new/$file" + elf_executable_sections='failed' + fi + if test -n "${elf_executable_sections}" + then + # objdump had no idea how to handle it + rm old/$file.objdump new/$file.objdump & + if diff_two_files; then + return 0 + fi + return 1 + fi + diff --speed-large-files --unified \ + --label "old $file (disasm)" \ + --label "new $file (disasm)" \ + old/$file.objdump new/$file.objdump > $dfile + ret=$? + rm old/$file.objdump new/$file.objdump & + if test "$ret" != "0" + then + wprint "$file differs in assembler output" + $buildcompare_head $dfile + elf_executable_sections='elf_executable_sections' + else + watchdog_touch + fi + if test -n "$elfdiff" || test -n "$elf_executable_sections" + then + return 1 + fi + ;; + *ASCII*|*text*) + if ! cmp -s "old/$file" "new/$file" ; then + wprint "$file differs ($ftype)" + diff -u "old/$file" "new/$file" | $buildcompare_head + return 1 + fi + ;; + directory|setuid\ directory|setuid,\ directory|sticky,\ directory) + # tar might package directories - ignore them here + return 0 + ;; + bzip2\ compressed\ data*) + if ! check_compressed_file "$file" "bz2" ; then + return 1 + fi + ;; + gzip\ compressed\ data*) + if ! check_compressed_file "$file" "gzip" ; then + return 1 + fi + ;; + XZ\ compressed\ data*) + if ! check_compressed_file "$file" "xz" ; then + return 1 + fi + ;; + Zstandard\ compressed\ data*) + if ! check_compressed_file "$file" "zst" ; then + return 1 + fi + ;; + Zip\ archive\ data,*) + if ! compare_archive "${file}" 'archive_zip' ; then + return 1 + fi + ;; + POSIX\ tar\ archive) + mv old/$file{,.tar} + mv new/$file{,.tar} + if ! check_single_file ${file}.tar; then + return 1 + fi + ;; + cpio\ archive) + mv old/$file{,.cpio} + mv new/$file{,.cpio} + if ! check_single_file ${file}.cpio; then + return 1 + fi + ;; + Squashfs\ filesystem,*) + wprint "$file ($ftype)" + mv old/$file{,.squashfs} + mv new/$file{,.squashfs} + if ! check_single_file ${file}.squashfs; then + return 1 + fi + ;; + broken\ symbolic\ link\ to\ *|symbolic\ link\ to\ *) + readlink "old/$file" > $file1 + readlink "new/$file" > $file2 + if ! diff -u $file1 $file2; then + wprint "symlink target for $file differs" + return 1 + fi + ;; + block\ special\ *) + ;; + character\ special\ *) + ;; + *) + if ! diff_two_files; then + return 1 + fi + ;; + esac + return 0 +} + +case "${0}" in + */*) FUNCTIONS=${0%/*}/functions.sh ;; + *) FUNCTIONS=functions.sh ;; +esac +: ${buildcompare_head:="head -n 200"} +nofilter=${buildcompare_nofilter} +sort=sort +[[ $nofilter ]] && sort=cat + +check_all= +case $1 in + -a | --check-all) + check_all=1 + shift +esac + +if test "$#" != 2; then + echo "usage: $0 [-a|--check-all] old.rpm new.rpm" + exit 1 +fi + +test -z $OBJDUMP && OBJDUMP=objdump + +# Always clean up on exit +local_tmpdir=`mktemp -d` +if test -z "${local_tmpdir}" +then + exit 1 +fi +function _exit() +{ + chmod -R u+w "${local_tmpdir}" + rm -rf "${local_tmpdir}" +} +trap _exit EXIT +# Let further mktemp refer to private tmpdir +export TMPDIR=$local_tmpdir + +self_script=$(cd $(dirname $0); echo $(pwd)/$(basename $0)) + +source $FUNCTIONS + +oldpkg=`readlink -f $1` +newpkg=`readlink -f $2` +rename_script=`mktemp` + +file1=`mktemp` +file2=`mktemp` +dir=`mktemp -d` +dfile=`mktemp` + +if test ! -f "$oldpkg"; then + echo "can't open $1" + exit 1 +fi + +if test ! -f "$newpkg"; then + echo "can't open $2" + exit 1 +fi + +echo "Comparing `basename $oldpkg` to `basename $newpkg`" + +case $oldpkg in + *.deb|*.ipk) + : cmp_deb_meta missing + RES=0 + ;; + *.rpm) + cmp_rpm_meta "$rename_script" "$oldpkg" "$newpkg" + RES=$? + case $RES in + 0) + echo "RPM meta information is identical" + if test -z "$check_all"; then + exit 0 + fi + ;; + 1) + echo "RPM meta information is different" + if test -z "$check_all"; then + exit 1 + fi + ;; + 2) + echo "RPM file checksum differs." + RES=0 + ;; + *) + echo "Wrong exit code!" + exit 1 + ;; + esac + ;; +esac + +wprint "Extracting packages" +unpackage $oldpkg $dir/old & +unpackage $newpkg $dir/new & +wait + +case $oldpkg in + *.deb|*.ipk) + adjust_controlfile $dir/old $dir/new + files=() + while read + do + : "${REPLY}" + files+=( "${REPLY}" ) + done < <(cd ${dir} ; find old new -type f | sed -e 's/^...//' | sort -u) + ;; +esac + +cd $dir +bash $rename_script + +# We need /proc mounted for some tests, so check that it's mounted and +# complain if not. +PROC_MOUNTED=0 +if [ ! -d /proc/self/ ]; then + echo "/proc is not mounted" + mount -orw -n -tproc none /proc + PROC_MOUNTED=1 +fi + +# preserve cmp_rpm_meta result for check_all runs +ret=$RES +for file in "${files[@]}"; do + if ! check_single_file "$file"; then + ret=1 + if test -z "$check_all"; then + break + fi + fi +done + +if [ "$PROC_MOUNTED" -eq "1" ]; then + echo "Unmounting proc" + umount /proc +fi + +if test "$ret" = 0; then + echo "Package content is identical" +fi +exit $ret +# vim: tw=666 ts=2 shiftwidth=2 et diff --git a/same-build-result.sh b/same-build-result.sh new file mode 100644 index 0000000..df212b0 --- /dev/null +++ b/same-build-result.sh @@ -0,0 +1,244 @@ +#!/bin/bash +# +# Copyright (c) 2009, 2010, 2012 SUSE Linux Product GmbH, Germany. +# Licensed under GPL v2, see COPYING file for details. +# +# Written by Adrian Schroeter +# Enhanced by Andreas Jaeger +# +# The script decides if the new build differes from the former one, +# using pkg-diff.sh. +# The script is called as part of the build process as: +# /usr/lib/build/same-build-result.sh /.build.oldpackages /usr/src/packages/RPMS /usr/src/packages/SRPMS + +CMPSCRIPT=${0%/*}/pkg-diff.sh +SCMPSCRIPT=${0%/*}/srpm-check.sh + +declare -a exit_code +# exit_code[0]='' # binaries_differ +# exit_code[1]='' # rpmlint_differs +# exit_code[2]='' # appdata_differs +# exit_code[3]='' # srcrpm_differs +file1=`mktemp` +file2=`mktemp` +_x() { + rm -f ${file1} ${file2} +} +trap _x EXIT +# +remove_check_time_report() { + local f=$1 + awk ' + BEGIN { + ctr_seen=0; + } + /Check time report .*:$/ { + ctr_seen=1; + next; + } + /TOTAL[[:blank:]]+[0-9]/ { + if (ctr_seen == 1) { + ctr_seen=0; + next; + } + } + { + if (ctr_seen == 1) { + next; + } + print $0; + } + ' < "${f}" +} +# +check_all= +if test "$1" = "-a" +then + check_all="-a" + shift +fi +# +OLDDIR="$1" +shift +NEWDIRS="$*" + +echo "$CMPSCRIPT" + +if [ ! -d "$OLDDIR" ]; then + echo "No valid directory with old build result given !" + exit 1 +fi +if [ -z "$NEWDIRS" ]; then + echo "No valid directory with new build result given !" + exit 1 +fi + +if test `find $NEWDIRS -name '*.rpm' -and ! -name '*.delta.rpm' | wc -l` != `find $OLDDIR -name '*.rpm' -and ! -name '*.delta.rpm' | wc -l`; then + echo "different number of subpackages" + find $OLDDIR -name '*.rpm' -and ! -name '*.delta.rpm' -print0 | xargs -0 rpm -qp --qf '%{NAME}\n' | sort > ${file1} + find $NEWDIRS -name '*.rpm' -and ! -name '*.delta.rpm' -print0 | xargs -0 rpm -qp --qf '%{NAME}\n' | sort > ${file2} + diff -u ${file1} ${file2} + exit 1 +fi + +osrpm=$(find "$OLDDIR" -name \*src.rpm) +nsrpm=$(find $NEWDIRS -name \*src.rpm) + +if test ! -f "$osrpm"; then + echo no old source rpm in $OLDDIR + exit 1 +fi + +if test ! -f "$nsrpm"; then + echo no new source rpm in $NEWDIRS + exit 1 +fi + +echo "compare $osrpm $nsrpm" +if bash $SCMPSCRIPT $check_all "$osrpm" "$nsrpm" +then + : src.rpm identical +else + test -z "${check_all}" && exit 1 + exit_code[3]='srcrpm_differs' +fi + +# technically we should not all exclude all -32bit but filter for different archs, +# like done with -x86 +# but it would be better if this script ran earlier in the build +# sort the rpms so that both lists have the same order +# problem: a package can contain both noarch and arch subpackages, so we have to +# take care of proper sorting of NEWRPMS, e.g. noarch/x.rpm and x86_64/w.rpm since OLDRPMS +# has all the packages in a single directory and would sort this as w.rpm, x.rpm. +find $OLDDIR -type f -name '*.rpm' \ + -a ! -name '*src.rpm' \ + -a ! -name '*.delta.rpm' \ + -a ! -name '*-32bit-*' \ + -a ! -name '*-64bit-*' \ + -a ! -name '*-x86-*.ia64.rpm' \ + > ${file1} +find $NEWDIRS -type f -name '*.rpm' \ + -a ! -name '*src.rpm' \ + -a ! -name '*.delta.rpm' \ + -a ! -name '*-32bit-*' \ + -a ! -name '*-64bit-*' \ + -a ! -name '*-x86-*.ia64.rpm' \ + > ${file2} +OLDRPMS=($( sort --field-separator=/ --key=` sed -n '1s@[^/]@@gp' ${file1} | wc -c ` ${file1} )) +NEWRPMS=($( sort --field-separator=/ --key=` sed -n '1s@[^/]@@gp' ${file2} | wc -c ` ${file2} )) + +# Get version-release from first RPM and keep for rpmlint check +# Remember to quote the "." for future regexes +ver_rel1=$(rpm -qp --nodigest --nosignature --qf "%{VERSION}-%{RELEASE}" "${OLDRPMS[0]}"|sed -e 's/\./\\./g') +ver_rel2=$(rpm -qp --nodigest --nosignature --qf "%{VERSION}-%{RELEASE}" "${NEWRPMS[0]}"|sed -e 's/\./\\./g') + +rpmqp='rpm -qp --qf %{NAME} --nodigest --nosignature ' +for opac in ${OLDRPMS[*]}; do + npac=${NEWRPMS[0]} + NEWRPMS=(${NEWRPMS[@]:1}) # shift + echo compare "$opac" "$npac" + oname=`$rpmqp $opac` + nname=`$rpmqp $npac` + if test "$oname" != "$nname"; then + echo "names differ: $oname $nname" + exit 1 + fi + case "$opac" in + *debuginfo*) + echo "skipping -debuginfo package" + ;; + *) + bash $CMPSCRIPT $check_all "$opac" "$npac" || exit_code[0]='binaries_differ' + ;; + esac +done + +if [ -n "${NEWRPMS[0]}" ]; then + echo additional new package + exit 1 +fi + +OTHERDIR= +# Compare rpmlint.log files +if test -d /home/abuild/rpmbuild/OTHER; then + OTHERDIR=/home/abuild/rpmbuild/OTHER +elif test -d /usr/src/packages/OTHER; then + OTHERDIR=/usr/src/packages/OTHER +else + for newdir in $NEWDIRS + do + test -f "${newdir}/rpmlint.log" || continue + OTHERDIR="${newdir}" + break + done + test -n "$OTHERDIR" || echo "no OTHERDIR" +fi + +if test -n "$OTHERDIR"; then + old_log=$OLDDIR/rpmlint.log + new_log=$OTHERDIR/rpmlint.log + if test -e ${old_log} && test -e ${new_log} ; then + echo "comparing ${old_log} and ${new_log}" + # Remove --time-report from rpmlint + # Sort the files first since the order of messages is not deterministic + # Remove release from files + remove_check_time_report ${old_log}|sort -u|sed -e "s,$ver_rel1,@VERSION@-@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file1 + remove_check_time_report ${new_log}|sort -u|sed -e "s,$ver_rel2,@VERSION@-@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file2 + # Remove odd warning about not-hardlinked files + # Remove odd warning about data and time, it comes and goes + # Remove warning about python mtime mismatch, a republish will not help + # Remove odd warning about filenames, they contain VERSION-RELEASE + # Remove durations from progress reports + # Remove odd output about number of checks and packages + sed -i -e " + /: W: files-duplicate /d + /: W: file-contains-date-and-time /d + /: W: python-bytecode-inconsistent-mtime /d + /: W: filename-too-long-for-joliet /d + /: I: \(filelist-initialization\|check-completed\) /s| [0-9]\+\.[0-9] s| x.x s| + s/; has taken [0-9]\+\.[0-9] s/; has taken x.x s/ + /^checks: [0-9]\+, packages: [0-9]\+/d + " $file1 $file2 + if ! cmp -s $file1 $file2; then + echo "rpmlint.log files differ:" + diff -u $file1 $file2 |head -n 20 + exit_code[1]='rpmlint_differs' + fi + rm $file1 $file2 + else + if test -e "${new_log}" + then + exit_code[1]='rpmlint_new' + echo "rpmlint.log is new" + elif test -e "${old_log}" + then + exit_code[1]='rpmlint_old' + echo "rpmlint.log disappeared" + else + echo "No rpmlint.log available" + fi + fi + + appdatas=$(cd $OTHERDIR && find . -name "*-appdata.xml") + for xml in $appdatas; do + # compare appstream data + if test -e $OLDDIR/$xml && test -e $OTHERDIR/$xml; then + file1=$OLDDIR/$xml + file2=$OTHERDIR/$xml + if ! cmp -s $file1 $file2; then + echo "$xml files differ:" + diff -u0 $file1 $file2 |head -n 20 + exit_code[2]='appdata_differs' + fi + elif test -e $OTHERDIR/$xml; then + echo "$xml is new" + exit_code[2]='appdata_new' + fi + done +fi +if test -n "${exit_code[*]}"; then + exit 1 +fi +echo 'compare validated build as identical !' +exit 0 +# vim: tw=666 ts=2 shiftwidth=2 et diff --git a/srpm-check.sh b/srpm-check.sh new file mode 100644 index 0000000..05e5408 --- /dev/null +++ b/srpm-check.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# Copyright (c) 2009, 2010 SUSE Linux Product GmbH, Germany. +# Copyright (c) 2022 SUSE LLC +# Licensed under GPL v2, see COPYING file for details. +# +# Written by Michael Matz and Stephan Kulow +# Enhanced by Andreas Jaeger and Dirk Müller + +# Compare two source RPMs + +FUNCTIONS=${0%/*}/functions.sh + +check_all= +case $1 in + -a | --check-all) + check_all=1 + shift +esac + +if test "$#" != 2; then + echo "usage: $0 [-a|--check-all] old.rpm new.rpm" + exit 1 +fi + +source $FUNCTIONS + +oldrpm=$(readlink -f $1) +newrpm=$(readlink -f $2) +rename_script= + +# For source RPMs, we can just check the metadata in the spec file +# if those are not the same, the source RPM has changed and therefore +# the resulting files are needed. + +cmp_rpm_meta "$rename_script" "$oldrpm" "$newrpm" +RES=$? +case $RES in + 0) + echo "RPM meta information is identical" + exit 0 + ;; + 1) + echo "RPM meta information is different" + exit 1 + ;; + 2) + ;; + *) + echo "Wrong exit code!" + exit 1 + ;; +esac + +# Now check that only the spec file has a changed release number and +# nothing else + +dir=$(mktemp -d) +unpackage $oldrpm $dir/old & +unpackage $newrpm $dir/new & +cd $dir +wait + +check_single_file() +{ + local file=$1 + case $file in + *.spec) + sed -i -e 's,^Release:.*$,Release: @RELEASE@,' old/$file + sed -i -e 's,^Release:.*$,Release: @RELEASE@,' new/$file + diff --speed-large-files -su0 old/$file new/$file | head -n 20 + return "${PIPESTATUS[0]}" + ;; + *) + echo "$file differs" + # Nothing else should be changed + ;; + esac + return 1 +} + +ret=0 +for file in "${files[@]}"; do + if ! check_single_file $file; then + ret=1 + if test -z "$check_all"; then + break + fi + fi +done + +rm -rf $dir +exit $ret +# vim: tw=666 ts=2 shiftwidth=2 et