Created
August 12, 2016 16:46
-
-
Save j6s/75e12222048ed477a60a97224f93d6e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'colorize'; | |
@about = %q( | |
Removes some library file in a local steam installation in order to fix swrast driver | |
issues that appear because of incompatible libraries. | |
Usage: | |
fixSteam.rb [action] | |
actions: | |
- help: print this message | |
- simulate: Print out the operations without actually executing them | |
- fix: Execute operations | |
Author: Johannes Hertenstein | |
); | |
@operations = [ | |
"find ~/.steam/root/ -name \"libgpg-error.so*\" -print -delete", | |
"rm -v ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/lib/x86_64-linux-gnu/libgcc_s.so.1", | |
"rm -v ~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6" | |
]; | |
# | |
# Simulate the executions | |
# | |
def simulate() | |
@operations.each do |op| | |
puts ('$ ' + op).blue | |
end | |
end | |
# | |
# Actually remove the files | |
# | |
def remove() | |
@operations.each do |op| | |
puts ('$ ' + op).blue; | |
puts `#{op}`.light_black; | |
end | |
end | |
def main(action="help") | |
if action == "simulate" | |
simulate(); | |
elsif action == "fix" | |
remove(); | |
else | |
puts @about; | |
end | |
end | |
main(ARGV[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment