summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea45952)
raw | patch | inline | side by side (parent: ea45952)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 5 Apr 2004 06:24:06 +0000 (06:24 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 5 Apr 2004 06:24:06 +0000 (06:24 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2255 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/admin.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 26ee060f7501960ac0f17a53b7d8c144c9dd1798..b1164924da7dee064d530b546e36570d0970e667 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- added "download_url" method to generate a correctly quoted URL for file
download links (sf bug 927745)
- all uses of TRACKER_WEB now ensure it ends with a '/'
+- roundup-admin install checks for existing tracker in target home
2004-03-27 0.7.0b2
diff --git a/roundup/admin.py b/roundup/admin.py
index 0c9fe44aa44dd4866de64eb3fdcf4de5bcd76d9c..57a7a0cfc5b825f6905d00d6dee5d4daf8ab5c37 100644 (file)
--- a/roundup/admin.py
+++ b/roundup/admin.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: admin.py,v 1.65 2004-04-03 21:32:24 richard Exp $
+# $Id: admin.py,v 1.66 2004-04-05 06:24:06 richard Exp $
'''Administration commands for maintaining Roundup trackers.
'''
raise UsageError, _('Not enough arguments supplied')
# make sure the tracker home can be created
+ tracker_home = os.path.abspath(tracker_home)
parent = os.path.split(tracker_home)[0]
if not os.path.exists(parent):
raise UsageError, _('Instance home parent directory "%(parent)s"'
' does not exist')%locals()
+ if os.path.exists(os.path.join(tracker_home, 'config.py')):
+ print _('WARNING: There appears to be a tracker in '
+ '"%(tracker_home)s"!')%locals()
+ print _('If you re-install it, you will lose all the data!')
+ ok = raw_input(_('Erase it? Y/N: ')).strip()
+ if ok.strip().lower() != 'y':
+ return 0
+
+ # clear it out so the install isn't confused
+ shutil.rmtree(tracker_home)
+
# select template
templates = self.listTemplates()
template = len(args) > 1 and args[1] or ''
if db_exists:
print _('WARNING: The database is already initialised!')
print _('If you re-initialise it, you will lose all the data!')
- ok = raw_input(_('Erase it? Y/[N]: ')).strip()
- if ok.lower() != 'y':
+ ok = raw_input(_('Erase it? Y/N: ')).strip()
+ if ok.strip().lower() != 'y':
return 0
# Get a database backend in use by tracker