Fix download_mirror.sh without -n
download_mirror.sh fails when run without '-n'. It seems that some functions were relocated to utils.sh that require the 'SUDO' variable to be defined. Those common utilities are called from both download_mirror.sh and dl_rpms.sh. download_mirror.sh sets it correctly, but dl_rpms.sh does not. Instead dl_rpms.sh is setting 'SUDOCMD', which the utils.sh ignores. The result is that some yum commands are runs under sudo, while others are not. Eventually yumdownloader failes with ... Permission denied: '/var/lib/rpm/.dbenv.lock' The fix is to convert dl_rpms.sh to use SUDO rather than SUDOCMD. Closes-Bug: 1980684 Signed-off-by: Scott Little <scott.little@windriver.com> Change-Id: Ib4afdba0260e67f06997c360272f40f28fb11834
This commit is contained in:
parent
a206f96446
commit
5f8fc4e7b3
@ -11,7 +11,7 @@
|
|||||||
# By default, we use "sudo" and we don't use a local yum.conf. These can
|
# By default, we use "sudo" and we don't use a local yum.conf. These can
|
||||||
# be overridden via flags.
|
# be overridden via flags.
|
||||||
|
|
||||||
SUDOCMD="sudo -E"
|
SUDO="sudo -E"
|
||||||
RELEASEVER="--releasever=7"
|
RELEASEVER="--releasever=7"
|
||||||
YUMCONFOPT=""
|
YUMCONFOPT=""
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ while getopts "c:nxD:sSuUh" o; do
|
|||||||
case "${o}" in
|
case "${o}" in
|
||||||
n)
|
n)
|
||||||
# No-sudo
|
# No-sudo
|
||||||
SUDOCMD=""
|
SUDO=""
|
||||||
;;
|
;;
|
||||||
x)
|
x)
|
||||||
# Clean only
|
# Clean only
|
||||||
@ -425,8 +425,8 @@ init_dl_env
|
|||||||
# Prime the cache
|
# Prime the cache
|
||||||
loop_count=0
|
loop_count=0
|
||||||
max_loop_count=5
|
max_loop_count=5
|
||||||
echo "${SUDOCMD} yum ${YUMCONFOPT} ${RELEASEVER} makecache"
|
echo "${SUDO} yum ${YUMCONFOPT} ${RELEASEVER} makecache"
|
||||||
while ! ${SUDOCMD} yum ${YUMCONFOPT} ${RELEASEVER} makecache fast ; do
|
while ! ${SUDO} yum ${YUMCONFOPT} ${RELEASEVER} makecache fast ; do
|
||||||
# To protect against intermittent 404 errors, we'll retry
|
# To protect against intermittent 404 errors, we'll retry
|
||||||
# a few times. The suspected issue is pulling repodata
|
# a few times. The suspected issue is pulling repodata
|
||||||
# from multiple source that are temporarily inconsistent.
|
# from multiple source that are temporarily inconsistent.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user