Check is RCS is installed (this is an improvement on r10775)

svn: r10777
This commit is contained in:
Brian Matherly 2008-06-01 20:51:00 +00:00
parent fc5dafb42f
commit 3630d9386e

View File

@ -44,12 +44,12 @@ import logging
LOG = logging.getLogger(".DbManager")
if os.sys.platform == "win32":
RCS_FOUND = os.system("rcs -V >nul 2>nul") == 0
if RCS_FOUND and not os.environ.has_key("TZ"):
_RCS_FOUND = os.system("rcs -V >nul 2>nul") == 0
if _RCS_FOUND and not os.environ.has_key("TZ"):
# RCS requires the "TZ" variable be set.
os.environ["TZ"] = str(time.timezone)
else:
RCS_FOUND = os.system("rcs -V >/dev/null 2>/dev/null") == 0
_RCS_FOUND = os.system("rcs -V >/dev/null 2>/dev/null") == 0
#-------------------------------------------------------------------------
#
@ -324,7 +324,7 @@ class DbManager(CLIDbManager):
self.top.connect('drag_motion', drag_motion)
self.top.connect('drag_drop', drop_cb)
if RCS_FOUND:
if _RCS_FOUND:
self.rcs.connect('clicked', self.__rcs)
def __button_press(self, obj, event):
@ -384,11 +384,11 @@ class DbManager(CLIDbManager):
if store.get_value(node, STOCK_COL) == gtk.STOCK_OPEN:
self.connect.set_sensitive(False)
if RCS_FOUND:
if _RCS_FOUND:
self.rcs.show()
else:
self.connect.set_sensitive(not is_rev)
if RCS_FOUND and is_rev:
if _RCS_FOUND and is_rev:
self.rcs.show()
else:
self.rcs.hide()
@ -965,7 +965,7 @@ def find_revisions(name):
rev = re.compile("\s*revision\s+([\d\.]+)")
date = re.compile("date:\s+(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)[-+]\d\d;")
if not os.path.isfile(name):
if not os.path.isfile(name) or not _RCS_FOUND:
return []
rlog = [ "rlog", "-x,v", "-zLT" , name ]