File post of Package kernel-firmware-nvidia

%pretrans -p <lua>
paths = {"ad103", "ad104", "ad106", "ad107"}
for i = 1, 4 do
  path = "%{_firmwaredir}/nvidia/" .. paths[i]
  st = posix.stat(path)
  if st and st.type == "directory" then
    path2 = path .. ".rpmmoved"
    if not os.rename(path, path2) then
      print("Cannot rename " .. path .. " to " .. path2)
      os.exit(1)
    end
  end
end

%posttrans
for f in ad103 ad104 ad106 ad107; do
  if test -d %{_firmwaredir}/nvidia/$f.rpmmoved; then
    rm -rf %{_firmwaredir}/nvidia/$f.rpmmoved
  fi
done
openSUSE Build Service is sponsored by