Git configuration

Dominic Ringuet dringuet at gmail.com
Fri Feb 19 15:28:07 PST 2010


On Fri, Feb 19, 2010 at 8:48 AM, Andrew Benton <b3nton at gmail.com> wrote:

> ...
>

Hello world exit status:

Sorry if my solution sounds awful, it doesn't include the use of git, only
bash scripts.

First, I use a makefile which creates my bash scripts from xml then this
bash script is copied to ".orig". Otherwordly, it ends up with 3 files eg:
LFS/chapter06/bash.xml, .../bash.sh and .../bash.orig. Note: If bash.patch
is present, then bash.sh is patched accordingly.

Second, vim is embeded within a simple script. So if I type "./pkman -e
bash" (it takes chapter 6 as default, unless I specify "./pkman -e
chapter05/bash"), then  it vims LFS/chapter06/bash.sh and upon exit it
produces a diff comparing bash.orig and the recently modified bash.sh, thus
adding bash.patch to the lot.

Third, let's specify that the way I wanted the things done, a single
configuration file is required as user's input. The beauty for the lazy man
here is that you edit this file to set hostname, ip and the likes. Then you
start compilation without interventions until the passwords of root and the
default user (set within this config file) are asked at the end of the
build. Also whenever the tag <replaceable> is met when converting xml to
bash, it is replaced with something like:
${CELVAR_CHAPTERX_WHATEVER_TOKEN_MADE_FROM_THE_LITERAL_STRING}. This
variable name, if not existing within the config file is then appended to
it, prompting me to enter the value for future reference. Now, I'm reaching,
let's get back to main topic.

Before starting, I move whatever is found within ./sources/ to
./sources.old/ then when a file is required, it is moved from ./sources.old/
to ./sources/ else if the file is not found, it procedes with wget. This is
my way to repel the bloat. When moving to a new host, I simply edit my
config file and move over my ./sources/ directory. I used to simply delete
sources.old at the end of the build, but now it is kept around for some
spooky situations. Still you could always:

#!/bin/bash
# For convenience since my bash is far better than my english.

SIZE=`du -s ./sources.old/|cut -f 1`
MAXS="3000000"

if [ "$SIZE" -gt "$MAXS" ]; then rm -fr ./sources.old/*; fi

#EOF

# I don't know if it's readable, let's hope that helps somehow.
# Dominic.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-support/attachments/20100219/1e512003/attachment.html>


More information about the blfs-support mailing list