summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 20:29:09 (GMT)
committerAnas Nashif <anas.nashif@intel.com>2012-10-30 20:29:09 (GMT)
commitefbaf9bb0673b446ba40efa8107045987ee367f8 (patch)
tree6579899a46c017a889fa6654aeb78f31c2c42564
downloadbuild-compare-efbaf9bb0673b446ba40efa8107045987ee367f8.zip
build-compare-efbaf9bb0673b446ba40efa8107045987ee367f8.tar.gz
build-compare-efbaf9bb0673b446ba40efa8107045987ee367f8.tar.bz2
-rw-r--r--packaging/COPYING339
-rw-r--r--packaging/Changes356
-rw-r--r--packaging/build-compare.changes504
-rw-r--r--packaging/build-compare.spec54
-rw-r--r--packaging/functions.sh154
-rw-r--r--packaging/rpm-check.sh521
-rw-r--r--packaging/same-build-result.sh136
-rw-r--r--packaging/srpm-check.sh94
8 files changed, 2158 insertions, 0 deletions
diff --git a/packaging/COPYING b/packaging/COPYING
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/packaging/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.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin 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.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/packaging/Changes b/packaging/Changes
new file mode 100644
index 0000000..d82f100
--- /dev/null
+++ b/packaging/Changes
@@ -0,0 +1,356 @@
+-------------------------------------------------------------------
+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/packaging/build-compare.changes b/packaging/build-compare.changes
new file mode 100644
index 0000000..233485d
--- /dev/null
+++ b/packaging/build-compare.changes
@@ -0,0 +1,504 @@
+-------------------------------------------------------------------
+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 <mtanguay@thoughtworks.com>.
+
+-------------------------------------------------------------------
+Tue May 8 12:35:21 UTC 2012 - aj@suse.de
+
+- Further handling of pdf files (bnc#760867), patch by
+ David Haller <david@dhaller.de>.
+
+-------------------------------------------------------------------
+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/packaging/build-compare.spec b/packaging/build-compare.spec
new file mode 100644
index 0000000..af814ae
--- /dev/null
+++ b/packaging/build-compare.spec
@@ -0,0 +1,54 @@
+#
+# spec file for package build-compare
+#
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+#
+# 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 http://bugs.opensuse.org/
+#
+
+
+Name: build-compare
+Summary: Build Result Compare Script
+License: GPL-2.0+
+Group: Development/Tools/Building
+Version: 2012.01.26
+Release: 0
+Source1: COPYING
+Source2: same-build-result.sh
+Source3: rpm-check.sh
+Source4: functions.sh
+Source5: srpm-check.sh
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildArch: noarch
+
+%description
+This package contains scripts to find out if the build result differs
+to a former build.
+
+
+%prep
+mkdir $RPM_BUILD_DIR/%name-%version
+%setup -T 0 -D
+
+%build
+
+%install
+mkdir -p $RPM_BUILD_ROOT/usr/lib/build/ $RPM_BUILD_ROOT/%_defaultdocdir/%name
+install -m 0755 %SOURCE2 %SOURCE3 %SOURCE4 %SOURCE5 $RPM_BUILD_ROOT/usr/lib/build/
+install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/%_defaultdocdir/%name/
+
+%files
+%defattr(-,root,root)
+%doc %_defaultdocdir/%name
+/usr/lib/build
+
+%changelog
diff --git a/packaging/functions.sh b/packaging/functions.sh
new file mode 100644
index 0000000..c8047ab
--- /dev/null
+++ b/packaging/functions.sh
@@ -0,0 +1,154 @@
+#! /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"
+
+check_header()
+{
+ $RPM --qf "$QF" "$1"
+}
+
+function check_provides()
+{
+
+ # provides destroy this because at least the self-provide includes the
+ # -buildnumber :-(
+ QF="[%{PROVIDENAME} %{PROVIDEFLAGS} %{PROVIDEVERSION}\\n]\\n"
+ QF="$QF [%{REQUIRENAME} %{REQUIREFLAGS} %{REQUIREVERSION}\\n]\\n"
+ QF="$QF [%{CONFLICTNAME} %{CONFLICTFLAGS} %{CONFLICTVERSION}\\n]\\n"
+ QF="$QF [%{OBSOLETENAME} %{OBSOLETEFLAGS} %{OBSOLETEVERSION}\\n]\\n"
+ check_header "$1" | sed -e "s,-$2$,-@RELEASE@,"
+}
+
+#usage unrpm <file> $dir
+# Unpack rpm files in directory $dir
+# like /usr/bin/unrpm - just for one file and with no options
+function unrpm()
+{
+ local file
+ local dir
+ file=$1
+ dir=$2
+ CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet"
+ mkdir -p $dir
+ pushd $dir 1>/dev/null
+ rpm2cpio $file | cpio ${CPIO_OPTS}
+ popd 1>/dev/null
+}
+
+# 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 with list of files that need further investigation
+function cmp_spec ()
+{
+ QF="%{NAME}"
+
+ # don't look at RELEASE, it contains our build number
+ QF="$QF %{VERSION} %{EPOCH}\\n"
+ QF="$QF %{SUMMARY}\\n%{DESCRIPTION}\\n"
+ QF="$QF %{VENDOR} %{DISTRIBUTION} %{DISTURL}"
+ QF="$QF %{LICENSE} %{LICENSE}\\n"
+ QF="$QF %{GROUP} %{URL} %{EXCLUDEARCH} %{EXCLUDEOS} %{EXCLUSIVEARCH}\\n"
+ QF="$QF %{EXCLUSIVEOS} %{RPMVERSION} %{PLATFORM}\\n"
+ QF="$QF %{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
+
+ QF="$QF [%{VERIFYSCRIPTPROG} %{VERIFYSCRIPT}]\\n"
+
+ # Only the first ChangeLog entry; should be enough
+ QF="$QF %{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n"
+
+ file1=`mktemp`
+ file2=`mktemp`
+
+ check_header $oldrpm > $file1
+ check_header $newrpm > $file2
+
+ # the DISTURL tag can be used as checkin ID
+ #echo "$QF"
+ if ! diff -au $file1 $file2; then
+ rm $file1 $file2
+ return 1
+ fi
+
+ # Remember to quote the . which is in release
+ release1=`$RPM --qf "%{RELEASE}" "$oldrpm"|sed -e 's/\./\\./g'`
+ release2=`$RPM --qf "%{RELEASE}" "$newrpm"|sed -e 's/\./\\./g'`
+ # This might happen with a forced rebuild of factory
+ if [ "${release1%.*}" != "${release2%.*}" ] ; then
+ echo "release prefix mismatch"
+ return 1
+ fi
+
+ check_provides $oldrpm $release1 > $file1
+ check_provides $newrpm $release2 > $file2
+
+ if ! diff -au $file1 $file2; then
+ rm $file1 $file2
+ return 1
+ fi
+
+ # scripts, might contain release number
+ QF="[%{PREINPROG} %{PREIN}\\n]\\n[%{POSTINPROG} %{POSTIN}\\n]\\n[%{PREUNPROG} %{PREUN}\\n]\\n[%{POSTUNPROG} %{POSTUN}\\n]\\n"
+ check_header $oldrpm | sed -e "s,-$release1$,-@RELEASE@," > $file1
+ check_header $newrpm | sed -e "s,-$release2$,-@RELEASE@," > $file2
+
+ if ! diff -au $file1 $file2; then
+ rm $file1 $file2
+ return 1
+ fi
+
+ # First check the file attributes and later the md5s
+
+ # 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="[%{FILENAMES} %{FILEFLAGS} %{FILESTATES} %{FILEMODES:octal} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILERDEVS} %{FILEVERIFYFLAGS} %{FILELINKTOS}\n]\\n"
+ # ??? what to do with FILEPROVIDE and FILEREQUIRE?
+
+ check_header $oldrpm > $file1
+ check_header $newrpm > $file2
+
+ if ! diff -au $file1 $file2; then
+ rm $file1 $file2
+ 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
+ QF="[%{FILENAMES} %{FILEMD5S}\n]\\n"
+ check_header $oldrpm > $file1
+ check_header $newrpm > $file2
+
+ RES=2
+ # done if the same
+ if cmp -s $file1 $file2; then
+ RES=0
+ fi
+
+ # Get only files with different MD5sums
+ files=`diff -U0 $file1 $file2 | fgrep -v +++ | grep ^+ | cut -b2- | awk '{print $1}'`
+
+ rm $file1 $file2
+ return $RES
+}
diff --git a/packaging/rpm-check.sh b/packaging/rpm-check.sh
new file mode 100644
index 0000000..5c6fcb7
--- /dev/null
+++ b/packaging/rpm-check.sh
@@ -0,0 +1,521 @@
+#! /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
+
+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`
+
+if test ! -f $oldrpm; then
+ echo "can't open $oldrpm"
+ exit 1
+fi
+
+if test ! -f $newrpm; then
+ echo "can't open $newrpm"
+ exit 1
+fi
+
+#usage unjar <file>
+function unjar()
+{
+ local file
+ file=$1
+
+ if [[ $(type -p fastjar) ]]; then
+ UNJAR=fastjar
+ elif [[ $(type -p jar) ]]; then
+ UNJAR=jar
+ elif [[ $(type -p unzip) ]]; then
+ UNJAR=unzip
+ else
+ echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
+ exit 1
+ fi
+
+ case $UNJAR in
+ jar|fastjar)
+ # echo jar -xf $file
+ ${UNJAR} -xf $file
+ ;;
+ unzip)
+ unzip -oqq $file
+ ;;
+ esac
+}
+
+# list files in directory
+#usage unjar_l <file>
+function unjar_l()
+{
+ local file
+ file=$1
+
+ if [[ $(type -p fastjar) ]]; then
+ UNJAR=fastjar
+ elif [[ $(type -p jar) ]]; then
+ UNJAR=jar
+ elif [[ $(type -p unzip) ]]; then
+ UNJAR=unzip
+ else
+ echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
+ exit 1
+ fi
+
+ case $UNJAR in
+ jar|fastjar)
+ ${UNJAR} -tf $file
+ ;;
+ unzip)
+ unzip -l $file
+ ;;
+ esac
+}
+
+filter_disasm()
+{
+ sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/# /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/'
+}
+
+cmp_spec $1 $2
+RES=$?
+case $RES in
+ 0)
+ exit 0
+ ;;
+ 1)
+ echo "RPM meta information is different"
+ exit 1
+ ;;
+ 2)
+ ;;
+ *)
+ echo "Wrong exit code!"
+ exit 1
+ ;;
+esac
+
+file1=`mktemp`
+file2=`mktemp`
+
+dir=`mktemp -d`
+unrpm $oldrpm $dir/old
+unrpm $newrpm $dir/new
+cd $dir
+
+dfile=`mktemp`
+
+diff_two_files()
+{
+ if ! cmp -s old/$file new/$file; then
+ echo "$file differs ($ftype)"
+ hexdump -C old/$file > $file1
+ hexdump -C new/$file > $file2
+ diff -u $file1 $file2 | head -n 200
+ return 1
+ fi
+ return 0
+}
+
+check_single_file()
+{
+ local file="$1"
+ case $file in
+ *.spec)
+ sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
+ sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
+ ;;
+ *.exe.mdb|*.dll.mdb)
+ # Just debug information, we can skip them
+ echo "$file skipped as debug file."
+ return 0
+ ;;
+ *.a)
+ flist=`ar t new/$file`
+ pwd=$PWD
+ fdir=`dirname $file`
+ cd old/$fdir
+ ar x `basename $file`
+ cd $pwd/new/$fdir
+ ar x `basename $file`
+ cd $pwd
+ for f in $flist; do
+ if ! check_single_file $fdir/$f; then
+ return 1
+ fi
+ done
+ return 0
+ ;;
+ *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
+ flist=`tar tf new/$file`
+ pwd=$PWD
+ fdir=`dirname $file`
+ cd old/$fdir
+ tar xf `basename $file`
+ cd $pwd/new/$fdir
+ tar xf `basename $file`
+ cd $pwd
+ local ret=0
+ for f in $flist; do
+ if ! check_single_file $fdir/$f; then
+ ret=1
+ if test -z "$check_all"; then
+ break
+ fi
+ fi
+ done
+ return $ret
+ ;;
+ *.zip|*.jar)
+ cd old
+ unjar_l ./$file |sort > flist
+ # 10-05-2010 14:39
+ sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ," flist
+ # 2012-02-03 07:59
+ sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
+ cd ../new
+ unjar_l ./$file |sort> flist
+ sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ,; " flist
+ sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
+ cd ..
+ if ! cmp -s old/flist new/flist; then
+ echo "$file has different file list"
+ diff -u old/flist new/flist
+ return 1
+ fi
+ flist=`grep date new/flist | sed -e 's,.* date ,,'`
+ pwd=$PWD
+ fdir=`dirname $file`
+ cd old/$fdir
+ unjar `basename $file`
+ cd $pwd/new/$fdir
+ unjar `basename $file`
+ cd $pwd
+ local ret=0
+ for f in $flist; do
+ if test -f new/$fdir/$f && ! check_single_file $fdir/$f; then
+ ret=1
+ if test -z "$check_all"; then
+ break
+ fi
+ fi
+ done
+ return $ret;;
+ *.pyc|*.pyo)
+ perl -e "open fh, '+<', 'old/$file'; seek fh, 3, SEEK_SET; print fh '0000';"
+ perl -e "open fh, '+<', 'new/$file'; seek fh, 3, SEEK_SET; print fh '0000';"
+ ;;
+ *.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 $?
+ ;;
+ *png)
+ # Try to remove timestamps, only if convert from ImageMagick is installed
+ if [[ $(type -p convert) ]]; then
+ convert old/$file +set date:create +set date:modify old/${file/.png/_n.png}
+ convert old/$file +set date:create +set date:modify new/${file/.png/_n.png}
+ if ! cmp -s old/${file/.png/_n.png} new/${file/.png/_n.png}; then
+ echo "$file differs ($ftype)"
+ hexdump -C old/${file/.png/_n.png} > $file1
+ hexdump -C new/${file/.png/_n.png} > $file2
+ diff -u $file1 $file2 | head -n 20
+ return 1
+ fi
+ return 0
+ fi
+ ;;
+ /usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo)
+ for f in old/$file new/$file; do
+ sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," $f
+ done
+ ;;
+ /usr/share/doc/packages/*/*.html|\
+ /usr/share/doc/kde/HTML/*/*/*.html|/usr/share/doc/*/html/*.html)
+ for f in old/$file new/$file; do
+ # texi2html output, e.g. in kvm, indent, qemu
+ sed -i -e "s|^<!-- Created on .*, 20.. by texi2html .\...|<!-- Created on August 7, 2009 by texi2html 1.82|" $f
+ sed -i -e 's|^ *This document was generated by <em>Autobuild</em> on <em>.*, 20..</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html .\...</em></a>.$| This document was generated by <em>Autobuild</em> on <em>August 7, 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.|' $f
+ # doxygen docu, e.g. in libssh and log4c
+ sed -i -e 's|Generated on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] 20[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
+ # Generated on Sat Aug 14 2010 16:49:48 for libssh
+ sed -i -e 's|Generated on ... ... [0-9]* 20[0-9][0-9] [0-9]*:[0-9][0-9]:[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
+ done
+ ;;
+ /usr/share/javadoc/*.html |\
+ /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html)
+ # There are more timestamps in html, so far we handle only some primitive versions.
+ for f in old/$file new/$file; do
+ # Javadoc:
+ sed -i -e "s,^<!-- Generated by javadoc (build [0-9._]*) on ... ... .. ..:..:.. UTC .... -->,^<!-- Generated by javadoc (build 1.6.0_0) on Sun Jul 01 00:00:00 UTC 2000 -->," $f
+ sed -i -e 's|^<!-- Generated by javadoc on ... ... .. ..:..:.. UTC ....-->$|<!-- Generated by javadoc on Sun Jul 01 00:00:00 UTC 2000-->|' $f
+ sed -i -e 's|<META NAME="date" CONTENT="20..-..-..">|<META NAME="date" CONTENT="1970-01-01">|' $f
+ # Gjdoc HtmlDoclet:
+ sed -i -e 's%Generated by Gjdoc HtmlDoclet [0-9,.]*, part of <a href="http://www.gnu.org/software/classpath/cp-tools/" title="" target="_top">GNU Classpath Tools</a>, on .*, 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.%Generated by Gjdoc.%' $f
+ sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\(.*\)GNU Classpath Tools</a>, on [A-Z][a-z]* [0-9]*, 20?? [0-9]*:??:?? \(a|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\1GNU Classpath Tools</a>, on January 1, 2009 0:00:00 a.m. GMT.</p>%' $f
+ sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\(.*GNU Classpath Tools</a>\), on [a-zA-Z]* [0-9][0-9], 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\1,on May 1, 2010 1:11:42 p.m. GMT.</p>%' $f
+ # deprecated-list is randomly ordered, sort it for comparison
+ case $f in
+ */deprecated-list.html)
+ 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
+ sort -o $f $f
+ done
+ ;;
+ /var/adm/perl-modules/*)
+ for f in old/$file new/$file; do
+ sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C<Module>|=head2 Wed Jul 1 00:00:00 2009: C<Module>|' $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
+ done
+ ;;
+ /usr/share/man/man*/*|/usr/lib/texmf/doc/man/*/*)
+ # 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"
+
+ for f in old/$file new/$file; do
+ sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?\(20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]\|[0-9]* [A-Z][a-z]* 20[0-9][0-9]\)"\? |.TH \1 \2 "2000-01-01" |' $f
+ sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?\([0-1][0-9]/[0-9][0-9]/201[0-9]\)"\? |.TH \1 \2 "2000-01-01" |' $f
+ sed -i -e 's|.TH \(.*\) "\?\(20[0-1][0-9]-[0-9][0-9]-[0-9][0-9]\)"\? |.TH \1 "2000-01-01" |' $f
+ # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7"
+ sed -i -e 's|^.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?\([A-Z][a-z]* [0-9][0-9], 20[0-9][0-9]\)"\? |.TH \1 \2 "2000-01-01" |' $f
+ # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+ sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ 20[0-9][0-9]"\? |.TH \1 \2 "2000-01-01" |' $f
+ # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
+ sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?[A-Z][a-z]* 20[0-9][0-9]"\? |.TH \1 \2 "2000-01-01" |' $f
+ # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" ""
+ sed -i -e 's|.TH "\?\([^ "]*\)"\? "\?\([0-9][a-z]*\)"\? "\?[0-9]* [A-Z][a-z]* 20[0-9][0-9]"\? |.TH \1 \2 "2000-01-01" |' $f
+ # generated by docbook xml:
+ #.\" Date: 09/13/2010
+ sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f
+ done
+ ;;
+ *.elc)
+ # emacs lisp files
+ for f in old/$file new/$file; do
+ sed -i -e 's|Compiled by abuild@.* on ... ... .. ..:..:.. 20..$|compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009|' $f
+ done
+ ;;
+ /var/lib/texmf/web2c/*/*fmt |\
+ /var/lib/texmf/web2c/metafont/*.base|\
+ /var/lib/texmf/web2c/metapost/*.mem)
+ # binary dump of TeX and Metafont formats, we can ignore them for good
+ echo "difference in $file ignored."
+ return 0
+ ;;
+ */libtool)
+ for f in old/$file new/$file; do
+ sed -i -e 's|^# Libtool was configured on host [a-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/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
+ for f in old/$file new/$file; do
+ sed -i -e 's%name="id[0-9]*"\([> ]\)%name="id424242"\1%g' $f
+ sed -i -e 's%name="[a-z]*\.id[0-9]*"%name="ftn.id111111"%g' $f
+ sed -i -e 's%\.html#id[0-9]*"\(/\)\?>%.html#id424242"\1>%g' $f
+ sed -i -e 's%href="#\([a-z]*\.\)\?id[0-9]*"\([> ]\)%href="#\1id0000000"\2%g' $f
+ sed -i -e 's%id="\([a-z]*\.\)\?id[0-9]*"\([> ]\)%id="\1id0000000"\2%g' $f
+ done
+ ;;
+ */created.rid)
+ # ruby documentation
+ # file just contains a timestamp and nothing else, so ignore it
+ echo "Ignore $file"
+ return 0
+ ;;
+ */rdoc/files/*.html)
+ # ruby documentation
+ # <td>Mon Sep 20 19:02:43 +0000 2010</td>
+ for f in old/$file new/$file; do
+ sed -i -e 's%<td>[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]</td>%<td>Mon Sep 20 19:02:43 +0000 2010</td>%g' $f
+ done
+ ;;
+ */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
+ ;;
+ /usr/lib/libreoffice/solver/inc/*/deliver.log)
+ # LibreOffice log file
+ echo "Ignore $file"
+ return 0
+ ;;
+ *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
+ for f in "old/$file" "new/$file"; do
+ sed -i \
+ '/obj/,/endobj/{
+ s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g;
+ s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g;
+ s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g;
+ s%<pdf:CreationDate>[^<]*</pdf:CreationDate>%<pdf:CreationDate>XXX</pdf:CreationDate>%g;
+ s%<pdf:ModDate>[^<]*</pdf:ModDate>%<pdf:ModDate>XXX</pdf:ModDate>%g;
+ s%<xap:CreateDate>[^<]*</xap:CreateDate>%<xap:CreateDate>XXX</xap:CreateDate>%g;
+ s%<xap:ModifyDate>[^<]*</xap:ModifyDate>%<xap:ModifyDate>XXX</xap:ModifyDate>%g;
+ s%<xap:MetadataDate>[^<]*</xap:MetadataDate>%<xap:MetadataDate>XXX</xap:MetadataDate>%g;
+ }' "$f"
+ done
+ ;;
+ esac
+
+ ftype=`/usr/bin/file old/$file | cut -d: -f2-`
+ case $ftype in
+ *PE32\ executable*Mono\/\.Net\ assembly*)
+ echo "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
+ echo "$file differs ($ftype)"
+ diff -u ${file1} ${file2}
+ return 1
+ fi
+ else
+ echo "Cannot compare, no monodis installed"
+ return 1
+ fi
+ ;;
+ *ELF*executable*|*ELF*LSB\ shared\ object*)
+ objdump -d --no-show-raw-insn old/$file | filter_disasm > $file1
+ if ! test -s $file1; then
+ # objdump has no idea how to handle it
+ if ! diff_two_files; then
+ ret=1
+ break
+ fi
+ fi
+ sed -i -e "s,old/,," $file1
+ objdump -d --no-show-raw-insn new/$file | filter_disasm > $file2
+ sed -i -e "s,new/,," $file2
+ if ! diff -u $file1 $file2 > $dfile; then
+ echo "$file differs in assembler output"
+ head -n 200 $dfile
+ return 1
+ fi
+ objdump -s old/$file > $file1
+ sed -i -e "s,old/,," $file1
+ objdump -s new/$file > $file2
+ sed -i -e "s,new/,," $file2
+ if ! diff -u $file1 $file2 > $dfile; then
+ echo "$file differs in ELF sections"
+ head -n 200 $dfile
+ else
+ echo "WARNING: no idea about $file"
+ fi
+ return 1
+ ;;
+ *ASCII*|*text*)
+ if ! cmp -s old/$file new/$file; then
+ echo "$file differs ($ftype)"
+ diff -u old/$file new/$file | head -n 200
+ return 1
+ fi
+ ;;
+ *directory)
+ # tar might package directories - ignore them here
+ return 0
+ ;;
+ *)
+ if ! diff_two_files; then
+ return 1
+ fi
+ ;;
+ esac
+ return 0
+}
+
+# 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
+
+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
+
+if [ "$PROC_MOUNTED" -eq "1" ]; then
+ echo "Unmounting proc"
+ umount /proc
+fi
+
+rm $file1 $file2 $dfile
+rm -r $dir
+exit $ret
diff --git a/packaging/same-build-result.sh b/packaging/same-build-result.sh
new file mode 100644
index 0000000..2ed5f3e
--- /dev/null
+++ b/packaging/same-build-result.sh
@@ -0,0 +1,136 @@
+#!/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 <adrian@suse.de>
+# Enhanced by Andreas Jaeger <aj@suse.de>
+#
+# The script decides if the new build differes from the former one,
+# using rpm-check.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%/*}/rpm-check.sh
+SCMPSCRIPT=${0%/*}/srpm-check.sh
+
+check_all=1
+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 $NEWDIRS -name '*.rpm' -and ! -name '*.delta.rpm'
+ 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"
+bash $SCMPSCRIPT "$osrpm" "$nsrpm" || exit 1
+
+# 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.
+OLDRPMS=($(find "$OLDDIR" -type f -name \*rpm -a ! -name \*src.rpm -a ! -name \*.delta.rpm|sort|grep -v -- -32bit-|grep -v -- -64bit-|grep -v -- '-x86-.*\.ia64\.rpm'))
+NEWRPMS=($(find $NEWDIRS -type f -name \*rpm -a ! -name \*src.rpm -a ! -name \*.delta.rpm|sort --field-separator=/ --key=7|grep -v -- -32bit-|grep -v -- -64bit-|grep -v -- '-x86-.*\.ia64\.rpm'))
+
+# Get release from first RPM and keep for rpmlint check
+# Remember to quote the "." for future regexes
+release1=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${OLDRPMS[0]}"|sed -e 's/\./\\./g'`
+release2=`rpm -qp --nodigest --nosignature --qf "%{RELEASE}" "${NEWRPMS[0]}"|sed -e 's/\./\\./g'`
+
+SUCCESS=1
+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
+ bash $CMPSCRIPT "$opac" "$npac" || SUCCESS=0
+ if test $SUCCESS -eq 0 -a -z "$check_all"; then
+ exit 1
+ fi
+done
+
+if [ -n "${NEWRPMS[0]}" ]; then
+ echo additional new package
+ exit 1
+fi
+
+# Compare rpmlint.log files
+OTHERDIR=/home/abuild/rpmbuild/OTHER
+
+if test -e $OLDDIR/rpmlint.log -a -e $OTHERDIR/rpmlint.log; then
+ file1=`mktemp`
+ file2=`mktemp`
+ echo "comparing $OLDDIR/rpmlint.log and $OTHERDIR/rpmlint.log"
+ # Sort the files first since the order of messages is not deterministic
+ # Remove release from files
+ sort -u $OLDDIR/rpmlint.log|sed -e "s,$release1,@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file1
+ sort -u $OTHERDIR/rpmlint.log|sed -e "s,$release2,@RELEASE@,g" -e "s|/tmp/rpmlint\..*spec|.spec|g" > $file2
+ if ! cmp -s $file1 $file2; then
+ echo "rpmlint.log files differ:"
+ diff -u $OLDDIR/rpmlint.log $OTHERDIR/rpmlint.log |head -n 20
+ SUCCESS=0
+ fi
+ rm $file1 $file2
+elif test -e $OTHERDIR/rpmlint.log; then
+ echo "rpmlint.log is new"
+ SUCCESS=0
+fi
+
+appdatas=`cd $OTHERDIR && find . -name *-appdata.xml`
+for xml in $appdatas; do
+ # compare appstream data
+ if test -e $OLDDIR/$xml -a -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
+ SUCCESS=0
+ fi
+ elif test -e $OTHERDIR/$xml; then
+ echo "$xml is new"
+ SUCCESS=0
+ fi
+done
+
+if test $SUCCESS -eq 0; then
+ exit 1
+fi
+echo 'compare validated built as identical !'
+exit 0
diff --git a/packaging/srpm-check.sh b/packaging/srpm-check.sh
new file mode 100644
index 0000000..dafd6ca
--- /dev/null
+++ b/packaging/srpm-check.sh
@@ -0,0 +1,94 @@
+#!/bin/bash
+#
+# Copyright (c) 2009, 2010 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
+
+# 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`
+
+
+# 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_spec $1 $2
+RES=$?
+case $RES in
+ 0)
+ 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`
+unrpm $oldrpm $dir/old
+unrpm $newrpm $dir/new
+cd $dir
+
+check_single_file()
+{
+ local file=$1
+ case $file in
+ *.spec)
+ sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
+ sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
+ if ! cmp -s old/$file new/$file; then
+ echo "$file differs (spec file)"
+ diff -u old/$file new/$file | head -n 20
+ return 1
+ fi
+ return 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 -r $dir
+exit $ret