[Bug 37] Fix the kernel header situation (again)

Marc Heerdink marc_heerdink at softhome.net
Sun May 13 11:38:23 PDT 2001


Gerard Beekmans sent these bits on Sat, 12 May 2001 13:57:45 -0400:
> On Sat, May 12, 2001 at 01:45:08PM -0400, Gerard Beekmans wrote:
> > > I've changed this to "cp -a"
> > > 
> > > -a is the same as -dpR, which preserves file attributes and also leaves
> > > symlinks intact in case there are any (or if not yet, they could always
> > > appear in the future).
> > 
> > I forgot that asm was a symlink. Let's see what can be done about, while
> > still using cp -a (i'd just feel better if permissions and symlinks
> > inside linux/ and asm/ were preserved)
> 
> The command I came up with is ugly:
> 
> cp -a ../src/linux/include/`ls -l --color=none \
> ../src/linux/include/asm|cut -f 28 -d " "` asm
> 
> pretty ain't it
> 
> The cut may not work depending on how people have setup their ls, or
> aliased, or whatever. There's too much to take into account. It will
> proably more reliable when piped through awk. The point is, it it worth
> it? I just checked the include/linux and asm directories and I didn't
> see any symlinks in there. It may change, so we'd then waste a big of
> disk space.
> 
> I just don't think a complicated setup using cp, ls and awk is worth
> it in this case. I'll change it back to cp -r. If somebody has more time
> than me to find a nice solution that works in all cases, feel free to
> update cvs of course. I'm just going to concentrate on other things now,
> else pre3 will never be done.

cp -a ../src/linux/include/`file -b /usr/src/linux/include/asm |sed
s/".*asm"/asm/` asm

or

cp -a ../src/linux/include/`file -b /usr/src/linux/include/asm |sed s/"symbolic
link to "//` asm

or maybe

cp -a ../src/linux/include/`file -b /usr/src/linux/include/asm |cut -d \  -f4`
asm

Not the shortest possibility though.. but it works always.

-- 
There is no programming language, no matter how structured,
that will prevent programmers from writing bad programs.
- L. Flon

Marc Heerdink
marc_heerdink at softhome.net
http://www.koelkast.net/





More information about the lfs-book mailing list