Bug#985459: dh-elpa: install error when root user has packages under /root/.emacs.d/elpa
Hi Sean,
On 03/18/21 18:31 PM, Sean Whitton wrote:
>
> Thank you for the report. Can you test this patch, please?
>
> diff --git a/helper/install b/helper/install
> index 1a2eb8a..af93ee4 100755
> --- a/helper/install
> +++ b/helper/install
> @@ -51,6 +51,8 @@ echo install/${ELPA_DIR}: byte-compiling for ${FLAVOR}
> (cd ${elc_dir}
> set +e
> ${FLAVOR} --quick --batch -l package \
> + --eval "(setq package-directory-list \
> + (delete package-user-dir package-directory-list))" \
> --eval "(add-to-list 'package-directory-list \"$src_dir\")" \
> -f package-initialize -f batch-byte-compile *.el > Install.log 2>&1
> if test $? -ne 0
I've just tried this but unfortunately I get the same error. I think
it's because package-load-all-descriptors in package.el always cons-es
package-user-dir on the front of package-directory-list when it searches
for a package
(defun package-load-all-descriptors ()
...
(dolist (dir (cons package-user-dir package-directory-list))
(when (file-directory-p dir)
...)))
Perhaps an alternative is to set package-user-dir to a temporary
directory that's guaranteed not to contain any existing packages.
--
Thanks,
Nick
Reply to: