- Trim "PROVIDES" from source rpms (#59, bsc#1205998)
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=300
This commit is contained in:
parent
d3bb2bf8b1
commit
4602b28d81
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Nov 25 23:51:35 UTC 2022 - Stefan Brüns <stefan.bruens@rwth-aachen.de>
|
||||||
|
|
||||||
|
- Trim "PROVIDES" from source rpms (#59, bsc#1205998)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Sep 19 08:02:40 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
Mon Sep 19 08:02:40 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: build-compare
|
Name: build-compare
|
||||||
Version: 20220926T095347.40c240f
|
Version: 20221206T204012.bb70754
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Build Result Compare Script
|
Summary: Build Result Compare Script
|
||||||
License: GPL-2.0-or-later
|
License: GPL-2.0-or-later
|
||||||
|
22
functions.sh
22
functions.sh
@ -122,6 +122,8 @@ QF_FILELIST="[%{FILENAMES} %{FILEFLAGS} %{FILESTATES} %{FILEMODES:octal} %{FILEU
|
|||||||
|
|
||||||
QF_CHECKSUM="[%{FILENAMES} %{FILEMD5S} %{FILEFLAGS}\n]\\n"
|
QF_CHECKSUM="[%{FILENAMES} %{FILEMD5S} %{FILEFLAGS}\n]\\n"
|
||||||
|
|
||||||
|
QF_SOURCERPM="%{SOURCERPM}\\n"
|
||||||
|
|
||||||
QF_ALL="\n___QF_NAME___\n${QF_NAME}\n___QF_NAME___\n"
|
QF_ALL="\n___QF_NAME___\n${QF_NAME}\n___QF_NAME___\n"
|
||||||
QF_ALL="$QF_ALL\n___QF_TAGS___\n${QF_TAGS}\n___QF_TAGS___\n"
|
QF_ALL="$QF_ALL\n___QF_TAGS___\n${QF_TAGS}\n___QF_TAGS___\n"
|
||||||
QF_ALL="$QF_ALL\n___QF_VER_REL___\n${QF_VER_REL}\n___QF_VER_REL___\n"
|
QF_ALL="$QF_ALL\n___QF_VER_REL___\n${QF_VER_REL}\n___QF_VER_REL___\n"
|
||||||
@ -130,6 +132,7 @@ QF_ALL="$QF_ALL\n___QF_PROVIDES___\n${QF_PROVIDES}\n___QF_PROVIDES___\n"
|
|||||||
QF_ALL="$QF_ALL\n___QF_SCRIPT___\n${QF_SCRIPT}\n___QF_SCRIPT___\n"
|
QF_ALL="$QF_ALL\n___QF_SCRIPT___\n${QF_SCRIPT}\n___QF_SCRIPT___\n"
|
||||||
QF_ALL="$QF_ALL\n___QF_FILELIST___\n${QF_FILELIST}\n___QF_FILELIST___\n"
|
QF_ALL="$QF_ALL\n___QF_FILELIST___\n${QF_FILELIST}\n___QF_FILELIST___\n"
|
||||||
QF_ALL="$QF_ALL\n___QF_CHECKSUM___\n${QF_CHECKSUM}\n___QF_CHECKSUM___\n"
|
QF_ALL="$QF_ALL\n___QF_CHECKSUM___\n${QF_CHECKSUM}\n___QF_CHECKSUM___\n"
|
||||||
|
QF_ALL="$QF_ALL\n___QF_SOURCERPM___\n${QF_SOURCERPM}\n___QF_SOURCERPM___\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_header()
|
check_header()
|
||||||
@ -286,6 +289,17 @@ function set_regex() {
|
|||||||
name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.}
|
name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Trim a block starting with a keyword and ending with an empty line
|
||||||
|
# $1: enable
|
||||||
|
# $2: keyword
|
||||||
|
function trim_section() {
|
||||||
|
if test "${1}" -gt 0 ; then
|
||||||
|
sed -e "/^${2}$/,/^$/d"
|
||||||
|
else
|
||||||
|
cat
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Compare just the rpm meta data of two rpms
|
# Compare just the rpm meta data of two rpms
|
||||||
# Returns:
|
# Returns:
|
||||||
# 0 in case of same content
|
# 0 in case of same content
|
||||||
@ -365,8 +379,12 @@ function cmp_rpm_meta ()
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
get_value QF_PROVIDES $rpm_meta_old | trim_release_old | sort > $file1
|
# Built packages provide the sourcerpm, for the sourcerpm itself it is "(none)"
|
||||||
get_value QF_PROVIDES $rpm_meta_new | trim_release_new | sort > $file2
|
[ "x$(get_value QF_SOURCERPM $rpm_meta_new)" == "x(none)" ] && is_sourcerpm=1 || is_sourcerpm=0
|
||||||
|
|
||||||
|
# FIXME: PROVIDE needs to be handled independent from the other tags
|
||||||
|
get_value QF_PROVIDES $rpm_meta_old | trim_section ${is_sourcerpm} 'PROVIDE' | trim_release_old | sort > $file1
|
||||||
|
get_value QF_PROVIDES $rpm_meta_new | trim_section ${is_sourcerpm} 'PROVIDE' | trim_release_new | sort > $file2
|
||||||
if ! comp_file PROVIDES $file1 $file2 $rpm_meta_old $rpm_meta_new; then
|
if ! comp_file PROVIDES $file1 $file2 $rpm_meta_old $rpm_meta_new; then
|
||||||
rm -rf "$tmpdir"
|
rm -rf "$tmpdir"
|
||||||
return 1
|
return 1
|
||||||
|
@ -95,7 +95,7 @@ if test ! -f "$nsrpm"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "compare $osrpm $nsrpm"
|
echo "compare $osrpm $nsrpm"
|
||||||
if bash $SCMPSCRIPT "$osrpm" "$nsrpm"
|
if bash $SCMPSCRIPT $check_all "$osrpm" "$nsrpm"
|
||||||
then
|
then
|
||||||
: src.rpm identical
|
: src.rpm identical
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user