summarylogtreecommitdiffstats
path: root/update.PKGBUILD
blob: 7595da9c92b7c238e2190b34b75307d648f8870d (plain)
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
#!/bin/bash
#source PKGBUILD
_gitname=gegl
srcdir=$PWD/src

declare -A dep_versions
readonly -a deps=(babl)

echo "##update sources"
makepkg -Co
echo "##finish updating sources"

## probe configure.ac for dependencies versions
# the rest have standard form of "[{dep_name}_raqured_version], [{version}]"
for dep in ${deps[*]};do
	dep_versions["_${dep}_version"]=$(grep -oP "dependency\('babl'.*version: *'>=\K.*(?='\))"  ${srcdir}/${_gitname}/meson.build)
done

echo "##probed deps versions:" >&2
for key in ${!dep_versions[*]};do echo $key:${dep_versions[$key]};done >&2

echo "##generate PKGBUILD" >&2
cp -v --backup=numbered PKGBUILD.in PKGBUILD
for key in ${!dep_versions[*]};do sed -i "s/@${key}@/${dep_versions[${key}]}/" PKGBUILD;done >&2
echo "##finish generating PKGBUILD"

echo "##update pkgver"
makepkg -eo
echo "##finish updating pkgver"

echo "##generate .SRCINFO" >&2
makepkg --printsrcinfo > .SRCINFO
echo "##finish updating package" >&2