ubuntus
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 18 Jan 2013 16:38:18 +0000 (17:38 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 18 Jan 2013 16:38:18 +0000 (17:38 +0100)
build.common
pkgs.py
vbuild-init-vserver.sh

index 74943aa..bd689b6 100644 (file)
@@ -17,6 +17,9 @@ function pl_getDistro() {
     if [ -f "/etc/redhat-release" ] ; then
        distro=$(awk ' { print $1 } ' /etc/redhat-release)
        case $distro in Scientific*) distro="SL" ; esac
+    elif [ -f /etc/lsb-release ] ; then
+       . /etc/lsb-release
+       echo $DISTRIB_CODENAME 
     elif [ -f /etc/debian_version ] ; then
        case $(cat /etc/debian_version) in
            6.0.6) distro=squeeze ;;
@@ -60,7 +63,7 @@ function pl_getReleaseName () {
        [Ss]L*)
            releasename=sl$release
            ;;
-       squeeze|wheezy|oneiric|quantal)
+       squeeze|wheezy|oneiric|precise|quantal)
            releasename=$distro
            ;;
        *)
diff --git a/pkgs.py b/pkgs.py
index d7b2754..68ec29c 100755 (executable)
--- a/pkgs.py
+++ b/pkgs.py
@@ -40,7 +40,7 @@ known_fcdistros = [ 'centos5','centos6',
                     # debians
                     'squeeze','wheezy',
                     # ubuntus
-                    'oneiric', 'quantal' ]
+                    'oneiric', 'precise', 'quantal' ]
 default_pldistro='onelab'
 
 known_keywords=['groupname', 'groupdesc', 
index c6b38cd..100425e 100755 (executable)
@@ -85,11 +85,25 @@ function package_method () {
     fcdistro=$1; shift
     case $fcdistro in
        f[0-9]*|centos[0-9]*|sl[0-9]*) echo yum ;;
-       squeeze|wheezy|oneiric|quantal) echo debootstrap ;;
+       squeeze|wheezy|oneiric|precise|quantal) echo debootstrap ;;
        *) echo Unknown distro $fcdistro ;;
     esac 
 }
 
+# need to specify the right mirror for debian variants like ubuntu and the like
+function debian_mirror () {
+    fcdistro=$1; shift
+    case $fcdistro in
+       squeeze|wheezy) 
+           echo http://ftp2.fr.debian.org/debian/ ;;
+       oneiric|precise|quantal) 
+           echo http://mir1.ovh.net/ubuntu/ubuntu/ ;;
+       *) echo unknown distro $fcdistro; exit 1;;
+    esac
+}
+
+
+
 # return arch from debian distro and personality
 function canonical_arch () {
     personality=$1; shift
@@ -137,7 +151,8 @@ function setup_vserver () {
            ;;
        debootstrap)
            arch=$(canonical_arch $personality $fcdistro)
-           build_options="-m debootstrap -- -d $fcdistro -- --arch $arch"
+           debmirror=$(debian_mirror $fcdistro)
+           build_options="-m debootstrap -- -d $fcdistro -m $debmirror -- --arch $arch"
            ;;
        *)
            build_options="something wrong" ;;