Skip to content

Commit

Permalink
tests/install-rpm: catch full rpm name
Browse files Browse the repository at this point in the history
[before]
start remove test: python2-gitdb
......
Removed:
  python2-gitdb-0.6.4-2.oe1.aarch64
......
remove test finished: python2-gitdb

[after]
start remove test: python2-gitdb-0.6.4-2.oe1.aarch64
......
Removed:
  python2-gitdb-0.6.4-2.oe1.aarch64
......
remove test finished: python2-gitdb-0.6.4-2.oe1.aarch64

print rpm name accurately

Signed-off-by: Wang Yong <[email protected]>
  • Loading branch information
Wang Yong authored and caoxueliang007 committed Jun 10, 2021
1 parent 6c4e72c commit 15d3a86
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/install-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,24 @@ ldd_test()
done
}

handle_rpm_name()
{
name=$(yum info $@ | awk -F ': ' '{if($1 ~ /Name/) print $2}')
version=$(yum info $@ | awk -F ': ' '{if($1 ~ /Version/) print $2}')
release=$(yum info $@ | awk -F ': ' '{if($1 ~ /Release/) print $2}')
architecture=$(yum info $@ | awk -F ': ' '{if($1 ~ /Architecture/) print $2}')

rpm_full_name="${name}-${version}-${release}.${architecture}"
}

remove_rpm()
{
for i in ${rpm_name[@]}
do
echo "start remove test: $i"
handle_rpm_name $i
echo "start remove test: ${rpm_full_name}"
yum remove -y "$i" 2>&1
echo "remove test finished: $i"
echo "remove test finished: ${rpm_full_name}"
done
}

Expand Down

0 comments on commit 15d3a86

Please sign in to comment.