-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathshow_rh_updates
More file actions
executable file
·39 lines (34 loc) · 902 Bytes
/
show_rh_updates
File metadata and controls
executable file
·39 lines (34 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
#
# based on drag's script - see http://arstechnica.com/civis/viewtopic.php?t=1081335
#
help() {
echo 'usage: show_rh_updates [--help]'
echo
echo ' shows current and new version of packages that would get'
echo ' updated.'
echo
exit 1
}
[ "$1" == "--help" ] && help
print() {
printf "%40s %40s %40s\n" "$1" "$2" "$3"
}
print "package name" "current version" "update version"
print "------------" "---------------" "--------------"
yum -q check-update | while read i
do
i=$(echo $i) #this strips off yum's irritating use of whitespace
if [ "${i}x" != "x" ]
then
UVERSION=${i#*\ }
UVERSION=${UVERSION%\ *}
PNAME=${i%%\ *}
PNAME=${PNAME%.*}
VERSION=$(rpm -q "${PNAME}" --qf '%{VERSION}')
if [ "$?" != "0" ]; then
continue
fi
print "$PNAME" "$VERSION" "$UVERSION"
fi
done