From db1e6c5cfdb414d89ddd90d9370d5daee2706432 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Feb 2016 11:49:18 +0000 Subject: [PATCH] Create sources.list in a more reliable way --- src/freedombone | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/freedombone b/src/freedombone index 21972749..70411c93 100755 --- a/src/freedombone +++ b/src/freedombone @@ -3628,34 +3628,29 @@ function search_for_attached_usb_drive { echo 'search_for_attached_usb_drive' >> $COMPLETION_FILE } -function remove_proprietary_repos { - if grep -Fxq "remove_proprietary_repos" $COMPLETION_FILE; then - return - fi - sed -i 's/ non-free//g' /etc/apt/sources.list - echo 'remove_proprietary_repos' >> $COMPLETION_FILE -} - -function change_debian_repos { - if grep -Fxq "change_debian_repos" $COMPLETION_FILE; then - return - fi - if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then +function create_repo_sources { + if grep -Fxq "create_repo_sources" $COMPLETION_FILE; then return fi rm -rf /var/lib/apt/lists/* apt-get clean - sed -i "s/ftp.us.debian.org/$DEBIAN_REPO/g" /etc/apt/sources.list - # ensure that there is a security repo - if ! grep -q "security" /etc/apt/sources.list; then - echo "deb http://security.debian.org/ $DEBIAN_VERSION/updates main contrib" >> /etc/apt/sources.list - echo "#deb-src http://security.debian.org/ $DEBIAN_VERSION/updates main contrib" >> /etc/apt/sources.list - fi + echo "deb http://$DEBIAN_REPO/debian/ jessie main" > /etc/apt/sources.list + echo "deb-src http://ftp.uk.debian.org/debian/ jessie main" >> /etc/apt/sources.list + echo '' >> /etc/apt/sources.list + echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list + echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list + echo '' >> /etc/apt/sources.list + echo "deb http://$DEBIAN_REPO/debian/ jessie-updates main" >> /etc/apt/sources.list + echo "deb-src http://$DEBIAN_REPO/debian/ jessie-updates main" >> /etc/apt/sources.list + echo '' >> /etc/apt/sources.list + echo "deb http://$DEBIAN_REPO/debian/ jessie-backports main" >> /etc/apt/sources.list + echo "deb-src http://$DEBIAN_REPO/debian/ jessie-backports main" >> /etc/apt/sources.list apt-get update apt-get -y install apt-transport-https - echo 'change_debian_repos' >> $COMPLETION_FILE + + echo 'create_repo_sources' >> $COMPLETION_FILE } function initial_setup { @@ -10528,8 +10523,7 @@ configure_firewall_for_sip configure_firewall_for_avahi configure_firewall_for_zeronet configure_firewall_for_ipfs -remove_proprietary_repos -change_debian_repos +create_repo_sources enable_backports configure_dns initial_setup