summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-01-20 01:58:57 +0100
committerDave Andreoli <dave@gurumeditation.it>2015-01-20 01:58:57 +0100
commitd4572bf26ac625af9663de6cb8f50b3d0fac0a05 (patch)
tree8b45573b96f64cd0938bf38a6d2864a1fa139c71 /setup.py
parent4a533f73dfabc95750c9e386b7e666cafec06d7a (diff)
Keep track of installed files by py version
Now you can install/uninstall using more than one python versions
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 2ad00ed..b37ec58 100755
--- a/setup.py
+++ b/setup.py
@@ -125,6 +125,7 @@ class CleanGenerated(Command):
125 125
126 126
127# === setup.py uninstall command === 127# === setup.py uninstall command ===
128RECORD_FILE = "installed_files-%d.%d.txt" % sys.version_info[:2]
128class Uninstall(Command): 129class Uninstall(Command):
129 description = 'remove all the installed files recorded at installation time' 130 description = 'remove all the installed files recorded at installation time'
130 user_options = [] 131 user_options = []
@@ -153,10 +154,10 @@ class Uninstall(Command):
153 directory = os.path.dirname(directory) 154 directory = os.path.dirname(directory)
154 155
155 def run(self): 156 def run(self):
156 if not os.path.exists("installed_files.txt"): 157 if not os.path.exists(RECORD_FILE):
157 print('Warning: No installed_files.txt file found!') 158 print('ERROR: No %s file found!' % RECORD_FILE)
158 else: 159 else:
159 for entry in open("installed_files.txt").read().split(): 160 for entry in open(RECORD_FILE).read().split():
160 self.remove_entry(entry) 161 self.remove_entry(entry)
161 162
162 163
@@ -511,7 +512,7 @@ setup(
511 'release': ('setup.py', RELEASE), 512 'release': ('setup.py', RELEASE),
512 }, 513 },
513 'install': { 514 'install': {
514 'record': ('setup.py', 'installed_files.txt'), 515 'record': ('setup.py', RECORD_FILE),
515 } 516 }
516 }, 517 },
517 packages=packages, 518 packages=packages,