diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2015-07-11 15:32:46 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2015-07-11 15:32:46 +0200 |
commit | 9dc7f98ab8e094d5923f44390025e3635d0b40a1 (patch) | |
tree | d5deb7b03eeaa7bfa1f0050e5e81996f65ba5b52 /nix-script-diff-generations.sh | |
parent | 7d8f120d9c42ac4ef40a38582969f6d77784e621 (diff) |
Add documentation to source in diff-generations command
Diffstat (limited to 'nix-script-diff-generations.sh')
-rwxr-xr-x | nix-script-diff-generations.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/nix-script-diff-generations.sh b/nix-script-diff-generations.sh index 0df561d..4dd11d2 100755 --- a/nix-script-diff-generations.sh +++ b/nix-script-diff-generations.sh @@ -65,6 +65,9 @@ do esac done +# +# Helper to generate a path for the profile we want to diff with +# gen_path() { [[ $__SYSTEM -eq 1 ]] && echo "/nix/var/nix/profiles/system-${1}-link" [[ $__USER -eq 1 ]] && echo "/nix/var/nix/profiles/per-user/$USER/profile-${1}-link" @@ -81,16 +84,24 @@ stdout "from directory : $DIR_A" stdout "Generation B : $GEN_B" stdout "from directory : $DIR_B" +# +# Error checking whether the generations exist. +# [[ -z "$GEN_A" || -z "$GEN_B" ]] && stderr "No generations" && exit 1 [[ ! -e $DIR_A ]] && stderr "Generation $GEN_A does not exist." && exit 1 [[ ! -e $DIR_B ]] && stderr "Generation $GEN_B does not exist." && exit 1 +# +# Querying the store for the stuff in a generation A +# versA=$(mktemp) stdout "TMP file '$versA' created" nix-store -qR $DIR_A | sort -t'-' -k 2 > $versA stdout "Generation packages written for $GEN_A" - +# +# Querying the store for the stuff in a generation B +# versB=$(mktemp) stdout "TMP file '$versB' created" nix-store -qR $DIR_B | sort -t'-' -k 2 > $versB |