Upgrade build-compare to version 2014.11.25 90/32390/2 accepted/tizen/common/20150317.155144 submit/tizen_common/20150317.150924
authorEd Bartosh <eduard.bartosh@intel.com>
Wed, 17 Dec 2014 14:35:54 +0000 (16:35 +0200)
committerPhilippe Coval <philippe.coval@open.eurogiciel.org>
Wed, 17 Dec 2014 15:06:11 +0000 (07:06 -0800)
This fix can potentially fix build issue in Tizen OBS.

Change-Id: I93584be5becccbf38da5ae92a872ffa0fee405d0
Bug-Tizen: TINF-751/related
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
packaging/build-compare.changes
packaging/build-compare.spec
packaging/functions.sh
packaging/rpm-check.sh
packaging/same-build-result.sh
packaging/srpm-check.sh

index 233485d..c77a04f 100644 (file)
@@ -1,4 +1,46 @@
 -------------------------------------------------------------------
+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.
@@ -305,7 +347,7 @@ Mon May 10 09:13:38 UTC 2010 - aj@suse.de
 -------------------------------------------------------------------
 Sat May  8 19:41:30 UTC 2010 - aj@suse.de
 
-- Fix typo in last change - thanks Dirk Müller.
+- Fix typo in last change - thanks Dirk MГјller.
 
 -------------------------------------------------------------------
 Fri May  7 13:05:57 UTC 2010 - aj@suse.de
index 7aa6d6a..d17365c 100644 (file)
@@ -1,7 +1,7 @@
 #
 # spec file for package build-compare
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 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
@@ -20,7 +20,7 @@ Name:           build-compare
 Summary:        Build Result Compare Script
 License:        GPL-2.0+
 Group:          Development/Tools/Building
-Version:        2012.01.26
+Version:        2014.11.25
 Release:        0
 Source1:        COPYING
 Source2:        same-build-result.sh
@@ -37,8 +37,7 @@ to a former build.
 
 
 %prep
-mkdir $RPM_BUILD_DIR/%name-%version
-%setup -T 0 -D
+%setup -q -c -T
 cp %{SOURCE1001} .
 
 %build
index c8047ab..ba2a797 100644 (file)
@@ -15,16 +15,38 @@ check_header()
    $RPM --qf "$QF" "$1"
 }
 
-function check_provides()
+# Trim 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
+function trim_release_old()
+{
+  sed -e "/\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$release_old\$\)/{s,-$release_old_regex_l,-@RELEASE_LONG@,g;s,-$release_old_regex_s,-@RELEASE_SHORT@,g}"
+}
+function trim_release_new()
+{
+  sed -e "/\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$release_new\$\)/{s,-$release_new_regex_l,-@RELEASE_LONG@,g;s,-$release_new_regex_s,-@RELEASE_SHORT@,g}"
+}
+# Get single directory or filename with long or short release string
+function grep_release_old()
 {
+  grep -E "(/boot|/lib/modules|/lib/firmware|/usr/src)/[^/]+(-${release_old_regex_l}(\$|[^/]+\$)|-${release_old_regex_s}(\$|[^/]+\$))"
+}
+function grep_release_new()
+{
+  grep -E "(/boot|/lib/modules|/lib/firmware|/usr/src)/[^/]+(-${release_new_regex_l}(\$|[^/]+\$)|-${release_new_regex_s}(\$|[^/]+\$))"
+}
 
+function check_provides()
+{
+  local pkg=$1
   # 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@,"
+  check_header "$pkg"
 }
 
 #usage unrpm <file> $dir
