- if [ ! -f ${LFS_PKG_DIR}/${TARGET}.tar.bz2 ]; then
- fpkg ${SOURCE} ${URL}
-
- if [ -f ${LFS_PKG_DIR}/${SOURCE}.tar.bz2 ]; then
- mv ${LFS_PKG_DIR}/${SOURCE}.tar.bz2 ${LFS_PKG_DIR}/${TARGET}.tar.bz2
+ DEST_FILE=${DEST_DIR}/${PACK}.${FINAL_EXT}
+
+ if [ ! -f ${DEST_FILE} ]; then
+ set +e
+ static_getpkg ${SRC_FILENAME} ${URL} ${FILE_EXT}
+ set -e
+
+ # Move file if source filename is not equal to package name and/or destination
+ # directory is not the default:
+ DOWNLOADED_FILE=${LFS_PKG_DIR}/${SRC_FILENAME}.${FINAL_EXT}
+
+ if [ "${DEST_FILE}" != "${DOWNLOADED_FILE}" ]; then
+ mv ${DOWNLOADED_FILE} ${DEST_FILE}