summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoan Figueras2021-01-25 23:17:48 +0100
committerJoan Figueras2021-01-25 23:17:48 +0100
commita15182ef7e593667caf4e2fca0ea02c702e5f1c4 (patch)
tree68f260e145e76b1cf2a2fb44d5e92aa0c78cc549
parentc91485aebbe47e69ddacc7fb18bed21760d0ddfb (diff)
downloadaur-a15182ef7e593667caf4e2fca0ea02c702e5f1c4.tar.gz
Improved myconfig code to use a loop
-rw-r--r--PKGBUILD30
1 files changed, 16 insertions, 14 deletions
diff --git a/PKGBUILD b/PKGBUILD
index ec0325ac9a88..a636ba94cf30 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -149,21 +149,23 @@ prepare() {
sh ${srcdir}/choose-gcc-optimization.sh $_microarchitecture
# This is intended for the people that want to build this package with their own config
- # Put the file "myconfig" at the package folder to use this feature
- # If it's a full config, will be replaced
- # If not, you should use scripts/config commands, one by line
- if [ -f "${startdir}/myconfig" ]; then
- if ! grep -q 'scripts/config' "${startdir}/myconfig"; then
- # myconfig is a full config file. Replacing default .config
- msg2 "Using user CUSTOM config..."
- cp -f "${startdir}"/myconfig .config
- else
- # myconfig is a partial file. Executing as a script
- msg2 "Applying myconfig..."
- bash -x "${startdir}"/myconfig
+ # Put the file "myconfig" at the package folder (this will take preference) or "${XDG_CONFIG_HOME}/linux-xanmod/myconfig"
+ # If we detect partial file with scripts/config commands, we execute as a script
+ # If not, it's a full config, will be replaced
+ for _myconfig in "${startdir}/myconfig" "${XDG_CONFIG_HOME}/linux-xanmod/myconfig" ; do
+ if [ -f "${_myconfig}" ]; then
+ if grep -q 'scripts/config' "${_myconfig}"; then
+ # myconfig is a partial file. Executing as a script
+ msg2 "Applying myconfig..."
+ bash -x "${_myconfig}"
+ else
+ # myconfig is a full config file. Replacing default .config
+ msg2 "Using user CUSTOM config..."
+ cp -f "${_myconfig}" .config
+ fi
+ echo
fi
- echo
- fi
+ done
make olddefconfig