@@ -51,6 +73,11 @@ function unrpm()
 # Sets $files with list of files that need further investigation
 function cmp_spec ()
 {
+    local RES
+    local file1 file2
+    local f
+    local sh=$1
+
     QF="%{NAME}"
     
     # don't look at RELEASE, it contains our build number
@@ -81,36 +108,63 @@ function cmp_spec ()
     
     # the DISTURL tag can be used as checkin ID
     #echo "$QF"
+    echo "comparing rpmtags"
     if ! diff -au $file1 $file2; then
-      rm $file1 $file2
-      return 1
+      if test -z "$check_all"; then
+        rm $file1 $file2
+        return 1
+      fi
     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
+    release_old=$($RPM --qf "%{RELEASE}" "$oldrpm")
+    release_new=$($RPM --qf "%{RELEASE}" "$newrpm")
+    # Short version without B_CNT
+    release_old_regex_s=${release_old%.*}
+    release_old_regex_s=${release_old_regex_s//./\\.}
+    release_new_regex_s=${release_new%.*}
+    release_new_regex_s=${release_new_regex_s//./\\.}
+    # Long version with B_CNT
+    release_old_regex_l=${release_old//./\\.}
+    release_new_regex_l=${release_new//./\\.}
+    # This might happen when?!
+    echo "comparing RELEASE"
+    if [ "${release_old%.*}" != "${release_new%.*}" ] ; then
+      case $($RPM --qf '%{NAME}' "$newrpm") in
+        kernel-*)
+          # Make sure all kernel packages have the same %RELEASE
+          echo "release prefix mismatch"
+          if test -z "$check_all"; then
+            return 1
+          fi
+          ;;
+        # Every other package is allowed to have a different RELEASE
+        *) ;;
+      esac
     fi
     
-    check_provides $oldrpm $release1 > $file1
-    check_provides $newrpm $release2 > $file2
+    check_provides $oldrpm | trim_release_old | sort > $file1
+    check_provides $newrpm | trim_release_new | sort > $file2
     
+    echo "comparing PROVIDES"
     if ! diff -au $file1 $file2; then
-      rm $file1 $file2
-      return 1
+      if test -z "$check_all"; then
+        rm $file1 $file2
+        return 1
+      fi
     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
+    check_header $oldrpm | trim_release_old > $file1
+    check_header $newrpm | trim_release_new > $file2
 
+    echo "comparing scripts"
     if ! diff -au $file1 $file2; then
-      rm $file1 $file2
-      return 1
+      if test -z "$check_all"; then
+        rm $file1 $file2
+        return 1
+      fi
     fi
     
     # First check the file attributes and later the md5s
@@ -125,23 +179,28 @@ function cmp_spec ()
     # 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 | trim_release_old > $file1
+    check_header $newrpm | trim_release_new > $file2
     
-    check_header $oldrpm > $file1
-    check_header $newrpm > $file2
-    
+    echo "comparing filelist"
     if ! diff -au $file1 $file2; then
-      rm $file1 $file2
-      return 1
+      if test -z "$check_all"; then
+        rm $file1 $file2
+        return 1
+      fi
     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
+    # file flag 64 means "ghost", filter those out.
+    QF="[%{FILENAMES} %{FILEMD5S} %{FILEFLAGS}\n]\\n"
+    check_header $oldrpm |grep -v " 64$"| trim_release_old > $file1
+    check_header $newrpm |grep -v " 64$"| trim_release_new > $file2
     
     RES=2
     # done if the same
+    echo "comparing file checksum"
     if cmp -s $file1 $file2; then
       RES=0
     fi
@@ -149,6 +208,20 @@ function cmp_spec ()
     # Get only files with different MD5sums
     files=`diff -U0 $file1 $file2 | fgrep -v +++ | grep ^+ | cut -b2- | awk '{print $1}'`
 
+    if test -f "$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 $file1 $file2
     return $RES
 }
index 5c6fcb7..cb63397 100644 (file)
@@ -24,6 +24,7 @@ source $FUNCTIONS
 
 oldrpm=`readlink -f $1`
 newrpm=`readlink -f $2`
+rename_script=`mktemp`
 
 if test ! -f $oldrpm; then
     echo "can't open $oldrpm"
@@ -96,17 +97,24 @@ 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
+cmp_spec $rename_script
 RES=$?
 case $RES in
   0)
-     exit 0
+     echo "RPM meta information is identical"
+     if test -z "$check_all"; then
+        exit 0
+     fi
      ;;
   1)
      echo "RPM meta information is different"
