yum.conf created from build/mirroring
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sat, 22 Mar 2008 16:29:22 +0000 (16:29 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sat, 22 Mar 2008 16:29:22 +0000 (16:29 +0000)
build.functions
build.sh

index cd9a80d..33fe4b7 100644 (file)
@@ -50,43 +50,11 @@ set -x
 # 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)
+    build_dir=$1; shift
+    BUILD_HOST=$(hostname)
 
-          cat <<EOF
+    cat <<EOF
 [main]
 cachedir=/var/cache/yum
 debuglevel=2
@@ -104,19 +72,12 @@ reposdir=/dev/null
 
 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 tuning yum.conf on this distribution $pl_DISTRO"
-          exit 1
-          ;;
-   esac
+    template=$build_dir/mirroring/${pl_DISTRO_NAME}/yum.repos.d/building.repo.in
+    if [ ! -f $template ] ; then
+       echo "# MyPLC/$0: cannot find template $template"
+    else
+       sed -e s,@MIRRORURL@,http://${BUILD_HOST}/mirror/, $template
+    fi
 }
 
 # quick and dirty - might break anytime if docbook html output changes
index 4cb08f4..c05b1c6 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -97,7 +97,7 @@ install -m 444 myplc-release root/etc/myplc-release
 # so we can use the build's fc4 mirror for various installs/upgrades
 # within the chroot jail
 # yum_conf_to_build_host is defined in build.functions
-yum_conf_to_build_host > root/etc/yum.conf
+yum_conf_to_build_host ../build > root/etc/yum.conf
 
 ### Thierry Parmentelat - july 20 2007
 # we now build the myplc doc