summarylogtreecommitdiffstats
path: root/build_pkgs
diff options
context:
space:
mode:
authorBjörn Bidar2018-08-02 01:55:38 +0200
committerBjörn Bidar2018-08-02 02:20:36 +0200
commitbaff74fc80c8e196ef1d03c3ec5241e6b1810ac7 (patch)
tree53e173c02dad25a3503d626c1c3d65c5904a5501 /build_pkgs
parentc2fec3ce7c2022132f3b42ddad8e6f97f1bc10ea (diff)
downloadaur-baff74fc80c8e196ef1d03c3ec5241e6b1810ac7.tar.gz
build_pkgs: refaktor, take arguments to set desired builds
Diffstat (limited to 'build_pkgs')
-rwxr-xr-x[-rw-r--r--]build_pkgs58
1 files changed, 39 insertions, 19 deletions
diff --git a/build_pkgs b/build_pkgs
index 913c4b5dac66..de4254068e55 100644..100755
--- a/build_pkgs
+++ b/build_pkgs
@@ -1,31 +1,51 @@
#!/bin/bash
# default config
# default build arches
-CPU_ARCHES=(sandybridge skylake broadwell silvermont)
+DEFAULT_CPU_ARCHES=(generic skylake broadwell silvermont)
+
+
+build_pkg()
+{
+ echo 'source+=(batch_opts)' >> PKGBUILD
+ updpkgsums
+ makepkg --cleanbuild
+}
+
+# FIXME maybe check for local changes
+if ! git diff-index --quiet HEAD -- ; then
+ echo 'local changes found, please commit first' >&2
+ echo 'exit'
+ exit 1
+fi
+
# load local build script if found to apply gpg settings or alike, if existing
if [ -e build_pkgs.local ] ; then
source build_pkgs.local
fi
-# FIXME maybe check for local changes
+
# build generic first
git checkout .
-echo 'source+=(batch_opts)' >> PKGBUILD
-echo : > batch_opts
-updpkgsums
-makepkg -f --cleanbuild
-for cpu in ${CPU_ARCHES[*]} ; do
- git checkout PKGBUILD
- cat >> PKGBUILD <<EOF
-source+=(batch_opts)
-pkgname=(linux-pf-$cpu)
-eval "package_linux-pf-$cpu() {
- \$(declare -f _package)
- _package
- }"
+for cpu in "${@:-${DEFAULT_CPU_ARCHES[*]}}" ; do
+ git checkout PKGBUILD
+ case $cpu in
+ generic)
+ echo : > batch_opts
+ build_pkg
+ ;;
+ *)
+ cat >> PKGBUILD <<EOF
+source+=(batch_opts)
+pkgname=(linux-pf-$cpu)
+eval "package_linux-pf-$cpu() {
+ \$(declare -f _package)
+ _package
+ }"
EOF
- echo "CPU=$cpu" > batch_opts
- updpkgsums
- makepkg -f --cleanbuild
+ echo "CPU=$cpu" > batch_opts
+ build_pkg
+ ;;
+ esac
+ git checkout .
done
-git checkout .
+