FIX make emacs parser more accurate

This commit is contained in:
Nathan Dwarshuis 2021-03-13 20:45:47 -05:00
parent 21e7d6b6ab
commit ca0ac5b5df
2 changed files with 7 additions and 9 deletions

View File

@ -56,12 +56,6 @@ call_makepkg() {
sudo -u nobody MAKEFLAGS="-j$(nproc)" makepkg -s -r -i -f --noconfirm
}
get_emacs_packages() {
emacs -batch -l "$emacs_dir/init.el" --eval \
"(print (s-join \" \" $1))" 2>/dev/null | \
sed -n -e 's/"\(.*\)"/\1/p'
}
run_yay() {
## TODO add template switches to control which of these get installed based
## on my config
@ -69,7 +63,10 @@ run_yay() {
## packages for emacs (install emacs first to read the config)
pacman --needed -S emacs
IFS=' ' read -r -a emacs_pkgs \
< <(get_emacs_packages "(nd/get-aur-dependencies t)")
< <(emacs -batch -l "$emacs_dir/init.el" --eval \
'(print (format "phgs: %s" (s-join " " (nd/get-aur-dependencies t))))' \
2>/dev/null \
sed -n -e 's/"pkgs: \(.*\)"/\1/p')
echo "Emacs requires the following system pkgs: ${emacs_pkgs[*]}"
## other packages for random gizmos

View File

@ -52,8 +52,9 @@ sudo "$HOME/.bin/bootstrap_pkgs" "$HOME/.local/share/packages" "$emacs_dir"
IFS=' ' read -r -a emacs_stack_pkgs \
< <(emacs -batch -l "$emacs_dir/init.el" --eval \
"(print (s-join \" \" (nd/get-stack-dependencies)))" 2>/dev/null | \
sed -n -e 's/"\(.*\)"/\1/p')
'(print (format "phgs: %s" (s-join " " (nd/get-stack-dependencies))))' \
2>/dev/null | \
sed -n -e 's/"pkgs: \(.*\)"/\1/p')
echo "Emacs requires the following Haskell packages: ${emacs_stack_pkgs[*]}"
for p in "${emacs_stack_pkgs[@]}";
do