depot/third_party/nixpkgs/pkgs/tools/system/zram-generator/update.sh
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

15 lines
602 B
Bash
Executable file

#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils curl jq common-updater-scripts cargo
# shellcheck shell=bash
set -euo pipefail
version=$(curl -s https://api.github.com/repos/systemd/zram-generator/releases/latest | jq -r .tag_name)
update-source-version zram-generator "${version#v}"
tmp=$(mktemp -d)
trap 'rm -rf -- "${tmp}"' EXIT
git clone --depth 1 --branch "${version}" https://github.com/systemd/zram-generator.git "${tmp}/zram-generator"
cargo generate-lockfile --manifest-path "${tmp}/zram-generator/Cargo.toml"
cp "${tmp}/zram-generator/Cargo.lock" "$(dirname "$0")/Cargo.lock"