Преглед на файлове

Create sources.list in a more reliable way

Bob Mottram преди 9 години
родител
ревизия
db1e6c5cfd
променени са 1 файла, в които са добавени 16 реда и са изтрити 22 реда
  1. 16
    22
      src/freedombone

+ 16
- 22
src/freedombone Целия файл

@@ -3628,34 +3628,29 @@ function search_for_attached_usb_drive {
3628 3628
     echo 'search_for_attached_usb_drive' >> $COMPLETION_FILE
3629 3629
 }
3630 3630
 
3631
-function remove_proprietary_repos {
3632
-    if grep -Fxq "remove_proprietary_repos" $COMPLETION_FILE; then
3633
-        return
3634
-    fi
3635
-    sed -i 's/ non-free//g' /etc/apt/sources.list
3636
-    echo 'remove_proprietary_repos' >> $COMPLETION_FILE
3637
-}
3638
-
3639
-function change_debian_repos {
3640
-    if grep -Fxq "change_debian_repos" $COMPLETION_FILE; then
3641
-        return
3642
-    fi
3643
-    if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
3631
+function create_repo_sources {
3632
+    if grep -Fxq "create_repo_sources" $COMPLETION_FILE; then
3644 3633
         return
3645 3634
     fi
3646 3635
     rm -rf /var/lib/apt/lists/*
3647 3636
     apt-get clean
3648
-    sed -i "s/ftp.us.debian.org/$DEBIAN_REPO/g" /etc/apt/sources.list
3649 3637
 
3650
-    # ensure that there is a security repo
3651
-    if ! grep -q "security" /etc/apt/sources.list; then
3652
-        echo "deb http://security.debian.org/ $DEBIAN_VERSION/updates main contrib" >> /etc/apt/sources.list
3653
-        echo "#deb-src http://security.debian.org/ $DEBIAN_VERSION/updates main contrib" >> /etc/apt/sources.list
3654
-    fi
3638
+    echo "deb http://$DEBIAN_REPO/debian/ jessie main" > /etc/apt/sources.list
3639
+    echo "deb-src http://ftp.uk.debian.org/debian/ jessie main" >> /etc/apt/sources.list
3640
+    echo '' >> /etc/apt/sources.list
3641
+    echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list
3642
+    echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list
3643
+    echo '' >> /etc/apt/sources.list
3644
+    echo "deb http://$DEBIAN_REPO/debian/ jessie-updates main" >> /etc/apt/sources.list
3645
+    echo "deb-src http://$DEBIAN_REPO/debian/ jessie-updates main" >> /etc/apt/sources.list
3646
+    echo '' >> /etc/apt/sources.list
3647
+    echo "deb http://$DEBIAN_REPO/debian/ jessie-backports main" >> /etc/apt/sources.list
3648
+    echo "deb-src http://$DEBIAN_REPO/debian/ jessie-backports main" >> /etc/apt/sources.list
3655 3649
 
3656 3650
     apt-get update
3657 3651
     apt-get -y install apt-transport-https
3658
-    echo 'change_debian_repos' >> $COMPLETION_FILE
3652
+    
3653
+    echo 'create_repo_sources' >> $COMPLETION_FILE
3659 3654
 }
3660 3655
 
3661 3656
 function initial_setup {
@@ -10528,8 +10523,7 @@ configure_firewall_for_sip
10528 10523
 configure_firewall_for_avahi
10529 10524
 configure_firewall_for_zeronet
10530 10525
 configure_firewall_for_ipfs
10531
-remove_proprietary_repos
10532
-change_debian_repos
10526
+create_repo_sources
10533 10527
 enable_backports
10534 10528
 configure_dns
10535 10529
 initial_setup