From ea6c8cd0810efd3e7acb89302d76f8ed9cdf54ba Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 21 Dec 2009 13:06:12 +0000 Subject: [PATCH] Generate additional requires for supermin (RHBZ#547496). --- libguestfs-find-requires.sh | 33 +++++++++++++++++++++++++++++++++ libguestfs.spec | 11 ++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100755 libguestfs-find-requires.sh diff --git a/libguestfs-find-requires.sh b/libguestfs-find-requires.sh new file mode 100755 index 0000000..690b42d --- /dev/null +++ b/libguestfs-find-requires.sh @@ -0,0 +1,33 @@ +#!/bin/sh - +# Additional custom requires for libguestfs package. + +exec 5>>/tmp/requires.log + +echo >&5 +time >&5 +echo args "$@" >&5 + +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 + +# Is initramfs.*.supermin.hostfiles included in the list of files? +hostfiles=`echo $files | tr [:blank:] '\n' | grep 'initramfs\..*\.supermin\.hostfiles$'` +echo hostfiles $hostfiles >&5 + +if [ -z "$hostfiles" ]; then + exit 0 +fi + +# Generate extra requires for libraries listed in hostfiles. +sofiles=`grep 'lib.*\.so\.' $hostfiles | fgrep -v '*' | sed 's|^\.||'` +for f in $sofiles; do + if [ -f "$f" ]; then + echo "$f" + fi +done diff --git a/libguestfs.spec b/libguestfs.spec index 439014f..dfa345e 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -5,7 +5,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 Version: 1.0.80 -Release: 3%{?dist} +Release: 9%{?dist} License: LGPLv2+ Group: Development/Libraries URL: http://libguestfs.org/ @@ -88,6 +88,12 @@ Requires: qemu-kvm >= 0.10-7 # For libguestfs-test-tool. Requires: genisoimage +# Provide our own custom requires for the supermin appliance. +Source1: libguestfs-find-requires.sh +%global _use_internal_dependency_generator 0 +%global __find_provides %{_rpmconfigdir}/find-provides +%global __find_requires %{SOURCE1} %{_rpmconfigdir}/find-requires + %description Libguestfs is a library for accessing and modifying guest disk images. @@ -606,6 +612,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Dec 21 2009 Richard W.M. Jones - 1.0.80-9 +- Generate additional requires for supermin (RHBZ#547496). + * Fri Dec 18 2009 Richard W.M. Jones - 1.0.80-3 - Work around udevsettle command problem (RHBZ#548121). - Enable tests.