Perform PATH home directory expansion.

Expands ~/ components inside PATH, which is shell agnostic.

This is what I intended in my original proposal for home directory expansion, as this doesn't involve rewriting the command and is completely shell agnostic.

$SHELL -c 'command' will already perform home expansion on the *command* (if supported by the shell). Performing ~ expansion in the command as well however doesn't hurt when the command isn't run through the shell -c flag.
On 11/05/2014 05:31 PM, Alexandre Detiste wrote:
>> @@ -46,8 +58,10 @@ def parse_crontab(filename, withuser=True, monotonic=False):
>>                       start_hours_range = value
>>                  elif envvar.group(1) == 'PERSISTENT':
>>                       persistent = {'true': True, 'yes': True, '1': True}.get(value.lower(), False)
>> +                elif not withuser and envvar.group(1) == 'PATH':
>> +                     environment['PATH'] = expand_home_path(value, basename)
> 
> do you really mean to call it only for the crontabs in @statedir@ ?

Yes.

In any other case, ~ would be ambiguous.
Imagine a cron.d specifying:

PATH=~/bin:...

@daily	user	command

Is PATH in this case ~root or ~user?
And certainly you never want to expand root's when not in the @statedir@.