abort/resume package builds could be a bit more controlled

Dan Nicholson dbn.lists at gmail.com
Sun May 28 11:30:39 PDT 2006


On 5/27/06, George Boudreau <georgeb at linuxfromscratch.org> wrote:
>    I suggested to Greg Schafer, a few years ago, that you could extract
> the package directory name by 'listing the contents' and trimming the
> top entry.  I believe he ended up with the cmd DIR=$(bunzip2 -dc $1 |
> tar tf - | head -n 1 ) and then he stripped $DIR .  Would this be helpful?

I thought you guys already had that.  You have to be a little careful
with that command because the first line is not necessarily a
directory and could be prefixed with ./.  Here's the code that I
ripped off from Ryan Oliver's scripts:

PKG_DIR=$( tar -t${ZM} -f ${ARCHIVE} | head -n1 \
                | sed -e 's@^\./@@' -e 's@/.*$@@' || : )

The sed just strips down the path to surely get a directory name.  I
can't recall why I had to add the || : at the end.  I was getting
strange errors at some point.  It might not be needed.  ZM is just z
or j or nothing depending on the suffix of ARCHIVE.

--
Dan



More information about the alfs-discuss mailing list