Possible compressdoc enhancement

dean talbot lists at dtxs.co.uk
Mon Sep 21 05:15:04 PDT 2009


Guys, this might be a bit cheeky for the -dev list, but here goes...

I've been playing around with 'pkgutils', the Crux Linux PM software,
and while looking into modifying the manpage-compression function in
it's build-script to accommodate hard-links, i think i found a couple
of things that could shave a few cpu-cycles off of the BLFS
'compressdoc' script - as illustrated in the attached diff.

The cheeky part is this; I'm a total n00b when it comes to scripting,
and as such i would like to ask for feedback, not only on the proposed
method change, but also on the relative merits of the optional
test-constructs (the liberal comments will hopefully clarify what i
mean by that), as well as any other observations about scripting
good-practices that i might learn from.

Regarding the use of a timestamp, that's a bit of a shot-in-the-dark -
in my pkgutils use-case, i'll be able to identify modified files simply
by their suffix, and won't have a '--force' option at all.

I should also state that i haven't tested the modified script on a
working system - instead, i've tested the logic and syntax on a small
directory containing a handful of files of all the pertinent types,
using the 2nd attachment (assuming it doesn't get bounced), linktest.sh.

If any of these small modifications are deemed useful for the published
script, and you consider my request for guidance outside of a -support
list worthy under such circumstances, then i'll be pleased to have been
able to give a little something back to the community, and i thank you
in advance for your responses. ;) 

Dean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compressdoc-hlinks-mod.diff
Type: text/x-patch
Size: 2181 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-dev/attachments/20090921/bef0d816/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linktest.sh
Type: application/x-shellscript
Size: 977 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-dev/attachments/20090921/bef0d816/attachment-0001.bin>


More information about the blfs-dev mailing list