Bug#985459: dh-elpa: install error when root user has packages under /root/.emacs.d/elpa
Nick Gasson <nick@nickg.me.uk> writes:
> 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
Setting user-package-dir to a nonexistent directory also seems to
work. Nick, can you try the dh-elpa version at
https://salsa.debian.org/emacsen-team/dh-elpa ? Or just apply
https://salsa.debian.org/emacsen-team/dh-elpa/-/commit/600a1133903eb2f7d3b7d954467dcee0b2d0277b
to /usr/lib/dh-elpa/helper/install
Some possible alternatives:
1) maybe Sean remembers the proposed convention for a known empty
directory? Is this usable in stable?
2) We could create and clean up an empty temporary directory
3) We could create /usr/lib/dh-elpa/empty
Reply to: