sed -i -e '/^extras\/mini*/d' -e '/^tools\/qemu*/d'  -e '/^tools\/firmware\/seabios*/d' -e '/^tools\/hotplug\/Linux\/init\.d/d' .gitignore
# -e '/^xen\/.config/d' -e '/^.config/d'
git init
if [ -z $(git config --get user.email) ];then
git config user.email "%__scm_usermail"
git config user.name "%__scm_username"
fi
git add -f tools/hotplug/Linux/init.d/xendriverdomain.in
git add -f tools/hotplug/FreeBSD/rc.d/
git add .
git commit -a -q -m "%{name} patched baseline."

%global pchcnt %{lua: if patches == nil then print("0") else print(#patches) end}
if [ %pchcnt -gt 0 ]; then
git am --whitespace=nowarn %patches
fi
%{nil}
