]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
start migrating to python 3: use print function
authorJan Rękorajski <baggins@pld-linux.org>
Sat, 17 Oct 2020 21:37:00 +0000 (23:37 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Sat, 17 Oct 2020 21:37:00 +0000 (23:37 +0200)
PLD_Builder/get_br.py
PLD_Builder/rpm_builder.py
client/rebuild-kernel-packages.py

index 1f69394c31f60b354e4e42dadaf17781e7fd7b2b..246586671ef9a02bcf0ea4d187407939be98e68b 100644 (file)
@@ -1,5 +1,7 @@
 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et
 
+from __future__ import print_function
+
 import re
 import string
 import xreadlines
@@ -100,4 +102,4 @@ def get_build_requires(spec, bconds_with, bconds_without):
                     msg("spec error (%s): %s\n" % (spec, l))
 
     for x in build_req:
-        print x
+        print(x)
index 23f9492919ced8cef68b70c88195bbccf21bab9d..7b5230be03621db5f35c4347333683112b331e8a 100644 (file)
@@ -1,5 +1,7 @@
 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et
 
+from __future__ import print_function
+
 import sys
 import os
 import atexit
@@ -115,13 +117,13 @@ def fetch_src(r, b):
                 continue
             else:
                 try:
-                    print "error.errno: %s" % str(error.errno)
+                    print("error.errno: %s" % str(error.errno))
                 except Exception, e:
-                    print "error.errno: exception %s" % e
+                    print("error.errno: exception %s" % e)
                 try:
-                    print "error.reason %s" % str(error.reason)
+                    print("error.reason %s" % str(error.reason))
                 except Exception, e:
-                    print "error.reason exception %s" % e
+                    print("error.reason exception %s" % e)
                 raise
 
     o = chroot.popen("cat > %s" % b.src_rpm, mode = "w")
index 652d4cd59569c3943ba0b600e92b1e43a545d1d8..2f5f247686a2790489e9d0804a1cab0a31b6129f 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/python
 
+from __future__ import print_function
+
 import argparse
 import collections
 import os
@@ -55,14 +57,14 @@ def run_command(command, verbose=False, quiet=True):
     gitproc.wait()
     out = gitproc.stdout.read().strip("\n'")
     if verbose:
-        print ' '.join(command)
+        print(' '.join(command))
     if not quiet:
-        print out
+        print(out)
     if gitproc.returncode != 0:
         if quiet:
-            print out
-        print '\nError running command: \n'
-        print ' '.join(command)
+            print(out)
+        print('\nError running command: \n')
+        print(' '.join(command))
         return (False, None)
     return (True, out)
 
@@ -100,7 +102,7 @@ def fetch_package(name, spec, branch, verbose=False):
         rev_branch = run_command(["/usr/bin/git", "-C", gitdir, "rev-parse", branch], verbose=verbose)
         rev_head = run_command(["/usr/bin/git", "-C", gitdir, "rev-parse", "HEAD"], verbose=verbose)
         if rev_branch[1] != rev_head[1]:
-            print "Error: cannot checkout " + name
+            print("Error: cannot checkout " + name)
             return None
         run_command(["/usr/bin/git", "-C", gitdir, "merge", "--ff-only", "@{upstream}"], verbose=verbose)
 
@@ -186,7 +188,7 @@ def main():
         run_command(shlex.split(command), verbose=args.verbose, quiet=False)
         raw_input('\nPress Enter after src builder updates kernel packages...')
 
-    print '\nCurrent kernels versions:'
+    print('\nCurrent kernels versions:')
     all_kernels = set()
     for kernel_list in packages.values():
         all_kernels.update(kernel_list)
@@ -196,7 +198,7 @@ def main():
         branch = 'master'
         if kernel != 'head':
             branch = 'LINUX_%s' % kernel.replace('.','_')
-        print '%s: %s' % (kernel, get_last_tag('kernel', 'kernel.spec', branch, dist=args.dist, kernel=kernel, verbose=args.verbose))
+        print('%s: %s' % (kernel, get_last_tag('kernel', 'kernel.spec', branch, dist=args.dist, kernel=kernel, verbose=args.verbose)))
 
     for pkg, kernels in packages.iteritems():
         try:
@@ -216,7 +218,7 @@ def main():
             if not args.head:
               tag = get_last_tag(name, spec, branch, dist=args.dist, verbose=args.verbose)
               if not tag:
-                  print "Failed getching last autotag for %s!" % pkg
+                  print("Failed getching last autotag for %s!" % pkg)
                   continue
               spec = '%s:%s' % (spec, tag)
             command = ("%s -nd %s -d %s --define 'build_kernels %s' --without userspace %s" %
This page took 0.201395 seconds and 4 git commands to generate.