[systemd-devel] [RFC PATCH] Fix so install will work without 'ln --relative' support

Harald Hoyer harald.hoyer at gmail.com
Fri May 16 04:04:52 PDT 2014


On 16.05.2014 06:22, Zbigniew Jędrzejewski-Szmek wrote:
> On Fri, May 16, 2014 at 12:30:45AM +0200, Lennart Poettering wrote:
>>
>> I'd really prefer if somebody who's a true shell guru could look over
>> this. Harald? (Or Zbigniew?)
> If I review it, do I get to become a true shell guru? ;)


So.. here is my shell implementation (tested for some years):

http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/dracut-functions.sh#n300

With convert_abs_rel()
http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/dracut-functions.sh#n246

and normalize_path()
http://git.kernel.org/cgit/boot/dracut/dracut.git/tree/dracut-functions.sh#n239


normally I stop reviewing shell code for bash, when I see something like:

`` and "head -1" and "cut -d ' ' -f 4"

* `` should be $()
* "head -1" can be "{ read line; do_something_with $line;}"
* "cut -d ' ' -f 4" can be "{ read a a a val a; do_something with $val; }" or
even use "read -a ..."
* ... the list goes on


More information about the systemd-devel mailing list