From: Silvio Rhatto Date: Mon, 29 Dec 2025 19:51:52 +0000 (-0300) Subject: Fix: trashman: debian-backports: improved checks X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=c34d0edf06c2e4293f7d9a36f19ee4013fac4784;p=trashman.git Fix: trashman: debian-backports: improved checks --- diff --git a/share/trashman/debian-backports/unix/linux/debian/check b/share/trashman/debian-backports/unix/linux/debian/check index 1448199..c308118 100755 --- a/share/trashman/debian-backports/unix/linux/debian/check +++ b/share/trashman/debian-backports/unix/linux/debian/check @@ -1,6 +1,6 @@ #!/usr/bin/env sh # -# Check if nodejs is installed system-wide. +# Check if debian-backports is installed system-wide. # # Parameters @@ -13,6 +13,13 @@ SHARE="$1" # Custom parameters BACKPORTS="/etc/apt/sources.list/backports.list" +# Check if a backports definition is defined elsewhere +if grep "${VERSION_NAME}-backports" /etc/apt/sources.list | grep -q -v '^#'; then + exit 0 +elif grep -R "${VERSION_NAME}-backports" /etc/apt/sources.list.d | grep -q -v '^#'; then + exit 0 +fi + # Check if installed if [ -e "$BACKPORTS" ]; then exit 0 @@ -20,7 +27,7 @@ fi # Check if not installed if [ ! -e "$BACKPORTS" ]; then - exit ! + exit 1 fi # Will never run, but it's here to remember that we can check if the package is