Fix bugs in update_packages.
This commit is contained in:
parent
7aaf92ea89
commit
46cb0d2d32
1 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue