List Info

Thread: Code consolidation




Code consolidation
user name
2006-08-07 17:52:03
Dan Nicholson wrote:
> On 8/5/06, George Boudreau <georgeblinuxfromscratch.org> wrote:
>>
>>    If you wander through the file, you notice many
instances of 'near'
>> duplication. I had fallen into the bad habit of
optimizing the bash
>> scripts and not applying the same diligence to the
final output. I am
>> suggesting, for jhalfs-2.0, that some time be spent
on analyzing the
>> Makefile with an eye to consolidating some of these
'near' duplicate
>> functions into the makefile-functions file.
> 
> This is definitely what I had in mind. The Makefile is
a jumble, so if
> any issue crops up, you basically have to hand hack it.
IMO, there
> should be more use of variables in the Makefile. I'm
not make expert,
> but it shouldn't be too hard to cut down the
redundancy considerably.
> I see things like this:
> 
>        ( time { su - lfs -c "source /home/lfs/.bashrc
&&
>
/mnt/lfs/jhalfs/lfs-commands/chapter05/028-binutils-pass1&q
uot;
>>> logs/028-binutils-pass1 2>&1 ; } )
2>>logs/028-binutils-pass1 && \
>        echo -e "\nKB: `du -skx --exclude=jhalfs
$(MOUNT_PT)`\n"
>>> logs/028-binutils-pass1
> 
> And immediately, I think this could be simplified
considerably.
> 
> BASEDIR = /mnt/lfs/jhalfs
> CMDSDIR = $(BASEDIR)/lfs-commands
> SU_LUSER = su - $(LUSER) -c
> PRT_DU = echo -e "\nKB: `du -skx
--exclude=jhalfs $(MOUNT_PT)`\n"
> LUSER_HOME = /home/$(LUSER)
> 
> I also believe that the current target is $^ in make. I
stole that
> from the Mozilla Makefiles.
> 
> That would reduce the above to something like
> 
>    ( time { $(SU_LUSER) "source
$(LUSER_HOME)/.bashrc &&
>        $(CMDSDIR)/chapter05/$^" >> logs/$^
2>&1; } ) 2 >> logs/$^ &&
>        $(PRT_DU) >> logs/$^
> 
> Just a quick hack. I'm sure it could be better.
> 

   I like the ideas you put forth, it does compress the cmd
string 
nicely. I will spend the next week working on code
compression in both 
the output Makefile as well as common-functions.

>>    Although the majority of the users will never
look at Makefile and
>> this effort will not produce one iota of speed
improvement, I believe
>> readability is a precursor to maintainability.
> 
> Absolutely. Making the code more readable is paramount
to getting
> people to understand it. This also allows for people to
easily change
> what's happening in special situations.
> 
   Manuel, I do not think we need an 'official'
announcement on the 
feature freeze as there are very little interest/suggestions
coming from 
the mailing list. If we receive a request we could make a
general 
statement about the freeze at that point.

> -- 
> Dan
> 

  A general note.. I wrote a Config.in generator for BLFS.
It creates a 
fully populated config file from the packages files. I
don't know if 
this will be useful for BLFS and I may keep it as a testing
tool. (I am 
still looking at BLFS, Manuel  )
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Code consolidation
user name
2006-08-07 18:00:29
El Lunes, 7 de Agosto de 2006 19:52, George Boudreau
escribió:

>    I like the ideas you put forth, it does compress the
cmd string
> nicely. I will spend the next week working on code
compression in both
> the output Makefile as well as common-functions.

See my post in the "jhalfs: why su - (user)"
thread.

The implementation of something like that could be a very
good opportunity to 
make the code clean-up.

>    Manuel, I do not think we need an 'official'
announcement on the
> feature freeze as there are very little
interest/suggestions coming from
> the mailing list. If we receive a request we could make
a general
> statement about the freeze at that point.

Well, with this comment the features freeze is already
announced 

>   A general note.. I wrote a Config.in generator for
BLFS. It creates a
> fully populated config file from the packages files. I
don't know if
> this will be useful for BLFS and I may keep it as a
testing tool. (I am
> still looking at BLFS, Manuel  )

Great. 

I will take another look/test at $LUSER and menuconfig code
before go back to 
BLFS.

-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:       http://www.linuxfroms
cratch.org
LFS en castellano: http://www.escomp
oslinux.org/lfs-es http://www.lfs-es.info
TLDP-ES:                           http://es.tldp.org
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Code consolidation
user name
2006-08-07 20:44:52
El Lunes, 7 de Agosto de 2006 19:52, George Boudreau
escribió:

>
>   A general note.. I wrote a Config.in generator for
BLFS. It creates a
> fully populated config file from the packages files. I
don't know if
> this will be useful for BLFS and I may keep it as a
testing tool. (I am
> still looking at BLFS, Manuel  )

That generator depends on the current BLFS entries on
Config.in?

I'm revising Config.in to try to make each book selection
to output only their 
current config options (test suites and comparassion runs,
for example) and I 
would to know if the BLFS entry can be commented-out until
have their master 
script ready.

-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:       http://www.linuxfroms
cratch.org
LFS en castellano: http://www.escomp
oslinux.org/lfs-es http://www.lfs-es.info
TLDP-ES:                           http://es.tldp.org
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
Code consolidation
user name
2006-08-07 21:53:25
M.Canales.es wrote:
> El Lunes, 7 de Agosto de 2006 19:52, George Boudreau
escribió:
> 
>>   A general note.. I wrote a Config.in generator
for BLFS. It creates a
>> fully populated config file from the packages
files. I don't know if
>> this will be useful for BLFS and I may keep it as a
testing tool. (I am
>> still looking at BLFS, Manuel  )
> 
> That generator depends on the current BLFS entries on
Config.in?
> 
> I'm revising Config.in to try to make each book
selection to output only their 
> current config options (test suites and comparassion
runs, for example) and I 
> would to know if the BLFS entry can be commented-out
until have their master 
> script ready.
> 
   Yes.. comment out the BLFS sections.. those entries were
just a trial.

-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discu
ss
FAQ: http://www.linux
fromscratch.org/faq/
Unsubscribe: See the above information page
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )