On Mon, 18 Feb 2013, zezinho wrote:
Em 17-02-2013 22:03, Charles A Edwards escreveu:
1/1:powermanga #########################
mv: cannot stat ‘/var/lib/games/powermanga.hi’: No such file or
directory
No such file or directory
warning: %post(powermanga-0.91-2.mga3.x86_64)
scriptlet failed, exit status 1
ERROR: 'script' failed for
powermanga-0.91-2.mga3.x86_64:
Yes, I could not find a nice way to only move file if it exists : something
like below fails. any hints?
[ -f %{_localstatedir}/lib/games/%{name}.hi ] && mv
%{_localstatedir}/lib/games/%{name}.hi %{_localstatedir}/games/%{name}/%{name}.hi
That is a logical expression, && means both sides need to be true, so
the line fails when the file doesn't exist. You wanted something like:
if [ -f %{_localstatedir}/lib/games/%{name}.hi ]; then
mv %{_localstatedir}/lib/games/%{name}.hi
%{_localstatedir}/games/%{name}/%{name}.hi
fi
Christiaan