- 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 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=274
This commit is contained in:
parent
c91e308f66
commit
4099e8f1e8
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri May 29 07:30:51 UTC 2020 - olaf@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
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu May 14 07:07:07 UTC 2020 - olaf@aepfle.de
|
Thu May 14 07:07:07 UTC 2020 - olaf@aepfle.de
|
||||||
|
|
||||||
|
@ -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: 20200514T095116.be3487c
|
Version: 20200529T095124.68a99b1
|
||||||
Release: 0
|
Release: 0
|
||||||
Source1: COPYING
|
Source1: COPYING
|
||||||
Source2: same-build-result.sh
|
Source2: same-build-result.sh
|
||||||
|
95
functions.sh
95
functions.sh
@ -10,36 +10,56 @@
|
|||||||
|
|
||||||
RPM="rpm -qp --nodigest --nosignature"
|
RPM="rpm -qp --nodigest --nosignature"
|
||||||
|
|
||||||
|
declare -A rpm_querytags
|
||||||
|
collect_rpm_querytags() {
|
||||||
|
while read
|
||||||
|
do
|
||||||
|
: ${REPLY}
|
||||||
|
rpm_querytags[${REPLY}]=Y
|
||||||
|
done < <(rpm --querytags)
|
||||||
|
}
|
||||||
|
|
||||||
set_rpm_meta_global_variables() {
|
set_rpm_meta_global_variables() {
|
||||||
|
|
||||||
local pkg=$1
|
local pkg=$1
|
||||||
local rpm_tags=
|
local rpm_tags=
|
||||||
local out=`mktemp`
|
local out=`mktemp`
|
||||||
|
local t v qt
|
||||||
|
local -a type variant list
|
||||||
|
|
||||||
# Name, Version, Release
|
# Name, Version, Release
|
||||||
QF_NAME="%{NAME}"
|
QF_NAME="%{NAME}"
|
||||||
QF_VER_REL="%{VERSION}-%{RELEASE}"
|
QF_VER_REL="%{VERSION}-%{RELEASE}"
|
||||||
QF_NAME_VER_REL="%{NAME}-%{VERSION}-%{RELEASE}"
|
QF_NAME_VER_REL="%{NAME}-%{VERSION}-%{RELEASE}"
|
||||||
|
|
||||||
# provides destroy this because at least the self-provide includes the
|
QF_PROVIDES=
|
||||||
# -buildnumber :-(
|
type=(
|
||||||
QF_PROVIDES="[%{PROVIDENAME} %{PROVIDEFLAGS} %{PROVIDEVERSION}\\n]\\n"
|
CONFLICT
|
||||||
QF_PROVIDES="${QF_PROVIDES}[%{REQUIRENAME} %{REQUIREFLAGS} %{REQUIREVERSION}\\n]\\n"
|
OBSOLETE
|
||||||
QF_PROVIDES="${QF_PROVIDES}[%{CONFLICTNAME} %{CONFLICTFLAGS} %{CONFLICTVERSION}\\n]\\n"
|
OLDSUGGESTS
|
||||||
QF_PROVIDES="${QF_PROVIDES}[%{OBSOLETENAME} %{OBSOLETEFLAGS} %{OBSOLETEVERSION}\\n]\\n"
|
PROVIDE
|
||||||
|
RECOMMEND
|
||||||
rpm_tags="%{RECOMMENDNAME} %{RECOMMENDFLAGS} %{RECOMMENDVERSION}"
|
REQUIRE
|
||||||
check_header "%{NAME} ${rpm_tags}" > "${out}"
|
SUGGEST
|
||||||
if test -s "${out}"
|
SUPPLEMENT
|
||||||
then
|
)
|
||||||
QF_PROVIDES="${QF_PROVIDES}[${rpm_tags}\\n]\\n"
|
variant=(
|
||||||
fi
|
NAME
|
||||||
rpm_tags="%{SUPPLEMENTNAME} %{SUPPLEMENTFLAGS} %{SUPPLEMENTVERSION}"
|
FLAGS
|
||||||
check_header "%{NAME} ${rpm_tags}" > "${out}"
|
VERSION
|
||||||
if test -s "${out}"
|
)
|
||||||
then
|
for t in "${type[@]}"
|
||||||
QF_PROVIDES="${QF_PROVIDES}[${rpm_tags}\\n]\\n"
|
do
|
||||||
fi
|
unset list
|
||||||
|
list=()
|
||||||
|
for v in "${variant[@]}"
|
||||||
|
do
|
||||||
|
qt=${t}${v}
|
||||||
|
test -n "${rpm_querytags[${qt}]}" || continue
|
||||||
|
list+=("%{${qt}}")
|
||||||
|
done
|
||||||
|
QF_PROVIDES+="${t}\\n[${list[@]}\\n]\\n"
|
||||||
|
done
|
||||||
|
|
||||||
# don't look at RELEASE, it contains our build number
|
# don't look at RELEASE, it contains our build number
|
||||||
QF_TAGS="%{NAME} %{VERSION} %{EPOCH}\\n"
|
QF_TAGS="%{NAME} %{VERSION} %{EPOCH}\\n"
|
||||||
@ -54,24 +74,36 @@ QF_TAGS="${QF_TAGS}%{PAYLOADFORMAT} %{PAYLOADCOMPRESSOR} %{PAYLOADFLAGS}\\n"
|
|||||||
# XXX We also need to check the existence (but not the content (!))
|
# XXX We also need to check the existence (but not the content (!))
|
||||||
# of SIGGPG (and perhaps the other SIG*)
|
# of SIGGPG (and perhaps the other SIG*)
|
||||||
# XXX We don't look at triggers
|
# XXX We don't look at triggers
|
||||||
QF_TAGS="${QF_TAGS}[%{VERIFYSCRIPTPROG} %{VERIFYSCRIPT}]\\n"
|
|
||||||
# Only the first ChangeLog entry; should be enough
|
# Only the first ChangeLog entry; should be enough
|
||||||
QF_TAGS="${QF_TAGS}%{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n"
|
QF_TAGS="${QF_TAGS}%{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n"
|
||||||
|
|
||||||
# scripts, might contain release number
|
# scripts, might contain release number
|
||||||
script_types='
|
|
||||||
PRETRANS
|
|
||||||
PREIN
|
|
||||||
POSTIN
|
|
||||||
PREUN
|
|
||||||
POSTUN
|
|
||||||
POSTTRANS
|
|
||||||
VERIFYSCRIPT
|
|
||||||
'
|
|
||||||
QF_SCRIPT=
|
QF_SCRIPT=
|
||||||
for script_type in ${script_types}
|
type=(
|
||||||
|
PRETRANS
|
||||||
|
PREIN
|
||||||
|
POSTIN
|
||||||
|
PREUN
|
||||||
|
POSTUN
|
||||||
|
POSTTRANS
|
||||||
|
VERIFYSCRIPT
|
||||||
|
)
|
||||||
|
variant=(
|
||||||
|
PROG
|
||||||
|
FLAGS
|
||||||
|
''
|
||||||
|
)
|
||||||
|
for t in "${type[@]}"
|
||||||
do
|
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}
|
||||||
|
test -n "${rpm_querytags[${qt}]}" || continue
|
||||||
|
list+=("%{${qt}}")
|
||||||
|
done
|
||||||
|
QF_SCRIPT+="${t}\\n[${list[@]}\\n]\\n"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Now the files. We leave out mtime and size. For normal files
|
# Now the files. We leave out mtime and size. For normal files
|
||||||
@ -256,6 +288,7 @@ function cmp_rpm_meta ()
|
|||||||
rpm_meta_old=`mktemp`
|
rpm_meta_old=`mktemp`
|
||||||
rpm_meta_new=`mktemp`
|
rpm_meta_new=`mktemp`
|
||||||
|
|
||||||
|
collect_rpm_querytags
|
||||||
set_rpm_meta_global_variables $oldrpm
|
set_rpm_meta_global_variables $oldrpm
|
||||||
|
|
||||||
check_header "$QF_ALL" $oldrpm > $rpm_meta_old
|
check_header "$QF_ALL" $oldrpm > $rpm_meta_old
|
||||||
|
Loading…
Reference in New Issue
Block a user