Skip to content
Snippets Groups Projects
Commit bb75469b authored by Markus Frosch's avatar Markus Frosch
Browse files

Update diff-obs

parent 6d3a796c
No related branches found
No related tags found
No related merge requests found
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
set -e set -e
project="$1" srcpkg=icinga2
if [ -z "$project" ]; then project=server:monitoring
project=server:monitoring
if [ -n "$1" ]; then
project="$1"
fi fi
if ! which osc &>/dev/null; then if ! which osc &>/dev/null; then
...@@ -12,6 +14,27 @@ if ! which osc &>/dev/null; then ...@@ -12,6 +14,27 @@ if ! which osc &>/dev/null; then
exit 1 exit 1
fi fi
osc cat "$project" icinga2 icinga2.spec >icinga2.obs.spec~ # 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
cp ${file} "${temp_compare}/${file}"
# Start with first line that is not a comment
sed -i -n '/^[^#]/,$p' "${temp_compare}/${file}"
# remove everything after changelog
sed -i '/^%changelog/q' "${temp_compare}/${file}"
done
(
cd "${temp_compare}"
diff --color=auto -Nu "${srcpkg}.obs.spec~" "${srcpkg}.spec"
)
diff -Nau icinga2.spec icinga2.obs.spec~ # vi: ts=2 sw=2 expandtab
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment