Created attachment 709024 [details] parser.py: Allow shlex to strip lines Description of problem: I had a long command in a %post section, which I moved to a separate file to be included. The command spanned multiple lines. In parser.py, rstrip is performed on the first command line in an included file, and the result is run through shlex.split. However, with the newline stripped, shlex sees a dangling escape character and aborts. (After looking at the code, another abort condition would be a quoted comment character: `echo 'this # explodes'`.) Version-Release number of selected component (if applicable): git master How reproducible: always Steps to Reproduce: 1. Write a kickstart file that uses %include in a %post section. 2. Have the included file's first command line end with "\" or contain "'#'". 3. Run livecd-creator on the kickstart. Actual results: Direct string manipulation causes shlex to abort parsing. Expected results: It should successfully include the script file and parse the kickstart file. Additional info: The attached patch is a workaround I've been using. I believe it should provide equivalent behavior for any lines that do not contain a quoted comment character or line continuation, but it will not longer abort when kickstart commands use line continuations either (in case that was intentional).
Do you have a couple examples I could use as test cases in the future?
Here is a bash session to reproduce both errors with Fedora's kickstarts. cp -a /usr/share/spin-kickstarts wd cd wd sed -i -e '/%post/a%include test.sh' fedora-livecd-desktop.ks echo $': this is a \\\n long command' > test.sh sudo livecd-creator fedora-livecd-desktop.ks echo ": 'quoted # comment'" > test.sh sudo livecd-creator fedora-livecd-desktop.ks
Thanks for the patch.
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19