B:BD[
4.960] → [
4.960:1120]
B:BD[
6.162] → [
6.162:209]
B:BD[
6.209] → [
7.113:160]
B:BD[
6.209] → [
6.209:210]
B:BD[
4.1152] → [
4.1152:1204]
B:BD[
4.1204] → [
2.957:1089]
∅:D[
2.1089] → [
4.1305:1412]
B:BD[
4.1305] → [
4.1305:1412]
B:BD[
4.1412] → [
2.1090:1153]
∅:D[
2.1153] → [
4.1456:1575]
B:BD[
4.1456] → [
4.1456:1575]
B:BD[
4.1575] → [
2.1154:1238]
∅:D[
2.1238] → [
4.1575:1921]
B:BD[
4.1575] → [
4.1575:1921]
# Then download this revision into the store.
print STDERR "checking out Git input from $uri";
$ENV{"NIX_HASH_ALGO"} = "sha256";
$ENV{"PRINT_PATH"} = "1";
# Checked out code often wants to be able to run `git
# describe', e.g., code that uses Gnulib's `git-version-gen'
# script. Thus, we leave `.git' in there. Same for
# Subversion (e.g., libgcrypt's build system uses that.)
$ENV{"NIX_PREFETCH_GIT_LEAVE_DOT_GIT"} = "1";
$ENV{"NIX_PREFETCH_SVN_LEAVE_DOT_SVN"} = "1";
# Ask for a "deep clone" to allow "git describe" and similar
# tools to work. See
# http://thread.gmane.org/gmane.linux.distributions.nixos/3569
# for a discussion.
$ENV{"NIX_PREFETCH_GIT_DEEP_CLONE"} = "1";
(my $res, $stdout, $stderr) = captureStdoutStderr(
"nix-prefetch-git", $uri, $revision);
die "Cannot check out Git repository branch '$branch' at `$uri':\n$stderr" unless $res;
($sha256, $storePath) = split ' ', $stdout;
($cachedInput) = $db->resultset('CachedGitInputs')->search(
{uri => $uri, branch => $branch, sha256hash => $sha256});
if (!defined $cachedInput) {
txn_do($db, sub {
$db->resultset('CachedGitInputs')->create(
{ uri => $uri
, branch => $branch
, revision => $revision
, timestamp => $timestamp
, lastseen => $timestamp
, sha256hash => $sha256
, storepath => $storePath
});
});
} else {
$timestamp = $cachedInput->timestamp;
txn_do($db, sub {
$cachedInput->update({lastseen => time});
});
}
# Then download this revision into the store.
print STDERR "checking out Git input from $uri";
$ENV{"NIX_HASH_ALGO"} = "sha256";
$ENV{"PRINT_PATH"} = "1";
# Checked out code often wants to be able to run `git
# describe', e.g., code that uses Gnulib's `git-version-gen'
# script. Thus, we leave `.git' in there. Same for
# Subversion (e.g., libgcrypt's build system uses that.)
$ENV{"NIX_PREFETCH_GIT_LEAVE_DOT_GIT"} = "1";
$ENV{"NIX_PREFETCH_SVN_LEAVE_DOT_SVN"} = "1";
# Ask for a "deep clone" to allow "git describe" and similar
# tools to work. See
# http://thread.gmane.org/gmane.linux.distributions.nixos/3569
# for a discussion.
$ENV{"NIX_PREFETCH_GIT_DEEP_CLONE"} = "1";
(my $res, $stdout, $stderr) = captureStdoutStderr(
"nix-prefetch-git", $uri, $revision);
die "Cannot check out Git repository branch '$branch' at `$uri':\n$stderr" unless $res;
($sha256, $storePath) = split ' ', $stdout;
($cachedInput) = $db->resultset('CachedGitInputs')->search(
{uri => $uri, branch => $branch, sha256hash => $sha256});
if (!defined $cachedInput) {
txn_do($db, sub {
$db->resultset('CachedGitInputs')->update_or_create(
{ uri => $uri
, branch => $branch
, revision => $revision
, timestamp => $timestamp
, lastseen => $timestamp
, sha256hash => $sha256
, storepath => $storePath
});
});
} else {
$timestamp = $cachedInput->timestamp;
txn_do($db, sub {
$cachedInput->update({lastseen => time});
});
}