Merge "read releasever from yum.conf iff -c yum.conf is set"
This commit is contained in:
commit
f5048fd3c7
@ -40,6 +40,7 @@ get_from() {
|
||||
# By default, we use "sudo" and we don't use a local yum.conf. These can
|
||||
# be overridden via flags.
|
||||
SUDOCMD="sudo -E"
|
||||
RELEASEVER="--releasever=7"
|
||||
YUMCONFOPT=""
|
||||
|
||||
CLEAN_LOGS_ONLY=0
|
||||
@ -59,6 +60,7 @@ while getopts "c:nxh" o; do
|
||||
c)
|
||||
# Use an alternate yum.conf
|
||||
YUMCONFOPT="-c $OPTARG"
|
||||
RELEASEVER="--$(grep releasever= ${OPTARG})"
|
||||
;;
|
||||
h)
|
||||
# Help
|
||||
@ -215,11 +217,11 @@ download () {
|
||||
echo " ------ using $SFILE to search $rpm_name ------"
|
||||
# Yumdownloader with the appropriate flag for src, noarch or x86_64
|
||||
if [ "$_type" == "src" ];then
|
||||
download_cmd="${SUDOCMD} yumdownloader -q ${YUMCONFOPT} -C --source $SFILE"
|
||||
download_url_cmd="${SUDOCMD} yumdownloader --urls -q ${YUMCONFOPT}-C --source $SFILE"
|
||||
download_cmd="${SUDOCMD} yumdownloader -q ${YUMCONFOPT} ${RELEASEVER} -C --source $SFILE"
|
||||
download_url_cmd="${SUDOCMD} yumdownloader --urls -q ${YUMCONFOPT} ${RELEASEVER} -C --source $SFILE"
|
||||
else
|
||||
download_cmd="${SUDOCMD} yumdownloader -q -C ${YUMCONFOPT} $SFILE --archlist=noarch,x86_64"
|
||||
download_url_cmd="${SUDOCMD} yumdownloader --urls -q -C ${YUMCONFOPT} $SFILE --archlist=noarch,x86_64"
|
||||
download_cmd="${SUDOCMD} yumdownloader -q -C ${YUMCONFOPT} ${RELEASEVER} $SFILE --arcgglist=noarch,x86_64"
|
||||
download_url_cmd="${SUDOCMD} yumdownloader --urls -q -C ${YUMCONFOPT} ${RELEASEVER} $SFILE --archlist=noarch,x86_64"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
@ -296,7 +298,7 @@ download () {
|
||||
}
|
||||
|
||||
# Prime the cache
|
||||
${SUDOCMD} yum ${YUMCONFOPT} makecache
|
||||
${SUDOCMD} yum ${YUMCONFOPT} ${RELEASEVER} makecache
|
||||
|
||||
# Download files
|
||||
if [ -s "$rpms_list" ];then
|
||||
|
@ -39,6 +39,7 @@ truncate -s 0 $ERROR_LOG_FILE
|
||||
retcode=0
|
||||
extra_opts=""
|
||||
|
||||
|
||||
usage() {
|
||||
echo "$0 [-c <yum.conf>]"
|
||||
echo ""
|
||||
@ -76,7 +77,7 @@ get_repoquery_info() {
|
||||
else
|
||||
repoquery_opts=
|
||||
fi
|
||||
repoquery $extra_opts -C --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' \
|
||||
repoquery $extra_opts ${RELEASEVER} -C --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}' \
|
||||
$repoquery_opts "$_package_name"
|
||||
}
|
||||
|
||||
@ -114,6 +115,7 @@ while getopts "c:" opt; do
|
||||
case $opt in
|
||||
c)
|
||||
extra_opts="-c ${OPTARG}"
|
||||
RELEASEVER="--$(grep releasever= ${OPTARG})"
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
@ -124,7 +126,7 @@ while getopts "c:" opt; do
|
||||
done
|
||||
|
||||
info "Getting yum cache"
|
||||
if ! yum $extra_opts makecache; then
|
||||
if ! yum $extra_opts ${RELEASEVER} makecache; then
|
||||
error "There was a problem getting yum cache"
|
||||
exit 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user