On Sat, Apr 09, 2005 at 12:21:36PM +0200, Tom Albers wrote: > Op zaterdag 9 april 2005 03:32, schreef u: > > On Fri, Apr 08, 2005 at 05:07:11PM +0200, Tom Albers wrote: > > > Hi, when the user has put fonts in a subfolder with a dash, the > > > postinstall script will fail on: > > > > > > fontconfig.postinst: > > > find /var/lib/defoma/x-ttcidfont-conf.d -name fonts.cache-1 | xargs rm -f > > > (around line 127) > > > > > > If you change that to: > > > find /var/lib/defoma/x-ttcidfont-conf.d -name fonts.cache-1 | xargs rm -f > > > -- > > > > > > it should be fine. > > > > That doesn't make any sense. Aside from there not being any good reason to > > create such a subdirectory AFAICT, > > My co-worker used it to store some old fonts in there. I do not know why, but > it gave serious trouble upgrading debian ;-) > > > the find command returns the full path > > to each file it finds: there's no way that a path anchored at the root > > directory is going to begin with a -, it will always begin with a slash. > > What's the actual path of the file causing problems for you, and what is > > the error you get?
> testcase: > cd /tmp > mkdir -- "- oldones -" > cd -- -\ oldones\ -/ > touch temp > cd .. > command: "find . -name temp | xargs rm -f" will result in an error that this > option is not supported by rm. "find . -name temp | xargs rm -f --" works > fine. Well, all you've done in this case is hidden the error; the rm -f *still* doesn't work correctly, because the paths being passed to rm -f are now "./-", "oldones", and "-/temp", none of which are valid paths. I don't think this workaround is a good idea; it's *only* needed in cases where you have a directory name with a space in it followed by a dash, and in such a case it will never result in successful deletion of the directory. You might as well just stick "|| true" on the end of the line for all the difference it makes. > I agree it will not happen for many people, but if it happens, you really > don't know how to solve it, unless you debug the postinstall script. It is > not theoretical, I ran into it yesterday and took me quite a bit to find the > problem ;-) Yeah, in such an edge case I'd rather see the admin deal with it manually rather than hiding the problem. It was the admin's bright idea to create this directory name, he should be bright enough to figure out how to fix it ;) Cheers, -- Steve Langasek postmodern programmer
signature.asc
Description: Digital signature