Skip to content

Commit

Permalink
Fix java uninstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Jan 13, 2024
1 parent ae29e5f commit 25277e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion robotpy_installer/cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def _ensure_requirements(

# does c++/java exist
with wrap_ssh_error("removing c++/java user programs"):
cpp_java_exists = roborio_utils.uninstall_cpp_java_lvuser(ssh)
cpp_java_exists = not roborio_utils.uninstall_cpp_java_lvuser(ssh)

# does python exist
with wrap_ssh_error("checking if python exists"):
Expand Down
6 changes: 2 additions & 4 deletions robotpy_installer/roborio_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ def uninstall_cpp_java_lvuser(ssh: SshController) -> bool:
# Kill code only if cpp exe present
f"[ ! -f {cpp_exe} ] || {kill_robot_cmd}",
f"rm -rf {' '.join(rm_paths)}",
check=True,
print_output=True,
)

# Check if admin pieces need to run
result = ssh.exec_bash(
'[ -z "$(opkg list-installed frc*-openjdk-*)" ]'
'[ -z "$(opkg list-installed frc*-openjdk-*)" ]',
f'[ ! -d {third_party_libs} ] || [ -z "$(ls /usr/local/frc/third-party/lib)" ]',
# This is copied with admin privs, can't delete as lvuser
f"[ ! -d {static_deploy} ]",
Expand All @@ -58,7 +56,7 @@ def uninstall_cpp_java_admin(ssh: SshController):

logger.info("Clearing FRC C++/Java program support")

rm_paths = (third_party_libs,)
rm_paths = (third_party_libs, static_deploy)

ssh.exec_bash(
# Remove java ipk
Expand Down

0 comments on commit 25277e3

Please sign in to comment.