Preserve env when calling yum with sudo

In particular we need [http|https]_proxy to be preserved.

Change-Id: I5bcd1b1deac917a1be8d8155f1283e330e3d5862
This commit is contained in:
Derek Higgins 2015-10-16 17:32:35 +01:00
parent 2ed4c1d860
commit 63641aa2ce

View File

@ -80,7 +80,7 @@ function _install_pkg_manager {
sudo sed -i "s,/etc/pki/rpm-gpg,$TARGET_ROOT/etc/pki/rpm-gpg,g" \
$TARGET_ROOT/etc/yum.repos.d/*repo
sudo yum -y \
sudo -E yum -y \
--setopt=cachedir=$YUM_CACHE/$ARCH/$DIB_RELEASE \
--setopt=reposdir=$TARGET_ROOT/etc/yum.repos.d \
--installroot $TARGET_ROOT \
@ -121,8 +121,8 @@ else
fi
# bootstrap the environment within the chroot
sudo chroot $TARGET_ROOT ${YUM} makecache
sudo chroot $TARGET_ROOT ${YUM} -y \
sudo -E chroot $TARGET_ROOT ${YUM} makecache
sudo -E chroot $TARGET_ROOT ${YUM} -y \
--setopt=cachedir=/tmp/yum/$ARCH/$DIB_RELEASE \
install passwd findutils sudo util-linux-ng