* Install/uninstall all RPMs in one operation. This is necessary if

the RPMs have dependencies between each other.

svn path=/nixpkgs/trunk/; revision=34303
This commit is contained in:
Eelco Dolstra 2012-05-31 13:50:47 +00:00
parent f6b2f17bc3
commit c2fd3c184b

View File

@ -26,24 +26,22 @@ vmTools.buildRPM (
''; # */ ''; # */
postInstall = '' postInstall = ''
declare -a rpms rpmNames
for i in $out/rpms/*/*.rpm; do for i in $out/rpms/*/*.rpm; do
if echo $i | grep -vq "\.src\.rpm$"; then if echo $i | grep -vq "\.src\.rpm$"; then
echo "file rpm $i" >> $out/nix-support/hydra-build-products echo "file rpm $i" >> $out/nix-support/hydra-build-products
rpms+=($i)
echo "installing $i..." rpmNames+=("$(rpm -qp "$i")")
rpm -ip "$i" --excludepath /nix/store
fi fi
done done
echo "installing ''${rpms[*]}..."
rpm -ip ''${rpms[*]} --excludepath /nix/store
eval "$postRPMInstall" eval "$postRPMInstall"
for i in $out/rpms/*/*.rpm; do echo "uninstalling ''${rpmNames[*]}..."
if echo $i | grep -vq "\.src\.rpm$"; then rpm -e ''${rpmNames[*]}
rpmName="$(rpm -qp "$i")"
echo "uninstalling $rpmName..."
rpm -e "$rpmName"
fi
done
for i in $out/rpms/*/*.src.rpm; do for i in $out/rpms/*/*.src.rpm; do
echo "file srpm $i" >> $out/nix-support/hydra-build-products echo "file srpm $i" >> $out/nix-support/hydra-build-products