Commit a8cc00e9 authored by Ashish Kulkarni's avatar Ashish Kulkarni Committed by Thomas Lange

fix creation of CentOS-7 chroot (#768501)

This was broken since 5d2767ab, as the
filesystem package in CentOS-7 has a symlink from /lib64 to /usr/lib64.
When extracting via cpio, this failed with the error:

    cpio: Can't write over symlinks: ./lib64/

Using the --extract-over-symlinks option allows successful creation of
the chroot environment. A check was also added to ensure that failure
to extract a package would cause the process to fail.
parent 05caa772
......@@ -1147,13 +1147,13 @@ sub unpackPackages {
# Run the unpacking command.
my $cmd =
"rpm2cpio $file | (cd $CONFIG{'directory'} ; cpio --extract --make-directories --no-absolute-filenames --preserve-modification-time) 2>/dev/null >/dev/null";
"rpm2cpio $file | (cd $CONFIG{'directory'} ; cpio --extract --extract-over-symlinks --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 );
system($cmd) == 0 or die "failed to extract $name: $?";
print "\r";
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