From c2fd3c184b0c44f92f35a82840eba267bafde9eb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 31 May 2012 13:50:47 +0000 Subject: [PATCH] * Install/uninstall all RPMs in one operation. This is necessary if the RPMs have dependencies between each other. svn path=/nixpkgs/trunk/; revision=34303 --- pkgs/build-support/release/rpm-build.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkgs/build-support/release/rpm-build.nix b/pkgs/build-support/release/rpm-build.nix index a3256769762a..9ec9ace07573 100644 --- a/pkgs/build-support/release/rpm-build.nix +++ b/pkgs/build-support/release/rpm-build.nix @@ -26,24 +26,22 @@ vmTools.buildRPM ( ''; # */ postInstall = '' + declare -a rpms rpmNames for i in $out/rpms/*/*.rpm; do if echo $i | grep -vq "\.src\.rpm$"; then echo "file rpm $i" >> $out/nix-support/hydra-build-products - - echo "installing $i..." - rpm -ip "$i" --excludepath /nix/store + rpms+=($i) + rpmNames+=("$(rpm -qp "$i")") fi done + echo "installing ''${rpms[*]}..." + rpm -ip ''${rpms[*]} --excludepath /nix/store + eval "$postRPMInstall" - for i in $out/rpms/*/*.rpm; do - if echo $i | grep -vq "\.src\.rpm$"; then - rpmName="$(rpm -qp "$i")" - echo "uninstalling $rpmName..." - rpm -e "$rpmName" - fi - done + echo "uninstalling ''${rpmNames[*]}..." + rpm -e ''${rpmNames[*]} for i in $out/rpms/*/*.src.rpm; do echo "file srpm $i" >> $out/nix-support/hydra-build-products