1source $stdenv/setup
2
3sources_=($sources)
4targets_=($targets)
5
6echo $objects
7objects=($objects)
8symlinks=($symlinks)
9
10
11# Remove the initial slash from a path, since genisofs likes it that way.
12stripSlash() {
13 res="$1"
14 if test "${res:0:1}" = /; then res=${res:1}; fi
15}
16
17touch pathlist
18
19# Add the individual files.
20for ((i = 0; i < ${#targets_[@]}; i++)); do
21 stripSlash "${targets_[$i]}"
22 mkdir -p "$(dirname "$res")"
23 cp -a "${sources_[$i]}" "$res"
24done
25
26
27# Add the closures of the top-level store objects.
28mkdir -p nix/store
29storePaths=$(perl $pathsFromGraph closure-*)
30for i in $storePaths; do
31 cp -a "$i" "${i:1}"
32done
33
34
35# TODO tar ruxo
36# Also include a manifest of the closures in a format suitable for
37# nix-store --load-db.
38printRegistration=1 perl $pathsFromGraph closure-* > nix-path-registration
39
40# Add symlinks to the top-level store objects.
41for ((n = 0; n < ${#objects[*]}; n++)); do
42 object=${objects[$n]}
43 symlink=${symlinks[$n]}
44 if test "$symlink" != "none"; then
45 mkdir -p $(dirname ./$symlink)
46 ln -s $object ./$symlink
47 fi
48done
49
50$extraCommands
51
52mkdir -p $out/tarball
53
54rm env-vars
55
56time tar --sort=name --mtime='@1' --owner=0 --group=0 --numeric-owner -c * $extraArgs | $compressCommand > $out/tarball/$fileName.tar${extension}
57
58mkdir -p $out/nix-support
59echo $system > $out/nix-support/system
60echo "file system-tarball $out/tarball/$fileName.tar${extension}" > $out/nix-support/hydra-build-products