From 9cd5068854d0d7b965d119256944473e1d9b6661 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 23 Nov 2014 12:53:38 -0500 Subject: [PATCH] Remove use of sudo from yum pre and post elements sudo is not needed, since in-chroot elements are run in the context of the root user. Furthermore, sudo in pre-install is problematic as sudo may not have been installed yet (imagine a debootstrap build) Change-Id: Ib5c7e176a90fe3b8fa9c3cd702d3d815df54f472 --- elements/yum/post-install.d/99-reset-yum-conf | 4 ++-- elements/yum/pre-install.d/01-yum-keepcache | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/elements/yum/post-install.d/99-reset-yum-conf b/elements/yum/post-install.d/99-reset-yum-conf index e875848a..6957c66e 100755 --- a/elements/yum/post-install.d/99-reset-yum-conf +++ b/elements/yum/post-install.d/99-reset-yum-conf @@ -3,5 +3,5 @@ set -eux set -o pipefail -sudo sed -i 's/keepcache=1/keepcache=0/' /etc/yum.conf -sudo sed -i 's/cachedir=\/tmp\/yum/cachedir=\/var\/cache\/yum/' /etc/yum.conf +sed -i 's/keepcache=1/keepcache=0/' /etc/yum.conf +sed -i 's/cachedir=\/tmp\/yum/cachedir=\/var\/cache\/yum/' /etc/yum.conf diff --git a/elements/yum/pre-install.d/01-yum-keepcache b/elements/yum/pre-install.d/01-yum-keepcache index 121f30f3..dbff551a 100755 --- a/elements/yum/pre-install.d/01-yum-keepcache +++ b/elements/yum/pre-install.d/01-yum-keepcache @@ -3,5 +3,5 @@ set -eu set -o pipefail -sudo sed -i 's/keepcache=0/keepcache=1/' /etc/yum.conf -sudo sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' /etc/yum.conf +sed -i 's/keepcache=0/keepcache=1/' /etc/yum.conf +sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' /etc/yum.conf