pkgs_kexcludes=$(pl_parsePkgs kexclude $fcdistro $pldistro $pkgsfile)
# get mirrors if not specified with -l
if [ -z "$mirrors" ] ; then
- mirrors=$(pl_parsePkgs mirror $fcdistro $pldistro "$pldistro.mirrors")
+ mirrorsfile=$(pl_locateDistroFile ../build/ $pldistro "$pldistro.mirrors")
+ mirrors=$(pl_parsePkgs mirror $fcdistro $pldistro $mirrorsfile)
fi
exclude_kernel=""
- [ -n "$pkgs_kexcludes" ] && exclude_kernel="exclude=$pkgs_excludes"
+ # add them manually as the output of pl_parsePkgs is line-separated
+ if [ -n "$pkgs_kexcludes" ] ; then
+ exclude_kernel="exclude="
+ for kexclude in $pkgs_kexcludes ; do
+ exclude_kernel="$exclude_kernel $kexclude"
+ done
+ fi
function mkfedora_fetch ()
{
curl --fail --silent --max-time 60 "$1"
}
- # set list of attempted locations according to releasever
- if [ $releasever -ge 7 ] ; then
- attempts="
+ # set list of attempted locations according to target distro
+ # xxx all this should go into mirroring/ somehow
+ case $pl_DISTRO in
+ Fedora)
+ if [ $releasever -ge 7 ] ; then
+ # Plain Fedora comes with a new layout
+ attempts="
+fedora/releases/$releasever/Everything/$basearch/os
linux/releases/$releasever/Everything/$basearch/os
$releasever/Everything/$basearch/os
core/$releasever/Everything/$basearch/os
linux/core/$releasever/$basearch/os
"
- else
- attempts="
- linux/core/$releasever/$basearch/os
- core/$releasever/$basearch/os
- $releasever/$basearch/os
- "
- fi
+ else
+ # Fedora Core
+ attempts="
+fedora/core/$releasever/$basearch/os
+linux/core/$releasever/$basearch/os
+core/$releasever/$basearch/os
+$releasever/$basearch/os
+"
+ fi
+ public_gpg_key=RPM-GPG-KEY-fedora
+ ;;
+ CentOS)
+ # xxx hacky for now
+ # you can use vbuild-fedora-mirror with -f centos5.1
+ # which is hard-coded in mirroring/centos as well
+ # for now I do the mapping here, mmhh
+ case $releasever in
+ 4) actual=4.6 ;;
+ 5) actual=5.1 ;;
+ *) actual=$releasever ;;
+ esac
+ attempts="
+centos/$actual/os/$basearch
+"
+ public_gpg_key=RPM-GPG-KEY-CentOS-$releasever
+ ;;
+ *)
+ echo "distro $pl_DISTRO not supported in build.common / mkfedora" ; exit 1
+ esac
echo "$0: candidate mirrors"
for mirror in $mirrors ; do
# Initialize RPM database in reference image
mkdir -p $vroot/var/lib/rpm
rpm --root $vroot --initdb
- rpm --root $vroot --import $baseurl/RPM-GPG-KEY-fedora
+ rpm --root $vroot --import $baseurl/$public_gpg_key
# Initialize yum in reference image
mkdir -p $vroot/var/cache/yum $vroot/var/log