Skip to content

Commit

Permalink
Disable install options for packaged versions #469
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Oct 19, 2022
1 parent e379298 commit 0d13d6f
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# More documentation at: https://github.com/mviereck/x11docker

Version="7.5.0-beta-1"
Packagedversion="no" # Set to "yes" if you want to package x11docker. This disables installation options.

# --enforce-i: Enforce running in interactive mode to allow commands tty and weston-launch in special setups. (deprecated)
grep -q -- "--enforce-i" <<< "$*" && case $- in
Expand Down Expand Up @@ -365,7 +366,17 @@ Verbosity options:
-v, --verbose Be verbose. Output of x11docker.log on stderr.
-V Be verbose with colored output.
Installation options and cleanup (need root permissions):
Cleanup options (need root permissions):
--cleanup Clean up orphaned containers and cache files. Those
can remain if x11docker still runs on system shutdown.
Terminates currently running x11docker containers, too.
Regards (only) option --backend=BACKEND."

case "$Packagedversion" in
yes) ;;
*)
echo "
Installation options (need root permissions):
--install Install x11docker from current folder.
Useful to install from an extracted zip file.
--update [=diff] Download and install latest release from github.
Expand All @@ -374,14 +385,13 @@ Installation options and cleanup (need root permissions):
installed and new version without installing it.
--remove Remove x11docker from your system. Includes --cleanup.
Preserves ~/.local/share/x11docker from option --home.
--cleanup Clean up orphaned containers and cache files. Those
can remain if x11docker still runs on system shutdown.
Terminates currently running x11docker containers, too.
Regards (only) option --backend=BACKEND.
--update, --update-master and --remove regard a possible custom installation
path different from default /usr/bin directory.
Additional options are disregarded.
Additional options are disregarded."
;;
esac

echo "
Exit codes:
0: Success
64: x11docker error
Expand Down Expand Up @@ -11313,23 +11323,34 @@ main() {
setup_verbosity # create [and show] summary logfile # --verbose
check_containeruser # unprivileged user in container # --user
check_containerhomebasedir # check base dir for --home and possible rootfs # --homebasedir
check_backend # --backend

# Special x11docker jobs
[ "$Createlauncher" ] && {
create_launcher # --launcher: Create application launcher icon on desktop
finish
}
[ "$Cleanup" ] && { # --cleanup: Clean up cache and orphaned x11docker containers
check_optionset "--cleanup" "$(grep -v -E -- '--cleanup|--backend' <<< "$Optionsetall")" ||:
cleanup
finish
}
[ "$Installermode" ] && { # --install, --update, --update-master, --remove
case "$Packagedversion" in
yes)
case "$Installermode" in
--install|--update|--update-master|--remove)
error "Options --install|--update|--update-master|--remove
are not supported in packaged versions of x11docker.
Please use your package manager instead."
;;
esac
;;
esac
check_optionset "$Installermode" "$(grep -v -E -- '--install|--update|--update-master|--remove' <<< "$Optionsetall")" ||:
installer "$Installermode"
finish
}
check_backend # --backend
[ "$Cleanup" ] && { # --cleanup: Clean up cache and orphaned x11docker containers
check_optionset "--cleanup" "$(grep -v -E -- '--cleanup|--backend' <<< "$Optionsetall")" ||:
cleanup
finish
}
[ "$Buildimage" ] && { # --build: Build image from x11docker repository
check_optionset "--build" "$(grep -v -E -- '--build|--backend' <<< "$Optionsetall")" ||:
buildimage "$Imagename"
Expand Down

0 comments on commit 0d13d6f

Please sign in to comment.