rpm: avoid removing unrelated files on template reinstall

Fixes QubesOS/qubes-issues#3294
This commit is contained in:
Marek Marczykowski-Górecki 2018-03-21 00:47:42 +01:00
parent e62c948068
commit 941d7ec448
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -58,8 +58,13 @@ touch $RPM_BUILD_ROOT/%{dest_dir}/icon.png
export XDG_DATA_DIRS=/usr/share/
if [ "$1" -gt 1 ] ; then
# upgrading already installed template...
echo "--> Removing previous menu shortcuts..."
xdg-desktop-menu uninstall --mode system %{dest_dir}/apps/*.directory %{dest_dir}/apps/*.desktop
# avoid removing innocent files if *.desktop doesn't mach anything
# https://bugs.freedesktop.org/105635
if ls %{dest_dir}/apps/*.directory %{dest_dir}/apps/*.desktop >/dev/null 2>&1; then
echo "--> Removing previous menu shortcuts..."
xdg-desktop-menu uninstall --mode system \
%{dest_dir}/apps/*.directory %{dest_dir}/apps/*.desktop
fi
fi