常见错误
post 或 postun 阶段出错

常见错误

post 或 postun 阶段出错

如果 post 或 postun 阶段出错,一般是上一条命令返回结果非 0 (真)。如果 是 if 测试条件必要,建议用 true 来做默认的分枝。如下例:

 93 %post
 94 #Update fontconfig cache
 95 [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache %{base_font_dir} || true
 96
 97 %postun
 98 #Update fontconfig cache
 99 [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache %{base_font_dir} || true