Handle CN upgrade.
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Fri, 3 Feb 2012 10:22:27 +0000 (11:22 +0100)
committerValentin Vidic <Valentin.Vidic@CARNet.hr>
Fri, 3 Feb 2012 10:22:27 +0000 (11:22 +0100)
files/etc/apt/sources.list.template [moved from files/etc/apt/sources.list with 100% similarity]
src/functions.sh

index f690377..fa0406b 100644 (file)
@@ -500,7 +500,12 @@ install_new () {
 create_sources_list () {
     local sl sl_new
     sl=/etc/apt/sources.list
-    sl_new=/usr/share/carnet-upgrade/files/etc/apt/sources.list
+    sl_new=$( copy_template $sl )
+
+    # comment aai repository if not in use
+    if ! pkg srce-keyring; then
+        sed -i 's/^\(deb.*ftp.srce.hr\)/#\1/' $sl_new
+    fi
 
     # check if already installed
     if ! cmp $sl $sl_new >/dev/null; then
@@ -516,8 +521,9 @@ create_sources_list () {
 
 `cat /etc/apt/sources.list`"
     fi
-}
 
+    rm $sl_new
+}
 
 # funkcija koja brise grupu proc
 remove_group_proc () {
@@ -782,9 +788,14 @@ apt_listchanges () {
 
 # make a silent installation of carnet and srce keyrings
 install_keyrings () {
-  pkgadd carnet-keyring srce-keyring debian-archive-keyring
+  pkgadd carnet-keyring debian-archive-keyring
+  dpkg-reconfigure carnet-keyring debian-archive-keyring
+
+  if pkg srce-keyring; then
+    pkgadd srce-keyring
+    dpkg-reconfigure srce-keyring
+  fi
 
-  dpkg-reconfigure carnet-keyring srce-keyring debian-archive-keyring
   apt_update
 }