#!/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