unstable-updater.nix now understands a branch argument
This commit is contained in:
parent
068b26fa11
commit
6c876bac61
|
@ -1,4 +1,5 @@
|
||||||
{ writeShellScript
|
{ lib
|
||||||
|
, writeShellScript
|
||||||
, coreutils
|
, coreutils
|
||||||
, git
|
, git
|
||||||
, nix
|
, nix
|
||||||
|
@ -8,6 +9,7 @@
|
||||||
# This is an updater for unstable packages that should always use the latest
|
# This is an updater for unstable packages that should always use the latest
|
||||||
# commit.
|
# commit.
|
||||||
{ url ? null # The git url, if empty it will be set to src.url
|
{ url ? null # The git url, if empty it will be set to src.url
|
||||||
|
, branch ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -25,7 +27,9 @@ let
|
||||||
|
|
||||||
# Get info about HEAD from a shallow git clone
|
# Get info about HEAD from a shallow git clone
|
||||||
tmpdir="$(${coreutils}/bin/mktemp -d)"
|
tmpdir="$(${coreutils}/bin/mktemp -d)"
|
||||||
${git}/bin/git clone --bare --depth=1 "$url" "$tmpdir"
|
${git}/bin/git clone --bare --depth=1 \
|
||||||
|
${lib.optionalString (branch != null) "--branch ${branch}"} \
|
||||||
|
"$url" "$tmpdir"
|
||||||
pushd "$tmpdir"
|
pushd "$tmpdir"
|
||||||
commit_date="$(${git}/bin/git show -s --pretty='format:%cs')"
|
commit_date="$(${git}/bin/git show -s --pretty='format:%cs')"
|
||||||
commit_sha="$(${git}/bin/git show -s --pretty='format:%H')"
|
commit_sha="$(${git}/bin/git show -s --pretty='format:%H')"
|
||||||
|
|
Loading…
Reference in New Issue