kadischi/lib functions.py,1.14,1.15
Chitlesh GOORAH (chitlesh)
fedora-extras-commits at redhat.com
Sun Jul 9 09:44:54 UTC 2006
Author: chitlesh
Update of /cvs/devel/kadischi/lib
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26985/lib
Modified Files:
functions.py
Log Message:
run and flc_log functions deprecated
Index: functions.py
===================================================================
RCS file: /cvs/devel/kadischi/lib/functions.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- functions.py 5 Jul 2006 13:36:23 -0000 1.14
+++ functions.py 9 Jul 2006 09:44:52 -0000 1.15
@@ -22,24 +22,24 @@
def path_exists (path, quiet = False):
if os.path.exists (path):
if not quiet:
- flc_log ('Path %s exists. OK' % path)
+ print "[kadischi]: Path %s exists. OK" % path
return True
else:
if not quiet:
- flc_log ('Error - path %s doesn`t exist.' % path)
+ print "[kadischi]: Error - path %s doesn't exist." % path
return False
def url_exists (url, quiet = False):
try:
u = grabber.urlopen (url, retry = 5)
if not quiet:
- flc_log ('URL %s contacted. OK' % url)
+ print "[kadischi]: URL %s contacted. OK" % url
u.close ()
return True
except grabber.URLGrabError, e:
if not quiet:
- flc_log ("An error occurred contacting %s." % url)
- flc_log ("URLGrabError:\n %s" % e.strerror)
+ print "[kadischi]: An error occurred contacting %s." % url
+ print "[kadischi]: URLGrabError:\n %s" % e.strerror
return False
def clear_rpm_db_files (rootdir):
@@ -88,9 +88,6 @@
path = normalize_path(['/etc/sysconfig/', name], rootdir)
return shvar.shvarFile (path)
-def flc_log (msg):
- sys.stdout.write (msg + '\n')
-
def cleanup (builddir):
os.system ("umount %s 2>/dev/null" % normalize_path(['/system/proc'],builddir))
if os.path.exists (normalize_path([builddir,'product'])):
@@ -100,15 +97,3 @@
os.unlink ('/tmp/product/.buildstamp')
shutil.move (normalize_path([builddir,'.buildstamp']), '/tmp/product/.buildstamp')
clean_directory (builddir)
-
-def run (command, builddir = None):
- rc = os.system (command)
- if rc != 0:
- flc_log ('\n *** Fatal error: %s returned non zero (%s) exit code. Aborting execution.\n' % (command.rsplit() [0], rc))
- if builddir != None:
- flc_log ('Cleaning up temporary files...')
- cleanup (builddir)
- flc_log ('Done.')
- else:
- flc_log ('You should clean temporary files.')
- sys.exit (1)
More information about the fedora-extras-commits
mailing list