So far, the /lib/rcscripts/awk/gendepends.awk and /lib/rcscripts/sh/rc-services.sh script catches '-' and '.' , but it should also catch other characters, based on this definition: name A word consisting only of alphanumeric characters and underscores, and beginning with an alphabetic character or an underscore. Also referred to as an identifier. Therefore, it must also catch anything outside the set ('0' to '9' union 'A' - 'Z' union 'a' - 'z' union '_') I propose that the names be hashed instead to avoid these problems. Will post patches
Created attachment 14266 [details, diff] Patch to make all variable names safe This patch changes depinfo_consolefont() into depinfo_9a48feb4333a3dfac1d83f8a54a79c10() , etc. The hash is generated by md5sum'ing the name and a single newline, i.e. echo "$myservice" | md5sum as opposed to echo -n "$myservice" | md5sum Why I do this, you ask? It is because I have a service called timidity++-server on my computer. Because of the change in the dependency generation scheme, rc cannot find the dependency info for timidity++-server because '+' is not a valid shell name character. A lot of other punctuation are not allowed in shell names, but are allowed in file names. So, this is the solution I come up with - a catch-almost-all solution. (' ' are used to delimit the dependency information, this will require all names to be hashed)
And that is going to call md5 and gawk a lot, meaning I can just as well revert all the changes between 1.8.6.7 and 1.8.6.8, (meaning more forks, meaning slower, especially on older machines) because it will be for naught.
I know... Perhaps some embedded functions would be better. The point is to stress that not all legal filenames are legal bash variable/function names. I like the idea of letting bash to do the parsing of the deptree though.
It now uses an array, and should fix this (commited to CVS).