Fix bugs in update_packages.

This commit is contained in:
fewtarius 2023-03-14 07:53:45 -04:00
parent 7aaf92ea89
commit 46cb0d2d32
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A

View file

@ -36,8 +36,12 @@ update_packages() {
if [ "${UPS_VERSION}" == "${PKG_VERSION}" ]; then
echo "${PKG_NAME} is up to date (${UPS_VERSION})"
else
echo "${PKG_NAME} updated from ${PKG_VERSION} to ${UPS_VERSION}"
sed -i "s/PKG_VERSION=\"${PKG_VERSION}/PKG_VERSION=\"${UPS_VERSION}/" $f
if [ "${UPS_VERSION}" ]; then
echo "${PKG_NAME} updated from ${PKG_VERSION} to ${UPS_VERSION}"
sed -i "s/PKG_VERSION=\"${PKG_VERSION}/PKG_VERSION=\"${UPS_VERSION}/" $f
else
echo "Could not find version, not updating ${PKG_NAME}."
fi
fi
if [[ ! "${PKG_URL}" =~ git$ ]]
@ -49,9 +53,9 @@ update_packages() {
source "${f}"
./scripts/get "${PKG_NAME}" >/dev/null
if [ "${p}" != "linux" ]; then
SHA=$(cat ./${SOURCES}/${PKG_NAME}/${PKG_NAME}-${UPS_VERSION}.*.sha256 ||:)
SHA=$(cat ./${SOURCES}/${PKG_NAME}/${PKG_NAME}-${UPS_VERSION}.*.sha256 2>/dev/null ||:)
else
SHA=$(cat ./${SOURCES}/${PKG_NAME}/linux-$LINUX-${UPS_VERSION}.tar.gz.sha256 ||:)
SHA=$(cat ./${SOURCES}/${PKG_NAME}/linux-$LINUX-${UPS_VERSION}.tar.gz.sha256 2>/dev/null ||:)
fi
sed -e "/PKG_VERSION=\"${UPS_VERSION}\"/{ N; s/PKG_VERSION=\"${UPS_VERSION}\".*PKG_SHA256=\"\"/PKG_VERSION=\"${UPS_VERSION}\"\nPKG_SHA256=\"${SHA}\"/;}" -i ${f}
else