From ca0ac5b5dfb8ba16cd295148093fc1c003a515d9 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 13 Mar 2021 20:45:47 -0500 Subject: [PATCH] FIX make emacs parser more accurate --- dot_bin/executable_bootstrap_pkgs | 11 ++++------- run_once_after_10_install-packages.sh | 5 +++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dot_bin/executable_bootstrap_pkgs b/dot_bin/executable_bootstrap_pkgs index 9780abb..5480d28 100644 --- a/dot_bin/executable_bootstrap_pkgs +++ b/dot_bin/executable_bootstrap_pkgs @@ -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 diff --git a/run_once_after_10_install-packages.sh b/run_once_after_10_install-packages.sh index 08f2f5b..c66e77c 100644 --- a/run_once_after_10_install-packages.sh +++ b/run_once_after_10_install-packages.sh @@ -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