diff options
author | Eric Hameleers <alien@slackware.com> | 2010-06-28 14:53:57 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2010-06-28 14:53:57 +0000 |
commit | f6af94e185a62d1bf3a032fcf13ff4f6d6a0eb03 (patch) | |
tree | 88702276aee5e8f425eedb39d9b1467f57dc9202 /compat32-tools | |
parent | c7331ddf388a3343ca7702061f2deb82c2f31edb (diff) | |
download | multilib-f6af94e185a62d1bf3a032fcf13ff4f6d6a0eb03.tar.gz multilib-f6af94e185a62d1bf3a032fcf13ff4f6d6a0eb03.tar.xz |
Initial revision
Diffstat (limited to 'compat32-tools')
-rw-r--r-- | compat32-tools/check-compat32 | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/compat32-tools/check-compat32 b/compat32-tools/check-compat32 new file mode 100644 index 0000000..2ce17e9 --- /dev/null +++ b/compat32-tools/check-compat32 @@ -0,0 +1,74 @@ +#!/bin/bash +#$Id$ +# +# Purpose: +# To check if any of the installed -compat32 packages is older than +# the accompanying 64-bit package. +# +# Author: +# Eric Hameleers <alien@slackware.com> +# + +# No verbose output by default: +DEBUG=0 + +showhelp () { +cat <<EOT + +Script name: + $(basename $0) +Purpose: + To check if any of the installed -compat32 packages is older than + the accompanying 64-bit package. +Usage: + Run the program without parameters to make it check your packages. +Parameters: + -h|--help Show this help text + -v|--verbose Verbose output + +EOT +} + +# Parse the commandline parameters: +while [ ! -z "$1" ]; do + case $1 in + -h|--help) + showhelp + exit 0 + ;; + -v|--verbose) + DEBUG=1 + shift + ;; + -*) + echo "Unsupported parameter '$1'!" + exit 1 + ;; + *) + # Do nothing + shift + ;; + esac +done + + +# Loop through the -compat32 packages we find installed, +# and compare their versions to the 64-bit packages +[ $DEBUG -ne 0 ] && echo "-- Checking installed packages..." +for FULL32 in $(find /var/log/packages/ -name "*-compat32-*") ; do + PKG32=$(echo ${FULL32} |cut -f5 -d'/' |rev |cut -f4- -d'-' |rev) + VER32=$(echo ${FULL32} |cut -f5 -d'/' |rev |cut -f3 -d'-' |rev) + + [ $DEBUG -ne 0 ] && echo ">> Found '$PKG32'..." + + PKG64=$(echo ${FULL32} |cut -f5 -d'/' |rev |cut -f5- -d'-' |rev) + VER64=$($(find /var/log/packages/ -name "${PKG64}*" |grep -v -- -compat32) |cut -f5 -d'/' |rev |cut -f3 -d'-' |rev |grep "${PKG64}$") + + # Issue a warning if the version of the 64-bit package differs: + if [ -n "$VER64" -a "$VER32" != "$VER64" ]; then + echo "** Package '$PKG64' has version '$VER64' but package '$PKG32' has version '$VER32'" + fi +done + +[ $DEBUG -ne 0 ] && echo "-- Finished checking installed packages." + |