Skip to content

Commit

Permalink
When installing the decompiler, do not remove the entire share dire…
Browse files Browse the repository at this point in the history
…ctory (avast#12).

Remove only the subdirectories and files that are used by RetDec. This should
reduce the chance of unintentionally removing system directories when RetDec is
accidentally installed on Linux into e.g. `/usr` as the `arm`, `generic`, and
`x86` directories are not commonly used by Linux distributions.

Nevertheless, as mentioned in our README, until our build system properly
supports system-wide installations, RetDec should to be installed into a clean,
dedicated directory.
  • Loading branch information
s3rvac authored and Hugo Klepsch committed Dec 19, 2017
1 parent 82f7efc commit bcd60be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# dev

* Fix: When installing the decompiler, do not remove the entire `share` directory (#12).
* Fix: Improve OS type detection when installing the decompiler.
* Fix: Remove useless OS type detection when running decompilations (#10).

Expand Down
7 changes: 5 additions & 2 deletions cmake/install-share.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ ARCH_NAME="retdec-support"_"$VERSION.$ARCH_SUFFIX"
cleanup()
{
rm -f "$INSTALL_PATH/$ARCH_NAME"
rm -rf "$SHARE_DIR"
rm -rf "$SHARE_DIR/arm"
rm -rf "$SHARE_DIR/generic"
rm -rf "$SHARE_DIR/x86"
rm -f "$SHARE_DIR/version.txt"
}

# Check arguments.
Expand Down Expand Up @@ -52,7 +55,7 @@ if [ -d "$SHARE_DIR" ]; then
fi
fi

rm -rf "$SHARE_DIR"
cleanup
fi

# Make sure destination directory exists.
Expand Down

0 comments on commit bcd60be

Please sign in to comment.