attempt to generate correct yum.conf in myplc chroot
Thierry Parmentelat [Thu, 10 Jan 2008 11:36:13 +0000 (11:36 +0000)]
build.functions

index 8ab1c7e..732392c 100644 (file)
@@ -46,11 +46,46 @@ set -e
 # Be verbose
 set -x
 
+# this is fragile, as the actual layout may vary from one mirror to the other
+# however this should be in line with the layouts obtained 
+# when running build/vbuild-fedora-mirror.sh
+
+function yum_conf_fedora_core () {
+    BUILD_HOST=$1; shift
+    cat <<EOF
+[base]
+name=${pl_DISTRO_NAME} - base
+baseurl=http://${BUILD_HOST}/fedora/linux/core/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/os/
+
+
+[updates]
+name=${pl_DISTRO_NAME} - updates
+baseurl=http://${BUILD_HOST}/fedora/linux/core/updates/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
+
+
+[extras]
+name=${pl_DISTRO_NAME} - extras
+baseurl=http://${BUILD_HOST}/fedora/linux/extras/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
+EXTRAS
+EOF
+}
+
+function yum_conf_fedora () {
+    BUILD_HOST=$1; shift
+    cat <<EOF
+[base]
+name=${pl_DISTRO_NAME} - base
+baseurl=http://${BUILD_HOST}/fedora/linux/releases/${pl_DISTRO_RELEASE}/Everything/${pl_DISTRO_ARCH}/os/
+
+[updates]
+name=${pl_DISTRO_NAME} - base
+baseurl=http://${BUILD_HOST}/fedora/linux/updates/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
+EOF
+}
+
 function yum_conf_to_build_host () {
    BUILD_HOST=$(hostname)
 
-   case "$pl_DISTRO" in
-       Fedora)
           cat <<EOF
 [main]
 cachedir=/var/cache/yum
@@ -67,25 +102,18 @@ gpgcheck=0
 # (e.g., from /etc/yum.repos.d/)
 reposdir=/dev/null
 
-[base]
-name=${pl_DISTRO_NAME} - base
-baseurl=http://${BUILD_HOST}/fedora/linux/core/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/os/
-
-
-[updates]
-name=${pl_DISTRO_NAME} - updates
-baseurl=http://${BUILD_HOST}/fedora/linux/core/updates/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
-
-$(if [ "${pl_DISTRO_RELEASE}" -le 6 ] ; then cat << EXTRAS
-[extras]
-name=${pl_DISTRO_NAME} - extras
-baseurl=http://${BUILD_HOST}/fedora/linux/extras/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
-EXTRAS
-fi)
 EOF
+
+   case "$pl_DISTRO" in
+       Fedora)
+          if [ "${pl_DISTRO_RELEASE}" -le 6 ] ; then 
+              yum_conf_fedora_core $BUILD_HOST
+          else
+              yum_conf_fedora $BUILD_HOST
+          fi
     ;;
        *)
-          echo "$0: no support for this distribution $pl_DISTRO"
+          echo "$0: no support for tuning yum.conf on this distribution $pl_DISTRO"
           exit 1
           ;;
    esac