mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 15:25:58 +01:00
nix/updater: only update wlroots on rev change
This commit is contained in:
parent
9447fcd603
commit
6daa866beb
1 changed files with 14 additions and 8 deletions
|
@ -1,13 +1,19 @@
|
||||||
#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#moreutils -c bash
|
#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#moreutils nixpkgs#jq -c bash
|
||||||
|
|
||||||
# get wlroots revision from submodule
|
|
||||||
rev=$(git submodule status | awk '{ print substr($1,2)}')
|
|
||||||
|
|
||||||
# update nixpkgs to latest version
|
# update nixpkgs to latest version
|
||||||
nix flake lock --update-input nixpkgs
|
nix flake lock --update-input nixpkgs
|
||||||
|
|
||||||
# update wlroots to submodule revision
|
# get wlroots revision from submodule
|
||||||
nix flake lock --override-input wlroots "gitlab:wlroots/wlroots/$rev?host=gitlab.freedesktop.org"
|
SUB_REV=$(git submodule status | awk '{ print substr($1,2)}')
|
||||||
|
# and from lockfile
|
||||||
|
CRT_REV=$(jq < flake.lock '.nodes.wlroots.locked.rev' -r)
|
||||||
|
|
||||||
# remove "dirty" mark from lockfile
|
if [ $SUB_REV != $CRT_REV ]; then
|
||||||
jq < flake.lock 'del(.nodes.wlroots.original.rev)' | sponge flake.lock
|
# update wlroots to submodule revision
|
||||||
|
nix flake lock --override-input wlroots "gitlab:wlroots/wlroots/$SUB_REV?host=gitlab.freedesktop.org"
|
||||||
|
|
||||||
|
# remove "dirty" mark from lockfile
|
||||||
|
jq < flake.lock 'del(.nodes.wlroots.original.rev)' | sponge flake.lock
|
||||||
|
else
|
||||||
|
echo "wlroots is up to date!"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue