From e72e57822db173767b9b72fae923827e7dec4e97 Mon Sep 17 00:00:00 2001 From: Shelvacu Date: Fri, 22 Aug 2025 16:00:46 -0700 Subject: [PATCH] stuff --- .../deterministic-certs.nix | 0 .../host-pxe-installer.nix | 0 .../typesForTest.nix | 0 {wifi => shelved-projects/wifi}/add.py | 0 {wifi => shelved-projects/wifi}/common.nix | 0 update.sh | 41 +++++++++++++++++-- 6 files changed, 38 insertions(+), 3 deletions(-) rename deterministic-certs.nix => shelved-projects/deterministic-certs.nix (100%) rename host-pxe-installer.nix => shelved-projects/host-pxe-installer.nix (100%) rename typesForTest.nix => shelved-projects/typesForTest.nix (100%) rename {wifi => shelved-projects/wifi}/add.py (100%) rename {wifi => shelved-projects/wifi}/common.nix (100%) diff --git a/deterministic-certs.nix b/shelved-projects/deterministic-certs.nix similarity index 100% rename from deterministic-certs.nix rename to shelved-projects/deterministic-certs.nix diff --git a/host-pxe-installer.nix b/shelved-projects/host-pxe-installer.nix similarity index 100% rename from host-pxe-installer.nix rename to shelved-projects/host-pxe-installer.nix diff --git a/typesForTest.nix b/shelved-projects/typesForTest.nix similarity index 100% rename from typesForTest.nix rename to shelved-projects/typesForTest.nix diff --git a/wifi/add.py b/shelved-projects/wifi/add.py similarity index 100% rename from wifi/add.py rename to shelved-projects/wifi/add.py diff --git a/wifi/common.nix b/shelved-projects/wifi/common.nix similarity index 100% rename from wifi/common.nix rename to shelved-projects/wifi/common.nix diff --git a/update.sh b/update.sh index d9534ef..3334173 100755 --- a/update.sh +++ b/update.sh @@ -15,9 +15,15 @@ svl_assert_probably_in_script_dir what="${1-}" -if ! git diff --quiet --exit-code HEAD; then - svl_die "there must be no changes in working tree to run this" -fi +function assert_no_changes() { + svl_max_args $# 1 + declare msg="${1-expected no changes in working tree}" + if ! git diff --quiet --exit-code HEAD; then + svl_die "$msg" + fi +} + +assert_no_changes "there must be no changes in working tree to run this" tmpdir="$(mktemp -d)" trap '[[ -d $tmpdir ]] && rm -rf "$tmpdir"' EXIT @@ -36,6 +42,32 @@ if [[ $what == 'flake' ]] || [[ -z $what ]]; then fi fi +if [[ $what == 'units' ]] || [[ -z $what ]]; then + assert_no_changes + declare units_path="$tmpdir/units_path" + v nix build '.#stable.units' --out-link "$units_path" + v "$units_path/bin/units_cur" --verbose units/currency.units units/cpi.units + declare version_string + version_string="$("$units_path/bin/units" --version | head -n 1)" + if ! git diff --quiet --exit-code HEAD; then + declare -a cmd=( + git + commit + --message "units: update currency data" + --message "Auto-update by /update.sh" + --message "Used $version_string" + -- + ./units + ) + v "${cmd[@]}" + unset cmd + fi + unset version_string + rm "$units_path" + unset units_path + assert_no_changes +fi + function standard_package() { svl_min_args $# 1 declare -a names=("$@") @@ -59,10 +91,13 @@ function standard_package() { fi nix_common build "$flake_path" --no-link v git commit --file="$commit_message_path" -- packages/"$primary_name" + unset flake_path fi remove_commit_message fi + unset primary_name + unset names } standard_package bandcamp-collection-downloader bcd