Files
libwnck2/libwnck2_spec-update.sh
Sascha Peilicke d84594b729 Accepting request 69549 from GNOME:Factory
libwnck2 - former libwnck package for compatibility for non gnome-3 stuff (e.g. xfce)

OBS-URL: https://build.opensuse.org/request/show/69549
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libwnck2?expand=0&rev=1
2011-05-06 12:07:32 +00:00

35 lines
788 B
Bash

#!/bin/bash
# Autobuild doesn't support package names with macros. This script will update versions in package names.
# Usage: Automatically called from spec file by:
# libwnck2_spec-update.sh DIR BASE_NAME libnames...
if ! test -f $1/$2.spec ; then
exit
fi
BASE=$1/$2
shift 2
for PKGNAME in $@ ; do
# Packages with name ending by number needs separator
if test x`echo $PKGNAME | sed "s/.*[0-9]$//"` = x ; then
SEPARATOR=-
else
SEPARATOR=
fi
sed -i "
# Copy ${PKGNAME}_name to hold space
/^%define ${PKGNAME}_name / {
h;
s/^%define ${PKGNAME}_name //;
x;
};
# Update ${PKGNAME}_name everywhere
/$PKGNAME$SEPARATOR[0-9][-_0-9]*/ {
G;
s/$PKGNAME$SEPARATOR[0-9][-_0-9]*\(.*\)\n\(.*\)/$PKGNAME$SEPARATOR\2\1/;
};" $BASE.spec
done