From 01c75522b6ed15e979347acd38e234e2cb9006c3 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 3 Jun 2010 18:59:03 -0700 Subject: [PATCH] Stop searching for XF86Config files xorg.conf has been used since the X11R6.7 release in April 2004. 6 years has been a generous transition period for users to "mv XF86Config xorg.conf" and for distros to update their configuration tools and packages. Signed-off-by: Alan Coopersmith Reviewed-by: James Cloos Signed-off-by: Keith Packard --- hw/xfree86/doc/sgml/DESIGN.xml | 5 +++-- hw/xfree86/parser/scan.c | 23 +++++++---------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/hw/xfree86/doc/sgml/DESIGN.xml b/hw/xfree86/doc/sgml/DESIGN.xml index 826a9702c..6c90a4011 100644 --- a/hw/xfree86/doc/sgml/DESIGN.xml +++ b/hw/xfree86/doc/sgml/DESIGN.xml @@ -118,8 +118,9 @@ routines common to all the X servers in the sample implementation. The xorg.conf File -The xorg.conf file format is similar to the old format, with the following -changes: +The xorg.conf file format is based on the XF86Config format from XFree86 4.4, +which is in turn similar to the old XFree86 3.x XF86Config format, with the +following changes: diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 06710d55a..9771913f4 100644 --- a/hw/xfree86/parser/scan.c +++ b/hw/xfree86/parser/scan.c @@ -601,7 +601,7 @@ xf86pathIsSafe(const char *path) * %P projroot * %C sysconfdir * %D datadir - * %M major version number + * %M config file format version number * %% % */ @@ -627,16 +627,10 @@ xf86pathIsSafe(const char *path) #define XCONFENV "XORGCONFIG" #endif #define XFREE86CFGFILE "XF86Config" -#ifndef XF86_VERSION_MAJOR -#ifdef XVERSION -#if XVERSION > 40000000 -#define XF86_VERSION_MAJOR (XVERSION / 10000000) -#else -#define XF86_VERSION_MAJOR (XVERSION / 1000) -#endif -#else -#define XF86_VERSION_MAJOR 4 -#endif +/* xorg.conf is based on XF86Config version 4. If we ever break + compatibility of the xorg.conf syntax, we'll bump this version number. */ +#ifndef CONFIG_FILE_VERSION +#define CONFIG_FILE_VERSION 4 #endif #define BAIL_OUT do { \ @@ -771,11 +765,8 @@ DoSubstitution(const char *template, const char *cmdline, const char *projroot, break; case 'M': if (!majorvers[0]) { - if (XF86_VERSION_MAJOR < 0 || XF86_VERSION_MAJOR > 99) { - fprintf(stderr, "XF86_VERSION_MAJOR is out of range\n"); - BAIL_OUT; - } else - sprintf(majorvers, "%d", XF86_VERSION_MAJOR); + snprintf(majorvers, sizeof(majorvers), + "%d", CONFIG_FILE_VERSION); } APPEND_STR(majorvers); break;