forked from jrottenberg/ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-stackbrew-library.sh
executable file
·45 lines (36 loc) · 1.08 KB
/
generate-stackbrew-library.sh
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
#!/bin/bash
set -eu
array_2_8='2';
array_3_0='';
array_3_1='3 latest';
cd $(cd ${0%/*} && pwd -P);
declare -A variants='centos'
hash git 2>/dev/null || { echo >&2 "git not found, exiting."; }
versions=( */ )
versions=( "${versions[@]%/}" )
url='git://github.com/jrottenberg/ffmpeg'
echo '# maintainer: Julien Rottenberg <julien@rottenberg.info>'
for version in "${versions[@]}"; do
if [[ "$version" == "docs" ]]; then
continue
fi
eval stub=$(echo "$version" | awk -F. '{ print "$array_" $1 "_" $2 }');
commit="$(git log -1 --format='format:%H' -- "$version")"
fullVersion="$(grep -m1 'FFMPEG_VERSION=' "$version/Dockerfile" | cut -d'=' -f2 | cut -d ' ' -f1)"
versionAliases=( $fullVersion $version ${stub} )
echo
for va in "${versionAliases[@]}"; do
echo "$va: ${url}@${commit} $version"
done
for variant in $variants; do
commit="$(git log -1 --format='format:%H' -- "$version/$variant")"
for va in "${versionAliases[@]}"; do
if [ "$va" = 'latest' ]; then
va="$variant"
else
va="$va-$variant"
fi
echo "$va: ${url}@${commit} $version/$variant"
done
done
done