On Mon, Aug 06, 2007 at 02:33:03PM +0100, Ken Moffat wrote:
>  I'm currently using
> 
>   DIRECTORY=`tar -tvf ${PACKAGES}/${CURRENT} | \
>    head -n 1 | awk '{ print $6 }' | sed s'@^./@@' | \
>     cut -d '/' -f 1`
> 
>  where PACKAGES points to the source code, typically /sources, and
> CURRENT contains the name of the tarball.  The sed is because some
> tarballs have contained names beginning ./ (possibly an old version
> of util-linux).  The fact is, there are loads of packages whose name

My various personal scripts use something like this. And I believe
jhalfs does the same, too. It's useful to drop the above into an
'unpack' file and move that to a bin directory in your PATH, perhaps
adding something like the following:

[ -d ${DIRECTORY} ] && rm -rf ${DIRECTORY}
tar -xf ${PACKAGES}/${CURRENT}
echo "${DIRECTORY}"

Then use unpack instead of calling tar directly.

--
JH
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to