Browse code

sources.list needs to support multiple dists - #124

Jesse Andrews authored on 2011/11/01 03:45:17
Showing 3 changed files
... ...
@@ -1,9 +1,9 @@
1
-deb http://us.archive.ubuntu.com/ubuntu/ natty main restricted
2
-deb http://us.archive.ubuntu.com/ubuntu/ natty-updates main restricted
3
-deb http://us.archive.ubuntu.com/ubuntu/ natty universe
4
-deb http://us.archive.ubuntu.com/ubuntu/ natty-updates universe
5
-deb http://us.archive.ubuntu.com/ubuntu/ natty multiverse
6
-deb http://us.archive.ubuntu.com/ubuntu/ natty-updates multiverse
7
-deb http://security.ubuntu.com/ubuntu natty-security main restricted
8
-deb http://security.ubuntu.com/ubuntu natty-security universe
9
-deb http://security.ubuntu.com/ubuntu natty-security multiverse
1
+deb http://us.archive.ubuntu.com/ubuntu/ %DIST% main restricted
2
+deb http://us.archive.ubuntu.com/ubuntu/ %DIST%-updates main restricted
3
+deb http://us.archive.ubuntu.com/ubuntu/ %DIST% universe
4
+deb http://us.archive.ubuntu.com/ubuntu/ %DIST%-updates universe
5
+deb http://us.archive.ubuntu.com/ubuntu/ %DIST% multiverse
6
+deb http://us.archive.ubuntu.com/ubuntu/ %DIST%-updates multiverse
7
+deb http://security.ubuntu.com/ubuntu %DIST%-security main restricted
8
+deb http://security.ubuntu.com/ubuntu %DIST%-security universe
9
+deb http://security.ubuntu.com/ubuntu %DIST%-security multiverse
... ...
@@ -109,6 +109,7 @@ if [ ! -e $CACHEDIR/$UEC_NAME-disk1.img ]; then
109 109
 
110 110
     # Install our required packages
111 111
     cp -p files/sources.list $MNTDIR/etc/apt/sources.list
112
+    sed -e "s,%DIST%,$DIST_NAME,g" -i $MNTDIR/etc/apt/sources.list
112 113
     cp -p /etc/resolv.conf $MNTDIR/etc/resolv.conf
113 114
     chroot $MNTDIR apt-get update
114 115
     chroot $MNTDIR apt-get install -y $MIN_PKGS
... ...
@@ -138,6 +138,7 @@ if [ -n "$CHROOTONLY" ]; then
138 138
       --addpkg=$MIN_PKGS \
139 139
 
140 140
     sudo cp -p files/sources.list $CHROOTDIR/etc/apt/sources.list
141
+    sed -e "s,%DIST%,$RELEASE,g" -i $CHROOTDIR/etc/apt/sources.list
141 142
     sudo chroot $CHROOTDIR apt-get update
142 143
 
143 144
     exit 0