Subject: pkg/30889: sysutils/mklivecd overwrites XF86Config when it should not
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <joern@TechFak.Uni-Bielefeld.DE>
List: pkgsrc-bugs
Date: 08/01/2005 21:59:00
>Number:         30889
>Category:       pkg
>Synopsis:       sysutils/mklivecd overwrites XF86Config when it should not
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 01 21:59:00 +0000 2005
>Originator:     Joern Clausen
>Release:        2.0
>Organization:
>Environment:
NetBSD mini 2.0 NetBSD 2.0 (MINI) #0: Sun Jan 23 23:13:25 CET 2005  root@mini:/export/usr/source/NetBSD-2.0/usr/src/sys/arch/i386/compile/MINI i386
>Description:
When ENABLE_X11 is true in sysutils/mklivecd, /etc/X11/XF86Config is copied to the corresponding staging directory, overwriting any configuration that was created there. Live-CDs are usually built to run on a wide variety of machines, so it is IMHO illogical to force the use of an XFree configuration that has a high probabilty of being specialized to one hardware.
>How-To-Repeat:

>Fix:
diff -u mklivecd.orig mklivecd
--- mklivecd.orig       2005-07-13 12:47:44.000000000 +0200
+++ mklivecd    2005-08-01 23:38:05.000000000 +0200
@@ -518,12 +518,6 @@
                    mv $ISODIR/etc/rc.d/mfs_rcd.f $ISODIR/etc/rc.d/mfs_rcd
                fi
 
-               if [ "${ENABLE_X11}" = "yes" ]; then
-                   if [ -f /etc/X11/XF86Config ]; then
-                       cp /etc/X11/XF86Config $ISODIR/etc/X11
-                   fi
-               fi
-
                if [ "${PERSONAL_CONFIG}" = "yes" -a                        \
                        -f $config_dir/$pers_conffile ]; then
                    echo

Maybe better is to check if /etc/X11/XF86Config exists in the staging directory and leave it as is in any case, and copy the real XF86Config, if and only if ENABLE_X11 is true but no config file has been created yet in the staging directory.