summaryrefslogtreecommitdiff
path: root/share/hydractl/backports
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-01-04 18:54:06 -0200
committerSilvio Rhatto <rhatto@riseup.net>2012-01-04 18:54:06 -0200
commit1353450a26011ec5f7839f8e8626a099e4b26d21 (patch)
treec962e95e7874fba64eeb8c335b55ef65ef22b376 /share/hydractl/backports
parentd3c35a86ed5b65abda550551dae914708ceda827 (diff)
downloadhydra-1353450a26011ec5f7839f8e8626a099e4b26d21.tar.gz
hydra-1353450a26011ec5f7839f8e8626a099e4b26d21.tar.bz2
Fixing backports subcommand
Diffstat (limited to 'share/hydractl/backports')
-rwxr-xr-xshare/hydractl/backports13
1 files changed, 8 insertions, 5 deletions
diff --git a/share/hydractl/backports b/share/hydractl/backports
index 61a7b88..44437dd 100755
--- a/share/hydractl/backports
+++ b/share/hydractl/backports
@@ -1,10 +1,13 @@
#!/bin/bash
#
-# Add backports to souces.list.
+# Add backports to sources.list.
#
-# TODO: check backports key signature
-if ! grep -q -e "^deb http://backports.debian.org/debian"; then
- echo "deb http://backports.debian.org/debian-backports lenny-backports main contrib non-free" >> /etc/apt/sources.list
- apt-get update ; apt-get install debian-backports-keyring ; apt-get update
+# Get distro codename.
+DISTRO="`lsb_release -cs`"
+
+# Add backports reference if needed.
+if ! grep -q -e "^deb http://backports.debian.org/debian" /etc/apt/sources.list; then
+ echo "deb http://backports.debian.org/debian-backports $DISTRO-backports main contrib non-free" >> /etc/apt/sources.list
+ apt-get update
fi