mirror of
https://git.icinga.com/packaging/rpm-icingaweb2.git
synced 2025-07-28 08:24:08 +02:00
Add script to diff with OBS
This commit is contained in:
parent
8fbf24bff8
commit
0cd276474f
34
diff-obs
Executable file
34
diff-obs
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
srcpkg=icingaweb2
|
||||
project=server:monitoring
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
project="$1"
|
||||
fi
|
||||
|
||||
if ! which osc &>/dev/null; then
|
||||
echo "This script needs 'osc' to download files from OpenSuSE Build Service" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# You can not download this un-authenticated!
|
||||
osc cat "$project" "${srcpkg}" "${srcpkg}".spec >"${srcpkg}".obs.spec~
|
||||
|
||||
# compare without a changelog
|
||||
temp_compare="$(mktemp -d)"
|
||||
trap 'rm -rf "${temp_compare}"' EXIT SIGINT SIGTERM
|
||||
|
||||
for file in "${srcpkg}.obs.spec~" "${srcpkg}.spec"
|
||||
do
|
||||
sed '/^%changelog/q' "${file}" >"${temp_compare}/${file}"
|
||||
done
|
||||
|
||||
(
|
||||
cd "${temp_compare}"
|
||||
diff --color=auto -Nu "${srcpkg}.obs.spec~" "${srcpkg}.spec"
|
||||
)
|
||||
|
||||
# vi: ts=2 sw=2 expandtab
|
Loading…
x
Reference in New Issue
Block a user