Hello community,

here is the log from the commit of package build-compare for openSUSE:Factory 
checked in at 2020-06-11 14:41:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/build-compare (Old)
 and      /work/SRC/openSUSE:Factory/.build-compare.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "build-compare"

Thu Jun 11 14:41:50 2020 rev:116 rq:811920 version:20200529T212652.102d844

Changes:
--------
--- /work/SRC/openSUSE:Factory/build-compare/build-compare.changes      
2020-05-16 22:23:29.544923175 +0200
+++ /work/SRC/openSUSE:Factory/.build-compare.new.3606/build-compare.changes    
2020-06-11 14:42:17.436909242 +0200
@@ -1,0 +2,12 @@
+Fri May 29 19:20:21 UTC 2020 - o...@aepfle.de
+
+- Remove usage of readarray to remain compatible with bash3
+
+-------------------------------------------------------------------
+Fri May 29 07:30:51 UTC 2020 - o...@aepfle.de
+
+- Colltect a list of known rpm tags and use it to build the
+  queryformat string for the tags listed below (bsc#1172232)
+  conflict obsolete oldsuggests provide recommend require suggest supplement
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ build-compare.spec ++++++
--- /var/tmp/diff_new_pack.5yI9FF/_old  2020-06-11 14:42:19.120915729 +0200
+++ /var/tmp/diff_new_pack.5yI9FF/_new  2020-06-11 14:42:19.120915729 +0200
@@ -21,7 +21,7 @@
 License:        GPL-2.0+
 Group:          Development/Tools/Building
 Url:            https://github.com/openSUSE/build-compare
-Version:        20200514T095116.be3487c
+Version:        20200529T212652.102d844
 Release:        0
 Source1:        COPYING
 Source2:        same-build-result.sh

++++++ functions.sh ++++++
--- /var/tmp/diff_new_pack.5yI9FF/_old  2020-06-11 14:42:19.172915930 +0200
+++ /var/tmp/diff_new_pack.5yI9FF/_new  2020-06-11 14:42:19.172915930 +0200
@@ -10,36 +10,59 @@
 
 RPM="rpm -qp --nodigest --nosignature"
 
+declare -a rpm_querytags
+collect_rpm_querytags() {
+  rpm_querytags=( $(rpm --querytags) )
+}
+# returns 0 if tag is known, returns 1 if unknown
+rpmtag_known() {
+  local needle="\<${1}\>"
+  local haystack="${rpm_querytags[@]}"
+  [[ "${haystack}" =~ ${needle} ]]
+  return $?
+}
+
 set_rpm_meta_global_variables() {
 
   local pkg=$1
   local rpm_tags=
   local out=`mktemp`
+  local t v qt
+  local -a type variant list
 
 # Name, Version, Release
 QF_NAME="%{NAME}"
 QF_VER_REL="%{VERSION}-%{RELEASE}"
 QF_NAME_VER_REL="%{NAME}-%{VERSION}-%{RELEASE}"
 
-# provides destroy this because at least the self-provide includes the
-# -buildnumber :-(
-QF_PROVIDES="[%{PROVIDENAME} %{PROVIDEFLAGS} %{PROVIDEVERSION}\\n]\\n"
-QF_PROVIDES="${QF_PROVIDES}[%{REQUIRENAME} %{REQUIREFLAGS} 
%{REQUIREVERSION}\\n]\\n"
-QF_PROVIDES="${QF_PROVIDES}[%{CONFLICTNAME} %{CONFLICTFLAGS} 
%{CONFLICTVERSION}\\n]\\n"
-QF_PROVIDES="${QF_PROVIDES}[%{OBSOLETENAME} %{OBSOLETEFLAGS} 
%{OBSOLETEVERSION}\\n]\\n"
-
-rpm_tags="%{RECOMMENDNAME} %{RECOMMENDFLAGS} %{RECOMMENDVERSION}"
-check_header "%{NAME} ${rpm_tags}" > "${out}"
-if test -s "${out}"
-then
-  QF_PROVIDES="${QF_PROVIDES}[${rpm_tags}\\n]\\n"
-fi
-rpm_tags="%{SUPPLEMENTNAME} %{SUPPLEMENTFLAGS} %{SUPPLEMENTVERSION}"
-check_header "%{NAME} ${rpm_tags}" > "${out}"
-if test -s "${out}"
-then
-  QF_PROVIDES="${QF_PROVIDES}[${rpm_tags}\\n]\\n"
-fi
+QF_PROVIDES=
+type=(
+  CONFLICT
+  OBSOLETE
+  OLDSUGGESTS
+  PROVIDE
+  RECOMMEND
+  REQUIRE
+  SUGGEST
+  SUPPLEMENT
+)
+variant=(
+  NAME
+  FLAGS
+  VERSION
+)
+for t in "${type[@]}"
+do
+  unset list
+  list=()
+  for v in "${variant[@]}"
+  do
+    qt="${t}${v}"
+    rpmtag_known "${qt}" || continue
+    list+=("%{${qt}}")
+  done
+  QF_PROVIDES+="${t}\\n[${list[@]}\\n]\\n"
+done
 
 # don't look at RELEASE, it contains our build number
 QF_TAGS="%{NAME} %{VERSION} %{EPOCH}\\n"
@@ -54,24 +77,36 @@
 # 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_TAGS="${QF_TAGS}[%{VERIFYSCRIPTPROG} %{VERIFYSCRIPT}]\\n"
 # Only the first ChangeLog entry; should be enough
 QF_TAGS="${QF_TAGS}%{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n"
 
 # scripts, might contain release number
