2012-08-02 18:31:26 +00:00
|
|
|
#!/bin/bash -
|
2009-12-21 13:06:12 +00:00
|
|
|
# Additional custom requires for libguestfs package.
|
2012-08-02 18:31:26 +00:00
|
|
|
#
|
|
|
|
# Note this script is *ONLY* applicable to Fedora 17+ (ie. with UsrMove)
|
|
|
|
# since we now assume that /usr/lib{,64} and /lib{,64} are the same
|
|
|
|
# directory and hence that:
|
|
|
|
#
|
|
|
|
# Requires: libfoo.so.1 <=> /usr/lib/libfoo.so.1 exists
|
|
|
|
# Requires: libfoo.so.1()(64bit) <=> /usr/lib64/libfoo.so.1 exists
|
2009-12-21 13:06:12 +00:00
|
|
|
|
|
|
|
original_find_requires="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
# Get the list of files.
|
|
|
|
files=`sed "s/['\"]/\\\&/g"`
|
|
|
|
|
|
|
|
# Use ordinary find-requires first.
|
|
|
|
echo $files | tr [:blank:] '\n' | $original_find_requires
|
|
|
|
|
2010-07-19 12:56:39 +00:00
|
|
|
# Is supermin.d/hostfiles included in the list of files?
|
|
|
|
hostfiles=`echo $files | tr [:blank:] '\n' | grep 'supermin\.d/hostfiles$'`
|
2009-12-21 13:06:12 +00:00
|
|
|
|
|
|
|
if [ -z "$hostfiles" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Generate extra requires for libraries listed in hostfiles.
|
2012-08-02 18:31:26 +00:00
|
|
|
sofiles=`grep 'lib.*\.so\.' $hostfiles | fgrep -v '*'`
|
2009-12-21 13:06:12 +00:00
|
|
|
for f in $sofiles; do
|
|
|
|
if [ -f "$f" ]; then
|
2012-08-02 19:18:58 +00:00
|
|
|
if [[ "$f" =~ (/usr)?/lib64/([^/]*)$ ]]; then
|
|
|
|
echo "${BASH_REMATCH[2]}()(64bit)"
|
|
|
|
elif [[ "$f" =~ (/usr)?/lib/([^/]*)$ ]]; then
|
|
|
|
echo "${BASH_REMATCH[2]}"
|
|
|
|
else
|
|
|
|
echo "$f"
|
2012-08-02 18:31:26 +00:00
|
|
|
fi
|
2009-12-21 13:06:12 +00:00
|
|
|
fi
|
|
|
|
done
|