activation: Replace exists() with is_symlink()/is_directory()

When the symlink is pointing to a directory that doesn't exist,
the exists() check returns false even though the symlink exists,
causing the symlink to not be removed so a failure occurs when
changing the symlink to point to a new version.

Check instead via is_symlink which doesn't care if the target
that the symlink is pointing at exists or not.

This could happen when the user deletes the image that the
symlink is pointing at before activating a new image.

Also use is_directory() to check for directory existance.

Change-Id: Id4548c2f3292b5460317951334d9151e2c4fbab7
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
1 file changed
tree: 92b7c32f2fa3495063c79c5bd0c4a2de601e770e
  1. m4/
  2. test/
  3. .gitignore
  4. activation.cpp
  5. activation.hpp
  6. bootstrap.sh
  7. configure.ac
  8. generate-squashfs
  9. item_updater.cpp
  10. item_updater.hpp
  11. item_updater_main.cpp
  12. LICENSE
  13. Makefile.am
  14. README.md
  15. version.hpp
README.md

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To full clean the repository again run `./bootstrap.sh clean`.