- Trim name-version-release string in update-scripts
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=170
This commit is contained in:
parent
facecfbfa1
commit
2cf8919076
@ -3,6 +3,7 @@ Wed Feb 4 17:57:27 UTC 2015 - olaf@aepfle.de
|
||||
|
||||
- Remove more javadoc references (bnc#916161)
|
||||
- Handle *.war files like *.jar files
|
||||
- Trim name-version-release string in update-scripts
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 4 15:53:05 UTC 2015 - olaf@aepfle.de
|
||||
|
17
functions.sh
17
functions.sh
@ -19,13 +19,21 @@ check_header()
|
||||
# - 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
|
||||
# Trim name-version-release string:
|
||||
# - it is used in update-scripts which are called by libzypp
|
||||
function trim_release_old()
|
||||
{
|
||||
sed -e "/\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_old_regex_l\$\)/{s,$version_release_old_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_old_regex_s,@VERSION@-@RELEASE_SHORT@,g}"
|
||||
sed -e "
|
||||
/\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_old_regex_l\$\)/{s,$version_release_old_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_old_regex_s,@VERSION@-@RELEASE_SHORT@,g}
|
||||
s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_old_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g
|
||||
"
|
||||
}
|
||||
function trim_release_new()
|
||||
{
|
||||
sed -e "/\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_new_regex_l\$\)/{s,$version_release_new_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_new_regex_s,@VERSION@-@RELEASE_SHORT@,g}"
|
||||
sed -e "
|
||||
/\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_new_regex_l\$\)/{s,$version_release_new_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_new_regex_s,@VERSION@-@RELEASE_SHORT@,g}
|
||||
s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_new_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g
|
||||
"
|
||||
}
|
||||
# Get single directory or filename with long or short release string
|
||||
function grep_release_old()
|
||||
@ -119,6 +127,8 @@ function cmp_spec ()
|
||||
# Remember to quote the . which is in release
|
||||
version_release_old=$($RPM --qf "%{VERSION}-%{RELEASE}" "$oldrpm")
|
||||
version_release_new=$($RPM --qf "%{VERSION}-%{RELEASE}" "$newrpm")
|
||||
name_ver_rel_old=$($RPM --qf "%{NAME}-%{VERSION}-%{RELEASE}" "$oldrpm")
|
||||
name_ver_rel_new=$($RPM --qf "%{NAME}-%{VERSION}-%{RELEASE}" "$newrpm")
|
||||
# Short version without B_CNT
|
||||
version_release_old_regex_s=${version_release_old%.*}
|
||||
version_release_old_regex_s=${version_release_old_regex_s//./\\.}
|
||||
@ -127,6 +137,8 @@ function cmp_spec ()
|
||||
# Long version with B_CNT
|
||||
version_release_old_regex_l=${version_release_old//./\\.}
|
||||
version_release_new_regex_l=${version_release_new//./\\.}
|
||||
name_ver_rel_old_regex_l=${name_ver_rel_old//./\\.}
|
||||
name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.}
|
||||
# This might happen when?!
|
||||
echo "comparing RELEASE"
|
||||
if [ "${version_release_old%.*}" != "${version_release_new%.*}" ] ; then
|
||||
@ -225,3 +237,4 @@ function cmp_spec ()
|
||||
rm $file1 $file2
|
||||
return $RES
|
||||
}
|
||||
# vim: tw=666 ts=2 et
|
||||
|
@ -141,3 +141,4 @@ if test $SUCCESS -eq 0; then
|
||||
fi
|
||||
echo 'compare validated built as identical !'
|
||||
exit 0
|
||||
# vim: tw=666 ts=2 et
|
||||
|
@ -97,3 +97,4 @@ done
|
||||
|
||||
rm -rf $dir
|
||||
exit $ret
|
||||
# vim: tw=666 ts=2 et
|
||||
|
Loading…
Reference in New Issue
Block a user