-     exit 1
+     if test -z "$check_all"; then
+        exit 1
+     fi
      ;;
   2)
+     echo "RPM file checksum differs."
+     RES=0
      ;;
   *)
      echo "Wrong exit code!"
@@ -118,9 +126,11 @@ file1=`mktemp`
 file2=`mktemp`
 
 dir=`mktemp -d`
+echo "Extracting packages"
 unrpm $oldrpm $dir/old
 unrpm $newrpm $dir/new
 cd $dir
+bash $rename_script
 
 dfile=`mktemp`
 
@@ -136,8 +146,87 @@ diff_two_files()
   return 0
 }
 
+
+strip_numbered_anchors()
+{
+  # Remove numbered anchors on Docbook / HTML files.
+  # This should be save since we remove them from old and new files.
+  # A trailing </a> or </div> tag will stay also on both files.
+  for f in old/$file new/$file; do
+     sed -i -e 's%<[ ]*a[ ]\+name[^<]*[0-9]\+[^<]*%%g' \
+     -e 's%<[ ]*a[ ]\+href[^<]*#[^<]*[0-9]\+[^<]*%%g' \
+     -e 's%<[^<]*id="ftn\.[^<]*[0-9]\+[^<]*%%g' $f
+  done
+}
+
+
+check_compressed_file()
+{
+  local file=$1
+  local ext=$2
+  local tmpdir=`mktemp -d`
+  local ftype
+  local ret=0
+  echo "$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
+          ;;
+        gzip)
+          mv old/$file{,.gz}
+          mv new/$file{,.gz}
+          gzip -d old/$file.gz
+          gzip -d new/$file.gz
+          ;;
+        xz)
+          mv old/$file{,.xz}
+          mv new/$file{,.xz}
+          xz -d old/$file.xz
+          xz -d new/$file.xz
+          ;;
+      esac
+      ftype=`/usr/bin/file old/$file | cut -d: -f2-`
+      case $ftype in
+        *POSIX\ tar\ archive)
+          echo "$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\ *)
+          echo "$ext content is: $ftype"
+          mv old/$file{,.cpio}
+          mv new/$file{,.cpio}
+          if ! check_single_file ${file}.cpio; then
+            ret=1
+          fi
+          ;;
+        *)
+          echo "unhandled $ext content: $ftype"
+          if ! diff_two_files; then
+            ret=1
+          fi
+          ;;
+      esac
+      popd > /dev/null
+    fi
+    rm -rf "$tmpdir"
+  fi
+  return $ret
+}
+
 check_single_file()
-{ 
+{
   local file="$1"
   case $file in
     *.spec)
@@ -165,6 +254,26 @@ check_single_file()
        done
        return 0
        ;;
+    *.cpio)
+       flist=`cpio --quiet --list --force-local < "new/$file"`
+       pwd=$PWD
+       fdir=`dirname $file`
+       cd old/$fdir
+       cpio --quiet --extract --force-local < "${file##*/}"
+       cd $pwd/new/$fdir
+       cpio --quiet --extract --force-local < "${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
+       ;;
     *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
        flist=`tar tf new/$file`
        pwd=$PWD
@@ -267,9 +376,11 @@ check_single_file()
         # 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
+       strip_numbered_anchors
        ;;
      /usr/share/javadoc/*.html |\
      /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html)
+       strip_numbered_anchors
        # There are more timestamps in html, so far we handle only some primitive versions.
        for f in old/$file new/$file; do
          # Javadoc:
@@ -283,7 +394,7 @@ check_single_file()
         # deprecated-list is randomly ordered, sort it for comparison
         case $f in
           */deprecated-list.html)
-            sort -o $f $f 
+            sort -o $f $f
             ;;
         esac
        done
@@ -369,13 +480,7 @@ check_single_file()
      /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
+       strip_numbered_anchors
        ;;
     */created.rid)
        # ruby documentation
@@ -389,6 +494,7 @@ check_single_file()
        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
+       strip_numbered_anchors
        ;;
     */Linux*Env.Set.sh)
        # LibreOffice files, contains:
