summarylogtreecommitdiffstats
path: root/ccstudio.install
diff options
context:
space:
mode:
authorAlexei Colin2017-06-23 00:41:22 -0400
committerAlexei Colin2017-06-23 00:41:51 -0400
commit93927414719b4c257dfabb4991482d2e960e4300 (patch)
treeda68cd55fda9274af6e208b26a6cb5d67799e4a5 /ccstudio.install
parente6d316f08d5eb7fab3b56f01e4dc297f0b557bc4 (diff)
downloadaur-93927414719b4c257dfabb4991482d2e960e4300.tar.gz
install: create group
Diffstat (limited to 'ccstudio.install')
-rw-r--r--ccstudio.install26
1 files changed, 22 insertions, 4 deletions
diff --git a/ccstudio.install b/ccstudio.install
index 05a84810c9c8..ebef74345533 100644
--- a/ccstudio.install
+++ b/ccstudio.install
@@ -1,14 +1,32 @@
_dir=/opt/ccstudio/ccsv7
+_grp=ccstudio
post_install() {
- echo ">>> To install software from within CCS, run ccstudio as root."
- echo ">>> For normal usage, run as normal user."
+ # Since CCS manages its own updates, and treats it's install directory
+ # as its working directory, we can't leave it owned by root
+ #
+ # This is still hacky, since files that CCS creates will be
+ # created under user's group, not ccstudio group, and running
+ # CCS via newgrp is not a solution, since it would affect project
+ # files (which we do want created under user's group).
+
+ getent group ${_grp} &>/dev/null || {
+ echo ">>> Creating group ${_grp}"
+ groupadd $_grp
+ }
+
+ chgrp -R $_grp $_dir
+
+ echo ">>> Run this command as each user who will run CCS, to add to '${_grp}' group:"
+ echo ">>> sudo usermod -a -G ${_grp} \$(whoami)"
}
post_remove() {
- # Since CCS manages its own updates, and treats it's install directory
- # as its working directory, there's cache and trash left over
+ # Since CCS treats its install direcotry as working directory, trash is left.
# NOTE: other directories (${_dir}/tools) might have also been created, but
# some are owned by other packages (e.g. compiler), so be conservative.
rm -rf ${_dir}/eclipse
+
+ # NOTE: we do not remove the group, to not orphan files
+ # in case some files don't get removed.
}