aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/cleanup-workdir
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-30 18:14:46 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-01 12:47:10 +0100
commit2e388048b61f6029bae1913cbb546ac40b9cfe51 (patch)
tree8fa0fc951caab1430636fca971c27a7e7beb45ce /scripts/cleanup-workdir
parent79be110c1fdfd0affe6a310b96e7107c4549d23c (diff)
downloadopenembedded-core-contrib-2e388048b61f6029bae1913cbb546ac40b9cfe51.tar.gz
scripts: python3: Use print function
Used print function instead of print statement to make the code work in python 3. (From OE-Core rev: 80fecc44761fa38ccf2e4dc6897b9f1f0c9c1ed0) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/cleanup-workdir')
-rwxr-xr-xscripts/cleanup-workdir16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/cleanup-workdir b/scripts/cleanup-workdir
index 01ebd526e3..fee464c31d 100755
--- a/scripts/cleanup-workdir
+++ b/scripts/cleanup-workdir
@@ -27,7 +27,7 @@ obsolete_dirs = []
parser = None
def err_quit(msg):
- print msg
+ print(msg)
parser.print_usage()
sys.exit(1)
@@ -43,7 +43,7 @@ def run_command(cmd):
pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
output = pipe.communicate()[0]
if pipe.returncode != 0:
- print "Execute command '%s' failed." % cmd
+ print("Execute command '%s' failed." % cmd)
sys.exit(1)
return output
@@ -84,7 +84,7 @@ will be deleted. Be CAUTIOUS.""")
if os.getcwd() != builddir:
err_quit("Please run %s under: %s\n" % (os.path.basename(args[0]), builddir))
- print 'Updating bitbake caches...'
+ print('Updating bitbake caches...')
cmd = "bitbake -s"
output = run_command(cmd)
@@ -129,13 +129,13 @@ will be deleted. Be CAUTIOUS.""")
# won't fail just in case
if not tmpdir or not image_rootfs:
- print "Can't get TMPDIR or IMAGE_ROOTFS."
+ print("Can't get TMPDIR or IMAGE_ROOTFS.")
return 1
pattern = tmpdir + '/(.*?)/(.*?)/'
m = re.match(pattern, image_rootfs)
if not m:
- print "Can't get WORKDIR."
+ print("Can't get WORKDIR.")
return 1
workdir = os.path.join(tmpdir, m.group(1))
@@ -178,13 +178,13 @@ will be deleted. Be CAUTIOUS.""")
break
for d in obsolete_dirs:
- print "Deleting %s" % d
+ print("Deleting %s" % d)
shutil.rmtree(d, True)
if len(obsolete_dirs):
- print '\nTotal %d items.' % len(obsolete_dirs)
+ print('\nTotal %d items.' % len(obsolete_dirs))
else:
- print '\nNo obsolete directory found under %s.' % workdir
+ print('\nNo obsolete directory found under %s.' % workdir)
return 0