summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfred2021-09-29 21:37:07 +0800
committerfred2021-09-29 21:37:07 +0800
commita5b65b6867aeab238c9f2ff9a86f49b0863d32eb (patch)
treef921f9a42f5d3ce692d30afe05703cb98d65bccd
parent7a0a5f467c8faccc1df672233deff690bf2da027 (diff)
downloadaur-a5b65b6867aeab238c9f2ff9a86f49b0863d32eb.tar.gz
skip su for current user
-rw-r--r--PKGBUILD30
1 files changed, 17 insertions, 13 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 5511cfb58b38..2fd2feb74a12 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer Yuqing Gu <sffred@qq.com>
pkgname=jupyter-wolframengine_kernel
pkgver=0.9.2
-pkgrel=2
+pkgrel=3
pkgdesc="Wolfram Language kernel for Jupyter notebooks"
arch=('any')
url="https://github.com/WolframResearch/WolframLanguageForJupyter"
@@ -17,20 +17,24 @@ source=("git+https://github.com/WolframResearch/WolframLanguageForJupyter.git")
sha256sums=('SKIP')
prepare() {
- echo -e "Login to your linux user that is used to activate WE.\nUsername: \c"
- read name
- if [ -z ${name} ]; then
- echo "Username cannot be empty"
- exit
- fi
- checkw=`su - ${name} -c 'wolframscript -c 1'`
- if [ $checkw -ne 1 ]; then
- echo "No valid wolframscript installation is found"
- exit
+ if [ `wolframscript -c 1 2> /dev/null` ]; then
+ echo `whoami` > ${srcdir}/username.conf
else
- echo "wolframscript activation checked"
+ echo -e "Login to your linux user that is used to activate WE.\nUsername: \c"
+ read name
+ if [ -z ${name} ]; then
+ echo "Username cannot be empty"
+ exit
+ fi
+ checkw=`su - ${name} -c 'wolframscript -c 1'`
+ if [ $checkw -ne 1 ]; then
+ echo "No valid wolframscript installation is found"
+ exit
+ else
+ echo "wolframscript activation checked"
+ fi
+ echo ${name} > ${srcdir}/username.conf
fi
- echo ${name} > ${srcdir}/username.conf
}
package() {