#177 closed defect (fixed)
automate lfs-commands creation
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | Book | Version: | CVS |
Severity: | normal | Keywords: | |
Cc: |
Description
change the script.xml files to include a file called script-whatever.xml and then put just the script file in that. We should then be able to simply sed the four or five entities across using a script and so be able to pull the scripts out of cvs with one command.
Change History (15)
comment:1 by , 23 years ago
Resolution: | → later |
---|---|
Status: | new → closed |
comment:2 by , 23 years ago
comment:3 by , 23 years ago
Resolution: | later |
---|---|
Status: | closed → reopened |
comment:4 by , 23 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
comment:5 by , 23 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Summary: | make bootscript extraction easier → automate lfs-commands creation |
comment:6 by , 23 years ago
Priority: | normal → lowest |
---|
comment:7 by , 22 years ago
I made a script to build lfs-commands automagically:
http://linuxfromscratch.org/~timothy/lfscmd/lfscmd-0.1.tar.bz2
1.chroot doesn't conform to the <screen><userinput> stuff. I
think that <screen> should go inside the chrootcmd.xml file, not in chroot.xml as it currently is. I'll change this unless anyone has any objections.
2.commands that use &*-version;, such as those found in
binutils-inst.xml, don't evaluate to their version number in lfs-commands.
Possible solutions:
(1) grep the version number in entities, cut it, and replace
it with $*-version on the fly.
(2) Have a list of &-*version;'s and replace them from a
manually-maintained list.
(3) Hardcode the version number in the commands in LFS BOOK,
as some (such as 2 of the findutils patch lines) already are.
- commands which escape characters, such as '\(' and '\)' in the sed commands of sysvinit, are generally getting fscked up. I have a feeling that BASH is involved. IMO, these commands would look better with '@' as a deliminator, and the need for escaping '(' would dissapear. I'll change this as well, unless anyone has any objections.
- it is slow. Not as slow as parsing the xml into HTML, and not as slow as "should i get up and do something else?", but slow as in "hmm, i should re-paint my ceiling."
this lack of speed is attributed to the lfscmd-parse script. I had made this script because my lack of awk/sed talent was resulting in 80% correct lfs-commands and 20% whitespace :)
lfscmd-parse would be faster if written in C. I can do that, but i really don't feel like it, i can live with twiddling my thumbs an extra 15 seconds.
Anyhoo, this was a long comment, eh? Tell me what you think.
comment:8 by , 22 years ago
- No, as long as you check that the syntax is still valid, I don't object to putting the <screen> tag inside chroot-cmd.xml
- If we're automating this, the following is the only solution: (1) grep the version number in entities, cut it, and replace
it with $*-version on the fly.
The option (3) won't fly, indeed I've just fixed the hard-coded values you referred to!
- That looks good to me. More shell independent as well I think. I thought we were going to do this a while ago, obviously it never got done!
- Personally I didn't think the script was that slow. Certainly not compared to the length of time it takes openjade to generate the book itself..
I like this a lot. I reckon this'll put us well back on the way to having the lfs-commands tarballs again. Kudos to Timothy!
comment:9 by , 22 years ago
New version:
http://linuxfromscratch.org/~timothy/lfscmd/lfscmd-0.2.tar.bz2
Added an lfscmd-check script to validate that all entities in lfs-commands are being resolved. lfscmd-check is not used by the other scripts.
- Done.
- Done. lfscmd now replaces entities on the fly, as long as they are in entities/ or index.xml. Otherwise, a WARNING is sent to stderr.
- The other sed commands in the LFS book use '%' as a deliminator. They are modifying directory names, so '%' is a nice alternative to escaping /. I simplified the sed command for Sysvinit, so the problems with '\(' and '\)' are resolved for the time being.
- It is slower now, because I added a bunch of junk in order to cut the entities on the fly. lfscmd-check will handle some of this load in the next version.
Known Bugs:
- The commands in Vim use 12 escapes. None of them show up in lfs-commands. I vote that we get rid of Vim :) j/k I'll try to solve the issue with character escapes in the next version.
- The bottom two lines in fstab, which are not surrounded by <userinput> tags, are ignored. I will make a workaround for this in the next version.
comment:10 by , 22 years ago
New *stable* version:
http://linuxfromscratch.org/~timothy/lfscmd/lfscmd-0.3.tar.bz2
All known bugs are fixed. lfs-commands render flawlessly.
lfscmd can handle escape characters now. I suggest that lfscmd be added to the nightly maintenance work. Closing bug #177.
comment:11 by , 22 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:12 by , 22 years ago
New version: 0.4
Removed lfscmd-{check,parse} Requires filterin http://linuxfromscratch.org/~timothy/filterin Runs in ~6 seconds now.
comment:13 by , 22 years ago
Forgot to give the URL for 0.4: http://linuxfromscratch.org/~timothy/lfscmd/lfscmd-0.4.tar.bz2
comment:14 by , 22 years ago
CHANGES:
o Rewritten in C. o Depends on libxml2. o No longer requires filterin. o Works with both the LFS and BLFS books. o Can output to either stdout or files (requested by Archaic).
http://linuxfromscratch.org/~timothy/lfscmd/lfscmd-0.5.tar.bz2
comment:15 by , 22 years ago
Version increment (1.0): http://linuxfromscratch.org/~timothy/lfscmd/lfscmd-1.0.tar.bz2
if we were to do this here, we may as well do this with every package installation. I'd like to look for a better method first to extract the commands.
I'm not totally against a dedicated command instructions file, but it is a lot of work and the only reason why we'd do it, is to facilitate the lfs-commands stuff. Even with dedicated instructions files, we'd still have to strip the screen and para tags, so a script has to be created regardless. Then we better just keep it the way it is and deal with the *-inst.xml files directly.
I'm voting to close this