-script_types='
-PRETRANS
-PREIN
-POSTIN
-PREUN
-POSTUN
-POSTTRANS
-VERIFYSCRIPT
-'
 QF_SCRIPT=
-for script_type in ${script_types}
+type=(
+  PRETRANS
+  PREIN
+  POSTIN
+  PREUN
+  POSTUN
+  POSTTRANS
+  VERIFYSCRIPT
+)
+variant=(
+  PROG
+  FLAGS
+  ''
+)
+for t in "${type[@]}"
 do
-  QF_SCRIPT="${QF_SCRIPT}[%{${script_type}PROG} %{${script_type}FLAGS} 
%{${script_type}}\\n]\\n"
+  unset list
+  list=()
+  for v in "${variant[@]}"
+  do
+    qt="${t}${v}"
+    rpmtag_known "${qt}" || continue
+    list+=("%{${qt}}")
+  done
+  QF_SCRIPT+="${t}\\n[${list[@]}\\n]\\n"
 done
 
 # Now the files. We leave out mtime and size.  For normal files
@@ -241,7 +276,7 @@
 # 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
+# Sets ${files[@]} array with list of files that need further investigation
 function cmp_rpm_meta ()
 {
     local RES
@@ -256,6 +291,7 @@
     rpm_meta_old=`mktemp`
     rpm_meta_new=`mktemp`
 
+    collect_rpm_querytags
     set_rpm_meta_global_variables $oldrpm
 
     check_header "$QF_ALL" $oldrpm > $rpm_meta_old
@@ -330,14 +366,19 @@
     get_value QF_CHECKSUM $rpm_meta_new | grep -v " 64$" | trim_release_new > 
$file2
     RES=2
     # done if the same
+    files=()
     echo "comparing file checksum"
     if cmp -s $file1 $file2; then
       RES=0
+    else
+      # Get only files with different MD5sums
+      while read
+      do
+        : "${REPLY}"
+        files+=( "${REPLY}" )
+      done < <(diff -U0 $file1 $file2 | sed -E -n -e '/^-\//{s/^-//;s/ 
[0-9a-f]+ [0-9]+$//;p}')
     fi
 
-    # Get only files with different MD5sums
-    files=`diff -U0 $file1 $file2 | fgrep -v +++ | grep ^+ | cut -b2- | sed -E 
-e 's/ [0-9a-f]+ [0-9]+$//'`
-
     if test -n "$sh"; then
       echo "creating rename script"
       # Create a temporary helper script to rename files/dirs with release in 
it

++++++ pkg-diff.sh ++++++
--- /var/tmp/diff_new_pack.5yI9FF/_old  2020-06-11 14:42:19.184915976 +0200
+++ /var/tmp/diff_new_pack.5yI9FF/_new  2020-06-11 14:42:19.184915976 +0200
@@ -761,6 +761,7 @@
   local f
   local -a content
   local -i ret=1
+  local -a filelist
 
   "${handler}" 'f' "${file}" || return 1
 
@@ -783,8 +784,12 @@
         "${handler}" 'x' "${new}" || return 1
         popd > /dev/null
       fi
-      readarray -t content < 'cn'
-      for f in "${content[@]}"
+      while read
+      do
+        : "${REPLY}"
+        filelist+=( "${REPLY}" )
+      done < 'cn'
+      for f in "${filelist[@]}"
       do
         if ! check_single_file "${file}/${f}"
         then
@@ -1157,6 +1162,10 @@
 echo "Comparing `basename $oldpkg` to `basename $newpkg`"
 
 case $oldpkg in
+  *.deb|*.ipk)
+    : cmp_deb_meta missing
+    RES=0
+  ;;
   *.rpm)
     cmp_rpm_meta "$rename_script" "$oldpkg" "$newpkg"
     RES=$?
@@ -1192,18 +1201,15 @@
 case $oldpkg in
   *.deb|*.ipk)
     adjust_controlfile $dir/old $dir/new
+    files=()
+    while read
+    do
+      : "${REPLY}"
+      files+=( "${REPLY}" )
+    done < <(cd ${dir} ; find old new -type f | sed -e 's/^...//' | sort -u)
   ;;
 esac
 
-# files is set in cmp_rpm_meta for rpms, so if RES is empty we should assume
-# it wasn't an rpm and pick all files for comparison.
-if [ -z $RES ]; then
-  oldfiles=`cd $dir/old; find . -type f`
-  newfiles=`cd $dir/new; find . -type f`
-
-  files=`echo -e "$oldfiles\n$newfiles" | sort -u`
-fi
-
 cd $dir
 bash $rename_script
 
@@ -1218,8 +1224,7 @@
 
 # preserve cmp_rpm_meta result for check_all runs
 ret=$RES
-readarray -t filesarray <<<"$files"
-for file in "${filesarray[@]}"; do
+for file in "${files[@]}"; do
    if ! check_single_file "$file"; then
        ret=1
        if test -z "$check_all"; then

++++++ srpm-check.sh ++++++
--- /var/tmp/diff_new_pack.5yI9FF/_old  2020-06-11 14:42:19.200916037 +0200
+++ /var/tmp/diff_new_pack.5yI9FF/_new  2020-06-11 14:42:19.204916052 +0200
@@ -87,7 +87,7 @@
 }
 
 ret=0
-for file in $files; do
+for file in "${files[@]}"; do
    if ! check_single_file $file; then
        ret=1
        if test -z "$check_all"; then


Reply via email to