diff options
author | Joan Figueras | 2021-01-25 23:18:42 +0100 |
---|---|---|
committer | Joan Figueras | 2021-01-25 23:18:42 +0100 |
commit | 2f5035f7048b4902d433a306d18c09bc53882e72 (patch) | |
tree | 8195cd3f79af7fccc0595446d8a2cd18f93e4782 | |
parent | 9071bfcf6ab3053007c118107e95b12a19043dd4 (diff) | |
download | aur-2f5035f7048b4902d433a306d18c09bc53882e72.tar.gz |
Improved myconfig code to use a loop
-rw-r--r-- | PKGBUILD | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -162,21 +162,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 |