%pretrans -p path = "%{_firmwaredir}/qcom/LENOVO/21BX" st = posix.stat(path) if st and st.type == "directory" then path2 = path .. ".rpmmoved" if not os.rename(path, path2) then print("Cannot rename to " .. path2) os.exit(1) end end %posttrans if test -d %{_firmwaredir}/qcom/LENOVO/21BX.rpmmoved; then rm -rf %{_firmwaredir}/qcom/LENOVO/21BX.rpmmoved fi