Commit 21b9f44e authored by Steve Kemp's avatar Steve Kemp

Added patch from Bruno Cornec

parent d75a64f6
......@@ -177,12 +177,12 @@ use English;
use File::Copy;
use File::Path;
use File::Find;
use File::Basename;
use Getopt::Long;
use Pod::Usage;
use LWP::UserAgent;
#
# Release number.
#
......@@ -576,7 +576,7 @@ sub cleanCache
=begin doc
Return the list of packagse which are required for a basic
Return the list of packages which are required for a basic
installation of the specified distribution.
These packages are located in the configuration file in /etc/rinse.
......@@ -800,7 +800,7 @@ sub downloadPackagesToDirectory
#
# Count of links, and the currently active download.
# Count of links, and the currently active download.
# Used purely for the status updates..
#
my $count = 0;
......@@ -1048,6 +1048,9 @@ sub unpackPackages
my @rpms = glob( $dir . "/*.rpm" );
@rpms = sort {lc($a) cmp lc($b)} @rpms;
# Command to execute after extraction
my $postcmd = "";
#
# For each RPM file: convert to .tgz
#
......@@ -1079,6 +1082,12 @@ sub unpackPackages
#
my $cmd =
"rpm2cpio $file | (cd $CONFIG{'directory'} ; cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>/dev/null >/dev/null";
if ( $file =~ /(fedora|centos|redhat|mandriva)-release-/ )
{
my $rpmname = basename($file);
$postcmd =
"cp $file $CONFIG{'directory'}/tmp ; chroot $CONFIG{'directory'} rpm -ivh --force --nodeps /tmp/$rpmname ; rm $CONFIG{'directory'}/tmp/$rpmname";
}
system($cmd );
$CONFIG{ 'verbose' } && print "+extract $file\n";
......@@ -1087,6 +1096,18 @@ sub unpackPackages
print " " x $CONFIG{ 'width' };
print "\n";
#
# In order to be setup correctly, yum needs an installed package
# providing distroverpkg this is provided by a *-release package
# such as redhat-release, centos-release, fedora-release ...
#
# So here we force the install with rpm of the one we previously found
#
if ( $postcmd ne "" )
{
system($postcmd);
$CONFIG{ 'verbose' } && print "+execute $postcmd\n";
}
}
......
......@@ -23,82 +23,6 @@ fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Setup yum.conf
#
arch=i386
if [ $ARCH = "amd64" ] ; then
arch=x86_64
fi
cat >>${prefix}/etc/yum.conf <<EOF
[base]
name=CentOS-4.6 - Base
mirrorlist=http://mirrorlist.centos.org/?release=4.6&arch=$arch&repo=os
baseurl=http://mirror.centos.org/centos/4.6/os/$arch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1
enabled=1
#released updates
[update]
name=CentOS-4.6 - Updates
mirrorlist=http://mirrorlist.centos.org/?release=4.6&arch=$arch&repo=updates
baseurl=http://mirror.centos.org/centos/4.6/updates/$arch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1
enabled=1
#packages used/produced in the build but not released
[addons]
name=CentOS-4.6 - Addons
mirrorlist=http://mirrorlist.centos.org/?release=4.6&arch=$arch&repo=addons
baseurl=http://mirror.centos.org/centos/4.6/addons/$arch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1
#additional packages that may be useful
[extras]
name=CentOS-4.6 - Extras
mirrorlist=http://mirrorlist.centos.org/?release=4.6&arch=$arch&repo=extras
baseurl=http://mirror.centos.org/centos/4.6/extras/$arch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-4.6 - Plus
mirrorlist=http://mirrorlist.centos.org/?release=4.6&arch=$arch&repo=centosplus
baseurl=http://mirror.centos.org/centos/4.6/centosplus/$arch/
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1
#contrib - packages by Centos Users
[contrib]
name=CentOS-4.6 - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=4.6&arch=$arch&repo=contrib
baseurl=http://mirror.centos.org/centos/4.6/contrib/$arch/
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1
EOF
#
# 4. Run "yum install yum".
#
......
......@@ -10,12 +10,6 @@ if [ ! -d "${prefix}" ]; then
exit
fi
arch=i386
if [ $ARCH = "amd64" ] ; then
arch=x86_64
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
......@@ -34,11 +28,6 @@ for i in ${prefix}/usr/lib/python2.4/site-packages/urlgrabber/keepalive.*; do
mv $i ${prefix}/usr/lib/python2.4/site-packages/urlgrabber.skx/
done
# 3.6 BUGFIX: yumrepo
echo "BUGFIX: yumrepo"
chroot ${prefix} sed -i s/\$releasever/5/g /etc/yum.repos.d/CentOS-Base.repo
chroot ${prefix} sed -i s/\$basearch/$arch/g /etc/yum.repos.d/CentOS-Base.repo
#
#
# 4. Run "yum install yum".
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment