File tree Expand file tree Collapse file tree 4 files changed +47
-38
lines changed
Expand file tree Collapse file tree 4 files changed +47
-38
lines changed Original file line number Diff line number Diff line change 1313 nix build ${ contextFreeDrv target }
1414 '' ;
1515 targetDrv = target . drvPath ;
16- proviso =
16+ proviso = let
17+ filter = ./build-filter.jq ;
18+ in
1719 l . toFile "build-proviso"
1820 # bash
1921 ''
20- # FIXME: merge upstream to avoid any need for runtime context
21- command nix build github:divnix/nix-uncached?ref=refs/pull/2/head
22-
2322 local -a drvs
2423 eval "$(
25- command jq --raw-output '
26- "drvs=(\(map(.targetDrv|strings)|@sh))"
27- ' <<< "$1"
24+ command jq --raw-output '"drvs=(\(map(.targetDrv|strings)|@sh))"' <<< "$1"
2825 )"
2926
27+ # FIXME: merge upstream to avoid any need for runtime context
28+ command nix build github:divnix/nix-uncached?ref=refs/pull/2/head
29+
3030 command jq --raw-output \
3131 --argjson checked "$(./result/bin/nix-uncached '' ${drvs[@]})" \
32- ' (
33- $checked | with_entries(select(.value == [])) | keys
34- ) as $cached
35- | map(select(
36- [.targetDrv] | IN($cached) | not
37- ))
38- ' <<< "$1"
32+ --from-file ${ filter } <<< "$1"
3933
4034 unset drvs
4135 '' ;
Original file line number Diff line number Diff line change 1+ . as $inputs
2+
3+ | $inputs | map ( select (
4+ .meta.images [0 ] | inside ($available ) | not
5+ ))
Original file line number Diff line number Diff line change 7070 copy docker://${ img }
7171 '' ;
7272 meta . images = map ( tag : "${ img } :${ tag } " ) tags ;
73- proviso = l . toFile "container-proviso" ''
74- function _scopeo_inspect() {
75- if command &>/dev/null skopeo inspect --insecure-policy "docker://$image"; then
76- echo "$image"
77- fi
78- }
79- export -f _scopeo_inspect
73+ proviso = let
74+ filter = ./container-publish-filter.jq ;
75+ in
76+ l . toFile "container-proviso" ''
77+ function _scopeo_inspect() {
78+ if command &>/dev/null skopeo inspect --insecure-policy "docker://$image"; then
79+ echo "$image"
80+ fi
81+ }
82+ export -f _scopeo_inspect
8083
81- function scopeo_inspect() {
82- echo "$@" | command xargs -n 1 -P 0 -I {} bash -c '_scopeo_inspect "$@"'
83- }
84+ function scopeo_inspect() {
85+ echo "$@" | command xargs -n 1 -P 0 -I {} bash -c '_scopeo_inspect "$@"'
86+ }
8487
85- declare -a images
86- eval "$(
87- command jq --raw-output '
88- "images=(\(map(.meta.images[0]|strings)|@sh))"
89- ' <<< "$1"
90- )"
88+ declare -a images
89+ eval "$(
90+ command jq --raw-output '
91+ "images=(\(map(.meta.images[0]|strings)|@sh))"
92+ ' <<< "$1"
93+ )"
9194
92- command jq --raw-output \
93- --arg available "$(_scopeo_inspect '' ${images[@]})" \
94- ' map(select(
95- .meta.images[0] | inside($available) | not
96- ))
97- ' <<< "$1"
95+ command jq --raw-output \
96+ --arg available "$(_scopeo_inspect '' ${images[@]})" \
97+ --from-file ${ filter } <<< "$1"
9898
99- unset images
100- '' ;
99+ unset images
100+ '' ;
101101 } )
102102 ( mkCommand currentSystem {
103103 name = "load" ;
Original file line number Diff line number Diff line change 1+ . as $inputs |
2+
3+ ( $checked
4+ | with_entries (select (.value == []))
5+ | keys
6+ ) as $cached
7+
8+ | $inputs | map ( select (
9+ [.targetDrv ] | IN ($cached ) | not
10+ ))
You can’t perform that action at this time.
0 commit comments