fceux/uninstall.py

38 lines
864 B
Python
Raw Normal View History

2008-09-24 07:07:17 +00:00
#!/usr/bin/env python
# uninstall script for gfceux
# if gfceux was installed in an non-default prefix, you can specify it
# as an argument
#
# sudo ./uninstall.py [prefix]
#
2009-02-16 09:40:28 +00:00
# prefix must include slash at end
#TODO: fix that
#TODO: remove python package? (site-package/gfceux/etc)
2008-09-24 07:07:17 +00:00
import os
import dircache
2009-02-16 09:40:28 +00:00
import sys
2008-09-24 07:07:17 +00:00
prefix = "/usr/"
2009-02-16 09:40:28 +00:00
try:
if sys.argv[1]:
prefix = sys.argv[1]
except IndexError:
pass
2008-09-24 07:07:17 +00:00
2009-02-16 09:40:28 +00:00
# first include data places scattered in /usr
files = [
"share/pixmaps/gfceux.png",
"share/man/man1/gfceux.1",
"share/applications/gfceux.desktop",
"bin/gfceux"]
# then include the files in our /usr/share/gfceux
for x in dircache.listdir(prefix + "share/gfceux"):
files.append("share/gfceux/" + x)
2008-09-24 07:07:17 +00:00
for x in files:
os.remove(prefix+x)
2009-02-16 09:40:28 +00:00
# go ahead and remove our shared folder if its empty
2008-09-24 07:07:17 +00:00
os.rmdir(prefix+"share/gfceux")