-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtransform_binary.sh
More file actions
executable file
·51 lines (45 loc) · 1.28 KB
/
transform_binary.sh
File metadata and controls
executable file
·51 lines (45 loc) · 1.28 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
VERSION=$1
if [[ -z "${VERSION}" ]]
then
echo >&2 "Fatal error: VERSION not set"
echo >&2 "Fatal error: Need to provide version, example: 5.62.0"
exit 2
fi
CBMC_STRING="CbmcAT"
VERSION_PROCESSED="${VERSION//./}"
FORMULA_VERSION="${CBMC_STRING}${VERSION_PROCESSED}"
TAGS=(
"arm64_sonoma"
"arm64_ventura"
"arm64_monterey"
"arm64_tahoe"
"arm64_sequoia"
"sonoma"
"ventura"
"monterey"
"arm64_linux"
"x86_64_linux"
)
echo " bottle do"
echo " root_url \"https://github.com/diffblue/homebrew-cbmc/releases/download/bag-of-goodies\""
for TAG in "${TAGS[@]}"
do
#echo "Processing bottle for $VERSION -- $TAG"
brew fetch cbmc --bottle-tag="${TAG}" >/dev/null
BOTTLE_NAME=$(brew --cache cbmc --bottle-tag="${TAG}")
if [[ -z "${BOTTLE_NAME}" ]]
then
continue
fi
tar -xzf "${BOTTLE_NAME}"
mv cbmc cbmc@"${VERSION}"
sed -iu "s/class Cbmc/class ${FORMULA_VERSION}/g" "cbmc@${VERSION}/${VERSION}/.brew/cbmc.rb"
tar czf "cbmc@${VERSION}-${VERSION}.${TAG}.bottle.tar.gz" cbmc@"${VERSION}"
rm -rf cbmc@"${VERSION}"
SHA=$(shasum -a 256 "cbmc@${VERSION}-${VERSION}.${TAG}.bottle.tar.gz")
TAG_SPACED=$(printf "%-60s" " sha256 cellar: :any_skip_relocation, ${TAG}:")
LINE="${TAG_SPACED}\"${SHA%%[[:space:]]*}\""
echo "${LINE}"
done
echo " end"