File pre_checkin.sh of Package xv

#!/bin/bash
# This script is called automatically during autobuild checkin.

version="$(sed -rn '/^Version:/{ s/^Version:[[:space:]]+//p }' xv.spec)"
tarball="$(sed -rn "/^Source[[:digit:]]*:[[:space:]]+xv.*\.tar\.gz/ {s/^Source[[:digit:]]*:[[:space:]]+//;s/%\{version\}/${version}/p }" xv.spec)"

test -e "${tarball}" || { echo "No such file: ${tarball}" 1>&2;  exit 1; }

found=$(tar --wildcards --list --file "${tarball}" '*/epsf.ps' 2>/dev/null) || exit 0

trap 'rm -vf $tmp' EXIT HUP TERM
tmp=$(mktemp XXXXXXXX.tar.gz) || exit 1
gzip -d < "${tarball}" | tar --wildcards --delete '*/epsf.ps' | gzip > $tmp
chmod 644 $tmp
mv $tmp $tarball
openSUSE Build Service is sponsored by