Subject: bin/17807: directory handling bugfix for /sbin/newbtconf
To: None <>
From: Stoned Elipot <>
List: netbsd-bugs
Date: 08/02/2002 12:16:49
>Number:         17807
>Category:       bin
>Synopsis:       directory handling bugfix for /sbin/newbtconf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 02 03:17:00 PDT 2002
>Originator:     Stoned Elipot
>Release:        -current
SCRIPT, Paris VII University, France
System: NetBSD runabout 1.6D NetBSD 1.6D (RUNABOUT) #0: Fri Jul 12 00:18:29 UTC 2002     root@runabout:/usr/u/seb/src/RUNABOUT/compile i386

/etc/rc.conf.d is part of the FILES variable value in /sbin/newbtconf
so it appeared to me that it was intended that this directory be handle
by the multiple configuration scheme newbtconf and /etc/rc.d/
provide. Unfortunately the code of the initialisation step do not
handle directories only regular files.

And then the code for creation a new configuration can not handle directories
as well.
Run '/sbin/newbtconf init' and observe that /etc/rc.conf.d is left untouched
i.e. it is not moved to /etc/ and a symlink to etc.current/rc.conf.d
is not created.
The following patch should fix this problem.

RCS file: /cvsroot/basesrc/sbin/newbtconf/,v
retrieving revision 1.5
diff -u -r1.5
---	2001/11/18 03:50:53	1.5
+++	2002/08/02 10:08:14
@@ -24,7 +24,7 @@
 	ln -s $dir etc.current
 	ln -s $dir etc.default
 	for i in ${FILES}; do
-		if [ -f $i ] ; then
+		if [ -f $i -o -d $i ] ; then
 			mv $i $dir
 			ln -s etc.current/$i .
@@ -57,6 +57,7 @@
 	exit 1;
 mkdir -m 755 /etc/$dir
-cp -p /etc/$orig/* /etc/$dir
+cd /etc/$orig 
+pax -rw -pe . /etc/$dir
 echo "/etc/$dir has now been created and populated."
 exit 0