aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-07-02 11:08:28 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-07-02 11:08:28 -0300
commit2239eb0426e6d9d8c136b18f11b49ffb5311913f (patch)
tree69ae5193aac3e1d24c957c94eb6ce0b294035942
parent043643bc53c897503539dc501da69c2a419916b8 (diff)
downloadtrashman-2239eb0426e6d9d8c136b18f11b49ffb5311913f.tar.gz
trashman-2239eb0426e6d9d8c136b18f11b49ffb5311913f.tar.bz2
Feat: trashman: adds debian-backports
-rw-r--r--IDEAS.md1
-rw-r--r--share/trashman/debian-backports/info1
-rwxr-xr-xshare/trashman/debian-backports/unix/linux/debian/check28
-rwxr-xr-xshare/trashman/debian-backports/unix/linux/debian/install27
4 files changed, 56 insertions, 1 deletions
diff --git a/IDEAS.md b/IDEAS.md
index 6e03f1b..47844a1 100644
--- a/IDEAS.md
+++ b/IDEAS.md
@@ -30,4 +30,3 @@
* [pkgutils](https://github.com/nipuL/pkgutils)
* caddy http server
* kvmx (using it's Makefile?)
- * Debian Backports (configures `/etc/apt/sources.list/backports.list`.
diff --git a/share/trashman/debian-backports/info b/share/trashman/debian-backports/info
new file mode 100644
index 0000000..ab048f3
--- /dev/null
+++ b/share/trashman/debian-backports/info
@@ -0,0 +1 @@
+configures backports repository on Debian
diff --git a/share/trashman/debian-backports/unix/linux/debian/check b/share/trashman/debian-backports/unix/linux/debian/check
new file mode 100755
index 0000000..1448199
--- /dev/null
+++ b/share/trashman/debian-backports/unix/linux/debian/check
@@ -0,0 +1,28 @@
+#!/usr/bin/env sh
+#
+# Check if nodejs is installed system-wide.
+#
+
+# Parameters
+SHARE="$1"
+
+# Include basic functions
+. $SHARE/trashman/functions || exit 1
+. $SHARE/trashman/debian || exit 1
+
+# Custom parameters
+BACKPORTS="/etc/apt/sources.list/backports.list"
+
+# Check if installed
+if [ -e "$BACKPORTS" ]; then
+ exit 0
+fi
+
+# Check if not installed
+if [ ! -e "$BACKPORTS" ]; then
+ exit !
+fi
+
+# Will never run, but it's here to remember that we can check if the package is
+# partially installed
+exit 2
diff --git a/share/trashman/debian-backports/unix/linux/debian/install b/share/trashman/debian-backports/unix/linux/debian/install
new file mode 100755
index 0000000..588c63e
--- /dev/null
+++ b/share/trashman/debian-backports/unix/linux/debian/install
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# Debian backports installer
+#
+
+# Parameters
+SHARE="$1"
+LIB="$2"
+REQUIREMENTS=""
+
+# Include basic functions
+. $LIB/trashman/functions || exit 1
+. $LIB/trashman/debian || exit 1
+
+# Requirements
+#trashman_apt_install $REQUIREMENTS
+
+# Custom parameters
+BACKPORTS="/etc/apt/sources.list/backports.list"
+VERSION_NAME="trashman_debian_major_version_name"
+
+# Install
+cat <<-EOF | tee $BACKPORTS
+# backports
+deb https://deb.debian.org/debian/ $VERSION_NAME-backports main contrib non-free
+deb-src https://deb.debian.org/debian/ $VERSION_NAME-backports main contrib non-free
+EOF