Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
- fixed bug in update routine where some packages won't update properly
  • Loading branch information
ich777 committed Oct 2, 2022
1 parent c907c2d commit 06c7b2d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions source/usr/local/emhttp/plugins/un-get/un-get
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ install() {
if [[ "$response" =~ ^(yes|y)$ ]]; then
for p in ${PACKAGE_LIST}
do
PACKAGE="$(grep -R -H -i -w "$p-[0-9]\+" /tmp/un-get/ | awk '{print $1, $8}' | grep -E ".tbz|.tlz|.tgz|.txz" | grep -v -E ".*\.asc|.*\.md5" | cut -d '.' -f1- | sort -V | tail -1)"
PACKAGE="$(grep -R -H -i -w "$p-[0-9]\+" /tmp/un-get/ | awk '{print $1, $8}' | grep -E ".tbz|.tlz|.tgz|.txz" | grep -v -E ".*\.asc|.*\.md5" | cut -d '.' -f1- | sort -V | grep -v "\-$p-[0-9]\+" | tail -1)"
TOP_URL="$(awk '{print $2}' <<< ${PACKAGE} | sed 's/^[.]//')"
REPO_LINE="$(awk '{print $2}' /boot/config/plugins/un-get/sources.list | grep -n "$(awk '{print $1}' <<< "${PACKAGE}" | cut -d ':' -f1 | sed 's:.*-::' | sort -V | tail -1)" | cut -d ':' -f1)"
URL="$(awk -v line=$REPO_LINE 'NR==line' /boot/config/plugins/un-get/sources.list | awk '{print $1}' | sed 's:/*$::')"
download_package "$p" "${URL}" "${TOP_URL}"
done
for p in ${PACKAGE_LIST}
do
PACKAGE="$(grep -R -H -i -w "$p-[0-9]\+" /tmp/un-get/ | awk '{print $1, $8}' | grep -E ".tbz|.tlz|.tgz|.txz" | grep -v -E ".*\.asc|.*\.md5" | cut -d '.' -f1- | sort -V | tail -1)"
PACKAGE="$(grep -R -H -i -w "$p-[0-9]\+" /tmp/un-get/ | awk '{print $1, $8}' | grep -E ".tbz|.tlz|.tgz|.txz" | grep -v -E ".*\.asc|.*\.md5" | cut -d '.' -f1- | sort -V | grep -v "\-$p-[0-9]\+" | tail -1)"
REPO_LINE="$(awk '{print $2}' /boot/config/plugins/un-get/sources.list | grep -n "$(awk '{print $1}' <<< "${PACKAGE}" | cut -d ':' -f1 | sed 's:.*-::' | sort -V | tail -1)" | cut -d ':' -f1)"
REPO="$(awk -v line=$REPO_LINE 'NR==line' /boot/config/plugins/un-get/sources.list | awk '{print $2}')"
PACKAGE_NAME="$(grep "/$p-[0-9]" <<< "${PACKAGES_AVAILABLE}" | sort -V | tail -1)"
Expand All @@ -272,14 +272,15 @@ upgrade() {
for p in ${INSTALLED_PACKAGES}
do
AVAIL_V="$(grep -w "${p%-*-*-*}-[0-9]" <<< $PACKAGES_AVAILABLE)"
COMPARE="${AVAIL_V##*/}
SORT_V="$(echo "$AVAIL_V" | rev | cut -d '/' -f1 | rev | sort -V | tail -1)"
COMPARE="${SORT_V##*/}
${p}"
SORTED="$(sort -V <<< "$COMPARE" | tail -1)"
if [ "${p}" != "${SORTED}" ]; then
if [ ! -z "${UPGRADE_PACKAGES}" ]; then
UPGRADE_PACKAGES="${UPGRADE_PACKAGES} ${SORTED%-*-*-*}"
else
UPGRADE_PACKAGES="${SORTED%-*-*-*}"
UPGRADE_PACKAGES="${SORTED%-*-*-*}"
fi
fi
done
Expand Down Expand Up @@ -448,8 +449,8 @@ usage_remove() {

version() {
echo "Written by Christoph Hummer for unRAID."
echo "Version: 0.14"
echo "Date: 2022-09-25"
echo "Version: 0.16"
echo "Date: 2022-10-02"
echo "Dual-licensed under MIT or UNLICENSE."
exit 0
}
Expand Down Expand Up @@ -575,6 +576,18 @@ changelog() {
echo
echo "- fixed bug where some packages would not install properly"
echo "- fixed bug where some packages are not found properly"
echo "----------------------------------------"
echo
echo "Version: 0.15"
echo "Date: 2022-09-26"
echo
echo "- fixed bug where some packages would not download/install properly"
echo "----------------------------------------"
echo
echo "Version: 0.16"
echo "Date: 2022-10-02"
echo
echo "- fixed bug in update routine where some packages won't update properly"
}

if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
Expand Down

0 comments on commit 06c7b2d

Please sign in to comment.