summarylogtreecommitdiffstats
diff options
context:
space:
mode:
author160R2020-04-11 13:11:00 +0200
committer160R2020-04-11 13:11:00 +0200
commit662ea1a8130d21be4dd2783cb64f465c3b9d48bd (patch)
treeaf6a9941efb5e95fc418d88242c90e91cf3610c2
parentffb8f7a3e7c85ca1759e875f9c0fac83f726dcf9 (diff)
downloadaur-662ea1a8130d21be4dd2783cb64f465c3b9d48bd.tar.gz
add. rustc version check
-rw-r--r--PKGBUILD15
1 files changed, 15 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7645a1463c3e..c8af7846c189 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,6 +20,21 @@ pkgver() {
git describe --tags --abbrev=0
}
+prepare() {
+ rustc_version=$([[ "$(rustc --version)" =~ rustc\ 1.([0-9]+).* ]] && echo "${BASH_REMATCH[1]}")
+
+ (($rustc_version >= 40)) && return 0;
+
+ # Set error color
+ echo -e '\e[0;31m'
+ echo 'Minimum supported rust version is 1.40.0, please update'
+ echo ' * rustup way: `rustup update`'
+ echo ' * pacman way: `pacman -Sy rust`'
+ # Reset color
+ echo -e '\e[0m'
+ return 1
+}
+
package() {
checkout_project_root