Skip to content

Commit a6de1df

Browse files
authored
Merge pull request #20 from adapowers/patch-1
cleanup(): Multiple match resilience
2 parents a30dff8 + 4842db7 commit a6de1df

File tree

1 file changed

+2
-2
lines changed
  • source/usr/local/emhttp/plugins/un-get

1 file changed

+2
-2
lines changed

source/usr/local/emhttp/plugins/un-get/un-get

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ cleanup() {
441441
PACKAGE_LIST_INSTALLED="$(cat /boot/config/plugins/un-get/installedpackages_list)"
442442
for p in ${BOOT_PKGS}
443443
do
444-
if [ ! $(grep ${p%.*} <<< "${INSTALLED_PKGS}") ]; then
444+
if [ $(grep "${p%.*}" <<< "${INSTALLED_PKGS}" | wc -l) -eq 0 ]; then
445445
if [ -z "${CLEANUP_LIST}" ]; then
446446
CLEANUP_LIST="${p}"
447447
else
@@ -464,7 +464,7 @@ cleanup() {
464464
echo "Please wait, checking if package list is up-to-date...!"
465465
for p in ${PACKAGE_LIST_INSTALLED}
466466
do
467-
if [ ! $(grep ${p%.*} <<< "${INSTALLED_PKGS}") ]; then
467+
if [ $(grep "${p%.*}" <<< "${INSTALLED_PKGS}" | wc -l) -eq 0 ]; then
468468
sed -i "/$p/d" /boot/config/plugins/un-get/installedpackages_list
469469
fi
470470
done

0 commit comments

Comments
 (0)