patches and low-level development discussion
 help / color / mirror / code / Atom feed
blob 1c1568137313c37c4e1377a063992f7bf6856e57 661 bytes (raw)
name: lib/version.nix 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>

let
  raw_version = builtins.readFile ../version;
  version_length = builtins.stringLength raw_version - 1;
  version = builtins.substring 0 version_length raw_version;
  number_re = "(0|[1-9][0-9]{0,2})";
in
if version_length < 0 || builtins.substring version_length 1 raw_version != "\n" then
  builtins.abort "Version file missing trailing newline (contents ${builtins.toJSON raw_version})"
else if builtins.match "^(${number_re}\\.){2}${number_re}$" version == null then
  builtins.abort "Version ${builtins.toJSON version} is invalid"
else
  version

debug log:

solving 1c1568137313c37c4e1377a063992f7bf6856e57 ...
found 1c1568137313c37c4e1377a063992f7bf6856e57 in https://inbox.spectrum-os.org/spectrum-devel/20251029-updates-v1-4-401c1be2a11b@gmail.com/

applying [1/1] https://inbox.spectrum-os.org/spectrum-devel/20251029-updates-v1-4-401c1be2a11b@gmail.com/
diff --git a/lib/version.nix b/lib/version.nix
new file mode 100644
index 0000000000000000000000000000000000000000..1c1568137313c37c4e1377a063992f7bf6856e57

Checking patch lib/version.nix...
Applied patch lib/version.nix cleanly.

index at:
100644 1c1568137313c37c4e1377a063992f7bf6856e57	lib/version.nix

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).