# and extract base directory name with awk.
# tar 1.23 reports an error when using pipes, so
# remove error message with "2> /dev/null"
- local DIRNAME=$(tar ${TAR_OPTS} -tf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 2> /dev/null | head -n1 | sed 's!^\./!!' | awk -F \/ '{print $1}')
+ local DIRNAME=$(tar ${TAR_OPTS} -tf \
+ ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext} 2> /dev/null | \
+ head -n1 | sed 's!^\./!!' | awk -F \/ '{print $1}')
echo ${DIRNAME}
;;
zip)