summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2008-03-17 17:29:07 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2008-03-17 17:29:07 +0000
commit113fafd7780bc1208925d3087725978abb7370c6 (patch)
tree95c6358513ecc30c41f991ae6270ea60fb7d7009 /pkgs/build-support
parent195c3788ed80b2b54297bd679516729d7eb6415a (diff)
downloadnixpkgs-113fafd7780bc1208925d3087725978abb7370c6.tar
nixpkgs-113fafd7780bc1208925d3087725978abb7370c6.tar.gz
nixpkgs-113fafd7780bc1208925d3087725978abb7370c6.tar.bz2
nixpkgs-113fafd7780bc1208925d3087725978abb7370c6.tar.lz
nixpkgs-113fafd7780bc1208925d3087725978abb7370c6.tar.xz
nixpkgs-113fafd7780bc1208925d3087725978abb7370c6.tar.zst
nixpkgs-113fafd7780bc1208925d3087725978abb7370c6.zip
* buildRPM: print out the RPMs in the image.
svn path=/nixpkgs/trunk/; revision=11168
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/vm/default.nix (renamed from pkgs/build-support/vm/vm.nix)15
-rw-r--r--pkgs/build-support/vm/test.nix6
2 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/build-support/vm/vm.nix b/pkgs/build-support/vm/default.nix
index 13b9ed5ea75..7d334f04540 100644
--- a/pkgs/build-support/vm/vm.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -1,4 +1,6 @@
-with import ../../.. {};
+{pkgs}:
+
+with pkgs;
 
 rec {
 
@@ -279,8 +281,11 @@ rec {
     postHook = ''
       PATH=/usr/bin:/bin:/usr/sbin:/sbin
       SHELL=/bin/sh
+      eval "$origPostHook"
     '';
 
+    origPostHook = if attrs ? postHook then attrs.postHook else "";
+
     /* Don't run Nix-specific build steps like patchelf. */
     fixupPhase = "true";
   });
@@ -354,8 +359,14 @@ rec {
      tarball must contain an RPM specfile. */
   
   buildRPM = attrs: runInLinuxImage (stdenv.mkDerivation (attrs // {
-    phases = "buildPhase installPhase";
+    phases = "sysInfoPhase buildPhase installPhase";
   
+    sysInfoPhase = ''
+      header "base RPMs"
+      rpm -qa --qf "%{Name}-%{Version}-%{Release} (%{Arch}; %{Distribution}; %{Vendor})\n"
+      stopNest
+    '';
+    
     buildPhase = ''
       # Hacky: RPM looks for <basename>.spec inside the tarball, so
       # strip off the hash.
diff --git a/pkgs/build-support/vm/test.nix b/pkgs/build-support/vm/test.nix
index e25704612dc..6c25667a222 100644
--- a/pkgs/build-support/vm/test.nix
+++ b/pkgs/build-support/vm/test.nix
@@ -1,5 +1,5 @@
 with import ../../.. {};
-with import ./vm.nix;
+with vmTools;
 
 rec {
 
@@ -50,6 +50,10 @@ rec {
     src = nixUnstable.src;
     diskImage = debianImage;
     memSize = 512;
+    phases = "sysInfoPhase unpackPhase patchPhase configurePhase buildPhase checkPhase installPhase fixupPhase distPhase";
+    sysInfoPhase = ''
+      dpkg-query --list
+    '';
   });