From 2009466f7e945a6593351f19568e8d0334244335 Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Thu, 23 Sep 2021 17:08:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=B8=8B=E8=BD=BD=20rpm/deve?= =?UTF-8?q?l/debuginfo=20=E4=BD=86=E4=B8=8D=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsg-rpm-script/tsg_rpm.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tsg-rpm-script/tsg_rpm.sh b/tsg-rpm-script/tsg_rpm.sh index 78979c5..2a20edc 100644 --- a/tsg-rpm-script/tsg_rpm.sh +++ b/tsg-rpm-script/tsg_rpm.sh @@ -33,11 +33,22 @@ verify_debuginfo_version() fi } +download_only_rpm() +{ + debuginfo=`echo $1 | awk -F '-' '{print $1 "-debuginfo-" $2}'` + devel=`echo $1 | awk -F '-' '{print $1 "-devel-" $2}'` + printf "\e[31m yum install --downloadonly %-35s %-35s %-35s\e[0m\n" "$1 $debuginfo $devel" + yum install --downloadonly --downloaddir=./ $1 + yum install --downloadonly --downloaddir=./ $debuginfo + yum install --downloadonly --downloaddir=./ $devel +} + usage() { printf " -c Check whether the rpm specified by tsg-os is installed\n" printf " -i Install debuginfo corresponding to rpm\n" printf " -v Verify that the version of debuginfo installed is correct\n" + printf " -d Download only rpm/devel/debuginfo\n" printf " -h Help\n" exit 0 } @@ -54,12 +65,13 @@ if [ "$1" == "" ]; then fi opt_type="h" -while getopts civh opt +while getopts civhd opt do case $opt in c) opt_type="c" ;; i) opt_type="i" ;; v) opt_type="v" ;; + d) opt_type="d" ;; h|?) usage ;; esac done @@ -74,6 +86,8 @@ do install_rpm_debugino ${rpm} elif [ $opt_type == "v" ]; then verify_debuginfo_version ${rpm} ${RPM_DB} + elif [ $opt_type == "d" ]; then + download_only_rpm ${rpm} fi done rm -rf ${RPM_DB}