Browse Source

xorg-x11-drv-nvidia: use xorg.conf.dist if xorg.conf is not exist.

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@4287 ec354946-7b23-47d6-9f5a-488ba84defc7
daisuke 13 years ago
parent
commit
70eeb89146

+ 14 - 4
nonfree/xorg-x11-drv-nvidia/nvidia-config-display

@@ -94,10 +94,20 @@ def printUsage():
 # Main section
 # ------------
 
-try:
-    # Read config file
-    (xconfig, xconfigpath) = ixf86config.readConfigFile()
-except:
+xorgconf = "/etc/X11/xorg.conf"
+if os.access(xorgconf, os.F_OK):
+    try:
+        (xconfig, xconfigpath) = ixf86config.readConfigFile()
+    except:
+        pass
+elif os.access(xorgconf + ".dist", os.F_OK):
+    import shutil
+    shutil.copy(xorgconf + ".dist", xorgconf)
+    try:
+        (xconfig, xconfigpath) = ixf86config.readConfigFile()
+    except:
+        pass
+else:
     printError("Could not read X config file")
     sys.exit(1)
 

+ 20 - 6
nonfree/xorg-x11-drv-nvidia/xorg-x11-drv-nvidia-vl.spec

@@ -7,8 +7,8 @@
 Summary: Proprietary NVIDIA hardware accelerated display driver
 Summary(ja): プロプライエタリな NVIDIA ハードウエアアクセラレーションディスプレイドライバ
 Name: xorg-x11-drv-nvidia
-Version: 270.41.19
-Release: 1%{?_dist_release}
+Version: 275.09.07
+Release: 2%{?_dist_release}
 License: Redistributable, no modification permitted
 Group: User Interface/X Hardware Support
 URL: http://www.nvidia.com/object/unix.html
@@ -293,10 +293,17 @@ echo %{nvidialib32dir} >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/nvidia.conf
 /sbin/ldconfig
 # Make sure we have a Files section in xorg.conf, otherwise create an empty one
 XORGCONF=/etc/X11/xorg.conf
-[ -w ${XORGCONF} ] && ! grep -q 'Section "Files"' ${XORGCONF} && \
-    echo -e 'Section "Files"\nEndSection' >> ${XORGCONF}
-# Enable the proprietary driver
-%{_sbindir}/nvidia-config-display enable || :
+for x in ${XORGCONF} ${XORGCONF}.dist ;do
+  if [ -f "$i" ]; then
+    [ -w $i ] && ! grep -q 'Section "Files"' $i && \
+        echo -e 'Section "Files"\nEndSection' >> $i
+    # Enable the proprietary driver
+    if (egrep -q "\"(nv|nvidia|nouveau)\"" $i); then
+      %{_sbindir}/nvidia-config-display enable || :
+    fi
+    break
+  fi
+done
 # Add to DKMS registry
 dkms add -m %{dkms_name} -v %{dkms_vers} %{?quiet} || :
 # Rebuild and make available for the currenty running kernel
@@ -372,6 +379,13 @@ fi
 
 
 %changelog
+* Thu Jul 07 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 275.09.07-2
+- update nvidia-config-display and %%post to use xorg.conf.dist
+  if xorg.conf is not exist
+
+* Thu Jun 16 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 275.09.07-1
+- update to 275.09.07
+
 * Sun Jun 12 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 270.41.19-1
 - update to 270.41.19