* buildRPM: print out the RPMs in the image.

svn path=/nixpkgs/trunk/; revision=11168
This commit is contained in:
Eelco Dolstra
2008-03-17 17:29:07 +00:00
parent 195c3788ed
commit 113fafd778
3 changed files with 24 additions and 5 deletions
@@ -1,4 +1,6 @@
with import ../../.. {}; {pkgs}:
with pkgs;
rec { rec {
@@ -279,8 +281,11 @@ rec {
postHook = '' postHook = ''
PATH=/usr/bin:/bin:/usr/sbin:/sbin PATH=/usr/bin:/bin:/usr/sbin:/sbin
SHELL=/bin/sh SHELL=/bin/sh
eval "$origPostHook"
''; '';
origPostHook = if attrs ? postHook then attrs.postHook else "";
/* Don't run Nix-specific build steps like patchelf. */ /* Don't run Nix-specific build steps like patchelf. */
fixupPhase = "true"; fixupPhase = "true";
}); });
@@ -354,7 +359,13 @@ rec {
tarball must contain an RPM specfile. */ tarball must contain an RPM specfile. */
buildRPM = attrs: runInLinuxImage (stdenv.mkDerivation (attrs // { 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 = '' buildPhase = ''
# Hacky: RPM looks for <basename>.spec inside the tarball, so # Hacky: RPM looks for <basename>.spec inside the tarball, so
+5 -1
View File
@@ -1,5 +1,5 @@
with import ../../.. {}; with import ../../.. {};
with import ./vm.nix; with vmTools;
rec { rec {
@@ -50,6 +50,10 @@ rec {
src = nixUnstable.src; src = nixUnstable.src;
diskImage = debianImage; diskImage = debianImage;
memSize = 512; memSize = 512;
phases = "sysInfoPhase unpackPhase patchPhase configurePhase buildPhase checkPhase installPhase fixupPhase distPhase";
sysInfoPhase = ''
dpkg-query --list
'';
}); });
+6 -2
View File
@@ -29,7 +29,7 @@
}: }:
rec { let pkgs = rec {
### Symbolic names. ### Symbolic names.
@@ -393,6 +393,10 @@ rec {
inherit stdenv; inherit stdenv;
}; };
vmTools = import ../build-support/vm/default.nix {
inherit pkgs;
};
### TOOLS ### TOOLS
@@ -6160,4 +6164,4 @@ rec {
#my_env = import ../misc/my_env; #my_env = import ../misc/my_env;
} }; in pkgs