Turns out that the exit status is returned in $?, not as the return value of run(). So our error checking was completely bogus.
A43SLRSH6OIIEZWLRKLMERX7HOMBICKG7WHELCZYLOJWZ3JFRV2AC
G7XYM6MUNHO4TPE3GHHIXJP6YJQZT6TPWPKOJOX4DW5YY2CAXTQQC
5FP63F5T7UT3FCIX7AKH2KPGZ5GF5E7U4VYOYUS4DYEYCAKNAUQQC
GAZHOBWEXOSWFNJYOYXASH3LCOLREWB3DZXELIAP2Q6L2X2ZSI4QC
OXJ4QT6KKJHF6SJKQJAEJEIESREIYUC424OONZUCVZSN5PY6447AC
OSTNUSGYPOKBUUJBOBDDCQ6DUZC5EXZ4EZTNZXZXTHRN7KYMZH2AC
QIW2WZKWE3ULO4O4QB6EQWUKZY2UFNN7WA464FMIZOAHP3UHFGSAC
6KJXJB7NZ5XJ3WGUWKFNT6LMBNYJN3IPHZ7B7H654D5B6LPOL5QAC
ZWCTAZGLJZQNTYWTC2XQUKMILJF6JGDL5IND6QNYWK4FIGMLRFXAC
KQS7DSKJHTEHALCPTXMWRX2IBOVC5BWU7RWJ4GP5A2JJSBR7HPKAC
OOQ2D3KCLFPYNAN253PHWLBQMB6OMO2KYQWQXLTP65SQAYZWQ5LAC
EDRUQ4UK643SUCYMMTS2JS4N3BHARLKRDWRH3QAYWDMWRAMPNAOQC
ARD6Z67TDHK2XMW47CSVOXXF327YGOMYK3EAXTSVVXNDAFQYNO5AC
CHQEG6WY44VSOTLNH5KDZWJCCHNHRUCX6BEREXUUO56VOKHNSUZAC
2WUNXJGWGHQRE24ZJT4VIP35OHO2E4VCKA65TCCKU55BNBIPABCAC
HE3GX5IPS6XA7KLNP5WZY2YU27WQS663WSKAL5FHWBSJ5GMM633AC
HABC6L4GN66AIJKCNKM3ZHGNBYWNAZK4T4GM5WGJYQE77ZWGRRQAC
C7CXMZ66BZTI5ABDJNPL2JKSHSKDQ645GXUKN7OTQBPEQJ452KQAC
PNPT3Y7RR5WA7DYUKXAF7SE4TE5GUEL65XMRYNL7GWVC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5ZF7ZFDTQUR4GS5WPPTYZASYZZUAC
G2ZB6464XGPBIMSZIPSB24EIXSCCGV4XWC3IWPS2CXYPDSUZSU5QC
OB7GB5DLJ3NCVUELTTNPBNGIT757BIYQ452WKNOCNLY3SAI4HHAQC
WFJ3ZPRMZ52NFPPGRJTVNLYLFFN2DYP3JHNTPVRQAEULEF7VCGGAC
VOBFCHIXMHWXLRA2EBJVKGIIYDGMVYOVQAUTKCHWRSUHV34XS57AC
EDDTVGB47XYPTKJ3P4XAQ4MZ2NFKAMK2JE6GSEMWAO4EJVGPYHPQC
3RL7VFKEVVQBVKLKM7ZS3M67BOGGJ3OWPARHG64AOUTZTPPYCHLQC
3PNG7NIBQQURUUPRVQXYL342OT7JUUYOMY2JJNP6YDX7SYJDZMYAC
7RO7CINMZYA7TMACQEERL6MIQO7LZRKHVVW7FTQIS4TMJPYYLOHAC
SBKX3YH2EOCYY2IDACGOTXHJZSYSRHD5EC7FB6WGPKHLFYOF6SAAC
die "Cannot get head revision of Subversion repository at `$uri':\n$stderr"
unless IPC::Run::run(@cmd, \$stdout, \$stderr);
IPC::Run::run(@cmd, \$stdout, \$stderr);
die "cannot get head revision of Subversion repository at `$uri':\n$stderr" if $?;
(my $res, $stdout, $stderr) = captureStdoutStderr(600,
("svn", "checkout", $uri, "-r", $revision, $wcPath));
(my $res, $stdout, $stderr) = captureStdoutStderr(600, "svn", "checkout", $uri, "-r", $revision, $wcPath);
die "error checking out Subversion repo at `$uri':\n$stderr" if $res;
($res, $stdout, $stderr) = captureStdoutStderr(600,
("git", "clone", "--branch", $branch, $uri, $clonePath));
die "Error cloning git repo at `$uri':\n$stderr" unless $res;
($res, $stdout, $stderr) = captureStdoutStderr(600, "git", "clone", "--branch", $branch, $uri, $clonePath);
die "error cloning git repo at `$uri':\n$stderr" if $res;
("git", "fetch", "-fu", "origin")) unless $res;
die "Error fetching latest change from git repo at `$uri':\n$stderr" unless $res;
"git", "fetch", "-fu", "origin") if $res;
die "error fetching latest change from git repo at `$uri':\n$stderr" if $res;
die unless $revision =~ /^[0-9a-fA-F]+$/;
die "Error getting a well-formated revision number of Git branch '$branch' at `$uri':\n$stdout" unless $res;
die "error getting a well-formated revision number of Git branch '$branch' at `$uri':\n$stdout"
unless $revision =~ /^[0-9a-fA-F]+$/;
($res, $stdout, $stderr) = captureStdoutStderr(600,
("git", "checkout", "$branch"));
die "Error checking out Git branch '$branch' at `$uri':\n$stderr" unless $res;
($res, $stdout, $stderr) = captureStdoutStderr(600, "git", "checkout", "$branch");
die "error checking out Git branch '$branch' at `$uri':\n$stderr" if $res;
("tg", "remote", "--populate", "origin"));
print STDERR "Warning: `tg remote --populate origin' failed:\n$stderr" unless $res;
"tg", "remote", "--populate", "origin");
print STDERR "warning: `tg remote --populate origin' failed:\n$stderr" if $res;
($res, $stdout, $stderr) = captureStdoutStderr(600,
("nix-prefetch-git", $clonePath, $revision));
die "Cannot check out Git repository branch '$branch' at `$uri':\n$stderr" unless $res;
($res, $stdout, $stderr) = captureStdoutStderr(600, "nix-prefetch-git", $clonePath, $revision);
die "cannot check out Git repository branch '$branch' at `$uri':\n$stderr" if $res;
(my $res, $stdout, $stderr) = captureStdoutStderr(600,
("bzr", "branch", $uri, $clonePath));
die "Error cloning bazaar branch at `$uri':\n$stderr" unless $res;
(my $res, $stdout, $stderr) = captureStdoutStderr(600, "bzr", "branch", $uri, $clonePath);
die "error cloning bazaar branch at `$uri':\n$stderr" if $res;
(my $res, $stdout, $stderr) = captureStdoutStderr(600,
("bzr", "pull"));
die "Error pulling latest change bazaar branch at `$uri':\n$stderr" unless $res;
(my $res, $stdout, $stderr) = captureStdoutStderr(600, "bzr", "pull");
die "error pulling latest change bazaar branch at `$uri':\n$stderr" if $res;
(my $res, $stdout, $stderr) = captureStdoutStderr(600,
("hg", "pull"));
die "Error pulling latest change mercurial repo at `$uri':\n$stderr" unless $res;
(my $res, $stdout, $stderr) = captureStdoutStderr(600, "hg", "pull");
die "error pulling latest change mercurial repo at `$uri':\n$stderr" if $res;
(my $res1, $stdout, $stderr) = captureStdoutStderr(600,("hg", "log", "-r", $id, "--template", "{node|short} {rev} {branch}"));
die "Error getting branch and revision of $id from `$uri':\n$stderr" unless $res1;
(my $res1, $stdout, $stderr) = captureStdoutStderr(600,
"hg", "log", "-r", $id, "--template", "{node|short} {rev} {branch}");
die "error getting branch and revision of $id from `$uri':\n$stderr" if $res1;
("nix-prefetch-hg", $clonePath, $revision));
die "Cannot check out Mercurial repository `$uri':\n$stderr" unless $res;
"nix-prefetch-hg", $clonePath, $revision);
die "cannot check out Mercurial repository `$uri':\n$stderr" if $res;
or die "Cannot find the input containing the job expression.\n";
die "Multiple alternatives for the input containing the Nix expression are not supported.\n"
or die "cannot find the input containing the job expression.\n";
die "multiple alternatives for the input containing the Nix expression are not supported.\n"
($evaluator, $nixExprFullPath, "--gc-roots-dir", getGCRootsDir, "-j", 1, inputsToArgs($inputInfo, $exprType)));
die "Cannot evaluate the Nix expression containing the jobs:\n$stderr" unless $res;
$evaluator, $nixExprFullPath, "--gc-roots-dir", getGCRootsDir, "-j", 1, inputsToArgs($inputInfo, $exprType));
die "cannot evaluate the Nix expression containing the jobs:\n$stderr" if $res;