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