- Update strip_numbered_anchors to catch more random identifiers

OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=216
This commit is contained in:
Olaf Hering 2016-08-25 14:29:40 +00:00 committed by Git OBS Bridge
parent d0fa46f062
commit eae5358f64
4 changed files with 30 additions and 8 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Aug 25 14:27:34 UTC 2016 - olaf@aepfle.de
- Update strip_numbered_anchors to catch more random identifiers
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Aug 24 13:22:12 UTC 2016 - liezhi.yang@windriver.com Wed Aug 24 13:22:12 UTC 2016 - liezhi.yang@windriver.com

View File

@ -21,7 +21,7 @@ Summary: Build Result Compare Script
License: GPL-2.0+ License: GPL-2.0+
Group: Development/Tools/Building Group: Development/Tools/Building
Url: https://github.com/openSUSE/build-compare Url: https://github.com/openSUSE/build-compare
Version: 20160824T152429.e634aef Version: 20160825T162810.b6dc062
Release: 0 Release: 0
Source1: COPYING Source1: COPYING
Source2: same-build-result.sh Source2: same-build-result.sh

View File

@ -217,8 +217,8 @@ function cmp_spec ()
# are the same. # are the same.
cat $spec_old | trim_release_old > $file1 cat $spec_old | trim_release_old > $file1
cat $spec_new | trim_release_new > $file2 cat $spec_new | trim_release_new > $file2
echo "comparing the whole specfile" echo "comparing the rpm tags of $name_new"
if diff -au $spec_old $spec_new; then if diff -au $file1 $file2; then
if test -z "$check_all"; then if test -z "$check_all"; then
rm $file1 $file2 $spec_old $spec_new rm $file1 $file2 $spec_old $spec_new
return 0 return 0

View File

@ -244,13 +244,30 @@ trim_man_TH()
strip_numbered_anchors() strip_numbered_anchors()
{ {
# Remove numbered anchors on Docbook / HTML files. # Remove numbered anchors on Docbook / HTML files.
# This should be save since we remove them from old and new files. # <a id="idp270624" name=
# A trailing </a> or </div> tag will stay also on both files. # "idp270624"></a>
# <a href="#ftn.id32751" class="footnote" id="id32751">
# <a href="#id32751" class="para">
# <a href="#tex">1 TeX</a>
# <div id="ftn.id43927" class="footnote">
for f in old/$file new/$file; do for f in old/$file new/$file; do
sed -i -e 's%<[ ]*a[ ]\+name[^<]*[0-9]\+[^<]*%%g' \ sed -ie '
-e 's%<[ ]*a[ ]\+href[^<]*#[^<]*[0-9]\+[^<]*%%g' \ 1 {
-e 's%<[^<]*id="ftn\.[^<]*[0-9]\+[^<]*%%g' $f : N
$ {
s@\(<a[[:blank:]]\+id=\n\?"\)\(id[a-z][0-9]\+\)\("[^>]* name=\n\?"\)\(id[a-z][0-9]\+\)\("[^>]*>\)@\1id_idN\3name_idN\5@g
s@\(<a[[:blank:]]\+id="\)\(id[a-z][0-9]\+\)\("[^>]*>\)@\1idN\3@g
s@\(<a[[:blank:]]\+name="\)\(id[a-z][0-9]\+\)\("[^>]*>\)@\1nameN\3@g
s@\(<a[[:blank:]]\+href="#\)\([^"]\+\)\("[^>]\+id="\)\(id[a-z0-9]\+\)\("[^>]*>\)@\1href_anchor\3id_idN\5@g
s@\(<a[[:blank:]]\+href="#\)\([^"]\+\)\("[^>]*>\)@\1href_anchor\3@g
s@\(<div[[:blank:]]\+id="\)\(ftn\.[a-z]\+[0-9]\+\)\("[^>]*>\)@\1ftn.N\3@g
}
N
b N
}' $f &
done done
wait
} }