#3 Remove bashisms from xmlto
Closed: Fixed None Opened 9 years ago by rsmarples.

There is really no need to force bash on users as xmlto is using during the building of some server side packages on non Linux systems such as NetBSD.


Thanks for the patch, although some of the chunks are not about addressing bashisms and some don't apply to the latest svn, generally the patch makes xmlto shell code better. The only thing I'm not really sure about is the fact you change the bash arrays to the simple variable - which later results in possibility some files (these with spaces) might not be deleted. However - for papersizemod it is definitely not a problem - the filenames are defined there. And for cleanup of the files, it seems to work properly in my quick check. Not sure if I can come with some scenario where it could cause some bug.
Once I finish the review, I'll probably push that and release a new version with the changes.

If spaces in filenames are a concern, they could always be tab or newline delimited instead of space delimited and set $IFS accordingly.

In many parts of the xmlto scripts, spaces in filenames were causing bugs in the past. The only thing where it might cause some issues might be -m option - as when there will be space in the name it results in for cycle not work properly. At the moment, xmlto scripts are not $IFS aware - so they expect $IFS to be whitespace. However - I think using newline separator and while read loop instead of for loop might be used there.

Ok, one more echo -e -> printf change was there and several small changes to apply it on the latest tree. Committed as it is for now, I will think how to improve the "spaces in names" issue before the release. checkbashisms script still complains about the "type" without any parameters - but this should probably be just fine.

Hmmms, something is wrong and the latest commits from my working copy don't upload to the browse sources (I'm now on patchset 78 and sources on 74... strange, will check what's wrong there.)

Metadata Update from @rsmarples:
- Issue assigned to ovasik
- Issue tagged with: bash

7 years ago

Log in to comment on this ticket.

Metadata