Skip to content

Instantly share code, notes, and snippets.

@j6s
Created August 12, 2016 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j6s/75e12222048ed477a60a97224f93d6e8 to your computer and use it in GitHub Desktop.
Save j6s/75e12222048ed477a60a97224f93d6e8 to your computer and use it in GitHub Desktop.
#!/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