@@ -402,6 +508,21 @@ check_single_file()
       echo "Ignore $file"
       return 0
       ;;
+    /var/adm/update-messages/*|/var/adm/update-scripts/*)
+      # encode version-release inside
+      oldfn=`echo "$file"|sed -e s/-$release2/-$release1/;`
+
+      # fetchmsttfonts embeds the release number in the update shell script.
+      echo sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
+      sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
+
+      if ! diff -u old/$oldfn new/$file; then
+           echo "$oldfn is not same as $file"
+           return 1
+      fi
+      echo "$file and $oldfn are same"
+      return 0
+      ;;
     *pdf)
       # PDF files contain a unique ID, remove it
       # Format of the ID is:
@@ -443,7 +564,7 @@ check_single_file()
          return 1
        fi
        ;;
-    *ELF*executable*|*ELF*LSB\ shared\ object*)
+    *ELF*executable*|*ELF*[LM]SB\ 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
@@ -460,15 +581,20 @@ check_single_file()
           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
+       echo "" >$file1
+       echo "" >$file2
+       # Don't compare .build-id and .gnu_debuglink sections
+       sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
+       for section in $sections; do
+          objdump -s -j $section old/$file | sed "s,old/,," >> $file1
+          objdump -s -j $section new/$file | sed "s,new/,," >> $file2
+       done
        if ! diff -u $file1 $file2 > $dfile; then
           echo "$file differs in ELF sections"
           head -n 200 $dfile
        else
-          echo "WARNING: no idea about $file"
+          echo "$file: only difference was in build-id or gnu_debuglink, GOOD."
+          return 0
        fi
        return 1
        ;;
@@ -483,6 +609,29 @@ check_single_file()
        # 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
+       ;;
+     *symbolic\ link\ to\ *)
+       readlink "old/$file" > $file1
+       readlink "new/$file" > $file2
+       if ! diff -u $file1 $file2; then
+         echo "symlink target for $file differs"
+         return 1
+       fi
+       ;;
      *)
        if ! diff_two_files; then
            return 1
@@ -501,7 +650,8 @@ if [ ! -d /proc/self/ ]; then
   PROC_MOUNTED=1
 fi
 
-ret=0
+# preserve cmp_spec result for check_all runs
+ret=$RES
 for file in $files; do
    if ! check_single_file $file; then
        ret=1
@@ -516,6 +666,9 @@ if [ "$PROC_MOUNTED" -eq "1" ]; then
   umount /proc
 fi
 
-rm $file1 $file2 $dfile
+rm $file1 $file2 $dfile $rename_script
 rm -r $dir
+if test "$ret" = 0; then
+     echo "RPM content is identical"
+fi
 exit $ret
index 2ed5f3e..c714158 100644 (file)
@@ -64,8 +64,8 @@ NEWRPMS=($(find $NEWDIRS -type f -name \*rpm -a ! -name \*src.rpm -a ! -name \*.
 
 # 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'`
+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 '
@@ -79,10 +79,17 @@ for opac in ${OLDRPMS[*]}; do
      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
+  case "$opac" in
+    *debuginfo*)
+     echo "skipping -debuginfo package"
+    ;;
+    *)
+     bash $CMPSCRIPT "$opac" "$npac" || SUCCESS=0
+     if test $SUCCESS -eq 0 -a -z "$check_all"; then
+        exit 1
+     fi
+    ;;
+  esac
 done
 
 if [ -n "${NEWRPMS[0]}" ]; then
@@ -103,7 +110,7 @@ if test -e $OLDDIR/rpmlint.log -a -e $OTHERDIR/rpmlint.log; then
   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
+    diff -u $file1 $file2 |head -n 20
     SUCCESS=0
   fi
   rm $file1 $file2
index dafd6ca..8ed01ad 100644 (file)
@@ -32,7 +32,7 @@ newrpm=`readlink -f $2`
 # if those are not the same, the source RPM has changed and therefore 
 # the resulting files are needed.
 
-cmp_spec $1 $2
+cmp_spec
 RES=$?
 case $RES in
   0)