File get_file.patch of Package nvidia-firmware-installer

Index: nvidia-firmware-installer/extract_firmware.py
===================================================================
--- nvidia-firmware-installer.orig/extract_firmware.py
+++ nvidia-firmware-installer/extract_firmware.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 #
 # Copyright 2013 Ilia Mirkin.
 #
@@ -26,11 +26,27 @@ import itertools
 import mmap
 import os
 import re
+import shutil
 import struct
 import sys
 import tempfile
 import zlib
 
+arch = 'x86'
+nver = '325.15'
+filename = "NVIDIA-Linux-" + arch + "-" + nver + ".run"
+fwdir = "/lib/firmware/nouveau"
+nvurl = "https://download.nvidia.com/XFree86/Linux-" + \
+         arch + "/" + nver + "/" + filename
+dlCommand = "wget --progress=dot -e dotbytes=20k " + nvurl + " -O " + filename
+extractCommand = "sh " + filename + " --extract-only"
+installCommand = "cp -P nv* vuc* -t " + fwdir
+
+temp_dir = tempfile.mkdtemp()
+os.chdir(temp_dir)
+os.system(dlCommand)
+os.system(extractCommand)
+
 # The firmware changes fairly rarely. From a limited sample, when the
 # firmware does change, the starts of the firmware remain the
 # same. When changing the version though, one should double-check the
@@ -428,3 +444,8 @@ else:
     for start, end in zip(gzip_starts, gzip_starts[1:] + [len(kernel)]):
         if decompress("blob%d" % idx, start, kernel[start:end]):
             idx += 1
+
+if not os.path.exists(fwdir):
+       os.makedirs( fwdir, 0o755 )
+os.system(installCommand)
+shutil.rmtree(temp_dir)
openSUSE Build Service is sponsored by