reproduce.tt: Add --help flag
[?]
May 2, 2013, 2:04 PM
5Q4ZLL37EZJQJ2VJW2Z5NRR4C7TA6657HLZXXKM4UWSGEMII7SRQCDependencies
- [2]
HZWUT4YNAllow users to reproduce builds on their own systems
Change contents
- replacement in src/root/reproduce.tt at line 1
#! /bin/sh#! /usr/bin/env bash - edit in src/root/reproduce.tt at line 7
tmpDir=${TMPDIR:-/tmp}/build-[% build.id +%]declare -a args extraArgs# Process the command line.while [ $# -gt 0 ]; doarg="$1"shiftif [ "$arg" = --help ]; thencat <<EOFUsage: $0 [--dir PATH] [--run-env] - replacement in src/root/reproduce.tt at line 20
export NIX_PATH=This script will reproduce Hydra build [% build.id %] of job [%build.project.name %]:[% build.jobset.name %]:[% build.job.name +%](available at [%+ c.uri_for('/build' build.id) +%]). It will fetchall inputs of the Hydra build, then invoke Nix to build the job andall its dependencies.The inputs will be stored in $tmpDir. This can be overriden using the--dir flag. After the build, the result of the build is available viathe symlink $tmpDir/result.Flags:--dir PATHOverride the location where the inputs and result symlink are stored.--run-envFetch the inputs and build the dependencies, then start aninteractive shell in which the environment is equal to that usedto perform the build. See the description of the --run-env flagin the nix-build(1) manpage for more details.Any additional flags are passed to nix-build. See the nix-build(1)manpage for details.EOFexit 0elif [ "$arg" = --dir ]; thentmpDir="$1"if [ -z "$tmpDir" ]; thenecho "$0: --dir requires an argument" >&2exit 1fishiftelseextraArgs+=("$arg")fidone - replacement in src/root/reproduce.tt at line 57
srcDir=${TMPDIR:-/tmp}/build-[% build.id +%]mkdir -p "$srcDir"/buildcd "$srcDir"/buildecho "storing sources in $srcDir" >&2export NIX_PATH= - replacement in src/root/reproduce.tt at line 60
declare -a argsmkdir -p "$tmpDir"cd "$tmpDir"echo "storing sources in $tmpDir" >&2 - replacement in src/root/reproduce.tt at line 72
inputDir="$srcDir/[% input.name %]/git-export"inputDir="$tmpDir/[% input.name %]/git-export" - replacement in src/root/reproduce.tt at line 90
inputDir="$srcDir/[% input.name %]/hg-archive"inputDir="$tmpDir/[% input.name %]/hg-archive" - replacement in src/root/reproduce.tt at line 105
inputDir="$srcDir/[% input.name %]/svn-export"inputDir="$tmpDir/[% input.name %]/svn-export" - replacement in src/root/reproduce.tt at line 154
nix-build "$nixExprInputDir/[% build.nixexprpath %]" -A '[% build.job.name %]' "${args[@]}" "$@"[2.3568]nix-build "$nixExprInputDir/[% build.nixexprpath %]" -A '[% build.job.name %]' "${args[@]}" "${extraArgs[@]}"