forked from docker-library/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.architectures-lib
38 lines (32 loc) · 1015 Bytes
/
.architectures-lib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
_awkArch() {
local version="$1"; shift
local awkExpr="$1"; shift
local file="$version/release-architectures"
[ -f "$file" ] || file='release-architectures'
awk "$@" "/^#|^\$/ { next } $awkExpr" "$file"
}
dpkgArches() {
local version="$1"; shift
_awkArch "$version" '{ print $2 }'
}
hasBashbrewArch() {
local version="$1"; shift
local bashbrewArch="$1"; shift
_awkArch "$version" 'BEGIN { exitCode = 1 } $1 == bashbrewArch { exitCode = 0 } END { exit exitCode }' -v bashbrewArch="$bashbrewArch"
}
dpkgToBashbrewArch() {
local version="$1"; shift
local dpkgArch="$1"; shift
_awkArch "$version" '$2 == dpkgArch { print $1; exit }' -v dpkgArch="$dpkgArch"
}
dpkgToJuliaTarArch() {
local version="$1"; shift
local dpkgArch="$1"; shift
_awkArch "$version" '$2 == dpkgArch { print $3; exit }' -v dpkgArch="$dpkgArch"
}
dpkgToJuliaDirArch() {
local version="$1"; shift
local dpkgArch="$1"; shift
_awkArch "$version" '$2 == dpkgArch { print $4; exit }' -v dpkgArch="$dpkgArch"
}