sysv-generator: use generator_add_symlink()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 Jul 2017 03:59:30 +0000 (23:59 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 13 Jul 2017 22:56:36 +0000 (18:56 -0400)
commit7f0cc63771aeb792bb5fff1e22c471132ffa054b
tree4d93ab89b9be781daaa75896bd7aa311f576e0c3
parent9cdcf3681c1a4139aff34541b5648234bf4aa1b1
sysv-generator: use generator_add_symlink()

generator_add_symlink() is extended to ignore EEXIST. This should be fine
for all existing callers.

There's a small difference in behaviour when adding symlinks in sysv-generator:
the message is more generic and does not include ", ignored". But creation of
symlinks shouldn't ever fail except if things are very wrong, so in practice
this shouldn't matter.

Test needed updating: os.path.exists(os.readlink(link)) only works if the link
is absolute (or if we are in the right directory). Let's just use
os.path.exists(link), which properly tests that the symlink target exists.
src/shared/generator.c
src/sysv-generator/sysv-generator.c
test/sysv-generator-test.py