firmwarelists.sh: Search Contents-all for firmware too.

This commit is contained in:
Unit 193 2021-02-22 20:25:55 -05:00
parent 8a8e11e5d1
commit 21eff20ea3
1 changed files with 25 additions and 21 deletions

View File

@ -22,32 +22,36 @@ Firmware_List_From_Contents () {
local _ARCHIVE_AREA
for _ARCHIVE_AREA in ${ARCHIVE_AREAS}
do
local CONTENTS_URL="${MIRROR_CHROOT}/dists/${DISTRO_CHROOT}/${_ARCHIVE_AREA}/Contents-${LB_ARCHITECTURE}.gz"
local CONTENTS_FILEDIR="cache/contents.chroot/${DISTRO_CHROOT}/${_ARCHIVE_AREA}"
local CONTENTS_FILE="${CONTENTS_FILEDIR}/contents-${LB_ARCHITECTURE}.gz"
mkdir -p "${CONTENTS_FILEDIR}"
# Purge from cache if not wanting to use from cache, ensuring fresh copy
if [ "${LB_CACHE}" != "true" ]
then
rm -f "${CONTENTS_FILE}"
fi
local _ARCH
for _ARCH in all ${LB_ARCHITECTURE}
do
local CONTENTS_URL="${MIRROR_CHROOT}/dists/${DISTRO_CHROOT}/${_ARCHIVE_AREA}/Contents-${_ARCH}.gz"
local CONTENTS_FILE="${CONTENTS_FILEDIR}/contents-${_ARCH}.gz"
# If not cached, download
if [ ! -e "${CONTENTS_FILE}" ]
then
wget ${WGET_OPTIONS} "${CONTENTS_URL}" -O "${CONTENTS_FILE}"
fi
# Purge from cache if not wanting to use from cache, ensuring fresh copy
if [ "${LB_CACHE}" != "true" ]
then
rm -f "${CONTENTS_FILE}"
fi
local PACKAGES
PACKAGES="$(gunzip -c "${CONTENTS_FILE}" | awk '/^lib\/firmware/ { print $2 }' | sort -u )"
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} ${PACKAGES}"
# If not cached, download
if [ ! -e "${CONTENTS_FILE}" ]
then
wget ${WGET_OPTIONS} "${CONTENTS_URL}" -O "${CONTENTS_FILE}"
fi
# Don't waste disk space, if not making use of caching
if [ "${LB_CACHE}" != "true" ]
then
rm -f "${CONTENTS_FILE}"
fi
local PACKAGES
PACKAGES="$(gunzip -c "${CONTENTS_FILE}" | awk '/^lib\/firmware/ { print $2 }' | sort -u )"
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} ${PACKAGES}"
# Don't waste disk space, if not making use of caching
if [ "${LB_CACHE}" != "true" ]
then
rm -f "${CONTENTS_FILE}"
fi
done
done
}