aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2025-12-29 16:51:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2025-12-29 16:51:52 -0300
commitc34d0edf06c2e4293f7d9a36f19ee4013fac4784 (patch)
tree4f4166fd2c4557fd398a957314a2e6744ba63c91
parenta2c1d5c2db480a4c5ceb6cb0b59602d27afbbd31 (diff)
downloadtrashman-c34d0edf06c2e4293f7d9a36f19ee4013fac4784.tar.gz
trashman-c34d0edf06c2e4293f7d9a36f19ee4013fac4784.tar.bz2
Fix: trashman: debian-backports: improved checks
-rwxr-xr-xshare/trashman/debian-backports/unix/linux/debian/check11
1 files changed, 9 insertions, 2 deletions
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