Clone in a terminal:
Commit f9db4fe
Johan Mattsson - 2012-12-21T14:15:33+00:00
f9db4fe384c9648ab4e2c59f89580272f538da05johan.mattsson.m@gmail.com

uninstaller

Changed files (3)

Diff

diff --git a/dodo.py b/dodo.pyindex 34c26a4..8759126 100644--- a/dodo.py+++ b/dodo.py@@ -19,7 +19,10 @@ def task_build (): 	if not os.path.exists ("build/configured"): 		print ("Project is not configured") 		exit (1)-		+	+	subprocess.check_output ('mkdir -p build', shell=True)+	subprocess.check_output ('touch build/installed', shell=True)+	 	return  { 		'actions': ['echo "Build"'], 	}	diff --git a/install b/installindex 6f93f72..b6f46fc 100755--- a/install+++ b/install@@ -4,18 +4,24 @@ import subprocess from optparse import OptionParser  def install (file, dir):-	print ("install: " + dest + prefix + dir + '/' + file)+	f = dest + prefix + dir + '/'+	s = file.rfind ('/')+	if s > -1:+		f += file[s + 1:]+	else:+		f += file+	print ("install: " + f) 	subprocess.check_output ('install -d ' + dest + prefix + dir, shell=True) 	subprocess.check_output ('install ' + file + ' ' + dest + prefix + dir + '/', shell=True)-+	installed.write (f + "\n")  if not os.path.exists ("build/configured"): 	print ("Project is not configured") 	exit (1)  parser = OptionParser()-parser.add_option("-p", "--prefix", dest="prefix", help="install prefix", metavar="PREFIX")-parser.add_option("-d", "--dest", dest="dest", help="install to this directory", metavar="DEST")+parser.add_option ("-p", "--prefix", dest="prefix", help="install prefix", metavar="PREFIX")+parser.add_option ("-d", "--dest", dest="dest", help="install to this directory", metavar="DEST")  (options, args) = parser.parse_args() @@ -28,11 +34,16 @@ if not options.dest: prefix = options.prefix dest = options.dest +# create uninstall file+installed = open ('build/installed', 'w')+installed.write ('build/installed\n')++# install it: for file in os.listdir('./layout'):-	install ('./layout/' + file, '/share/birdfont/layout')+	install ('layout/' + file, '/share/birdfont/layout')  for file in os.listdir('./icons'):-	install ('./icons/' + file, '/share/birdfont/icons')+	install ('icons/' + file, '/share/birdfont/icons')  install ('linux/birdfont.desktop', '/share/birdfont/applications') install ('linux/birdfont.png', '/share/icons/hicolor/48x48/apps')@@ -41,3 +52,5 @@ install ('build/birdfont-export', '/bin') install ('build/libbirdfont.so', '/lib') install ('build/birdfont.1.gz', '/share/man/man1') install ('build/birdfont-export.1.gz', '/share/man/man1')++installed.close ()diff --git a/uninstall b/uninstallnew file mode 100755index 0000000..ab532b1--- /dev/null+++ b/uninstall@@ -0,0 +1,17 @@+#!/usr/bin/python +import os+import subprocess++if not os.path.exists ("build/configured"):+	print ("Project is not configured")+	exit (1)++if not os.path.exists ("build/installed"):+	print ("Project is not installed")+	exit (1)+		+f = open('build/installed')+for file in iter(f):+	print ('Removing ' + file.replace ('\n', ''))+	subprocess.check_output ('rm ' + file, shell=True)+f.close()

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112