# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.235 2005/04/21 17:45:31 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.236 2005/04/21 18:18:46 rocket Exp $
+
+ 21 Apr 2005; Eric Edgar <rocket@gentoo.org> catalyst,
+ modules/catalyst_support.py, modules/generic_stage_target.py:
+ Added a better exception handling message for keyboard interrupt and added
+ countdown timer for purge operation to give an opportunity to exit
21 Apr 2005; Eric Edgar <rocket@gentoo.org> catalyst,
modules/catalyst_support.py, modules/generic_stage_target.py:
#!/usr/bin/python
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.74 2005/04/21 17:45:31 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.75 2005/04/21 18:18:46 rocket Exp $
# Maintained in full by:
# Eric Edgar <rocket@gentoo.org>
except CatalystError:
raise CatalystError,"Could not complete build"
sys.exit(2)
+ except KeyboardInterrupt:
+ print "\nCatalyst build aborted due to user interrupt"
+ sys.exit(2)
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.41 2005/04/21 17:45:31 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.42 2005/04/21 18:18:46 rocket Exp $
-import sys,string,os,types,re,signal,traceback,md5
+import sys,string,os,types,re,signal,traceback,md5,time
# a function to turn a string of non-printable characters into a string of
# hex characters
def hexify(str):
myf.close()
except IOError:
raise CatalystError, "Could not touch "+myfile+"."
+
+def countdown(secs=5, doing="Starting"):
+ if secs:
+ print ">>> Waiting",secs,"seconds before starting..."
+ print ">>> (Control-C to abort)...\n"+doing+" in: ",
+ ticks=range(secs)
+ ticks.reverse()
+ for sec in ticks:
+ sys.stdout.write(str(sec+1)+" ")
+ sys.stdout.flush()
+ time.sleep(1)
+ print
+
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.36 2005/04/21 17:45:31 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.37 2005/04/21 18:18:46 rocket Exp $
"""
This class does all of the chroot setup, copying of files, etc. It is
os.makedirs(myemp,0755)
def purge(self):
+ countdown(10,"Purging Caches ...")
if self.settings.has_key("PURGE"):
print "clearing autoresume ..."
self.clear_autoresume