Changeset 97c5024a in rtems-libbsd for builder.py


Ignore:
Timestamp:
Apr 18, 2016, 12:53:20 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
afaeccc05a556f6aa25ba044a7e49d6aa634a59e, freebsd-9.3, master
Children:
00a7956
Parents:
891a756
Message:

Add RTEMS version support, update all python to 2 and 3.

Add support to force the RTEMS version. This remove the need for using
the --rtems-version command line option if the automatic detection fails.

Update all python code to support python 2 and 3.

Update rtems_waf to the latest version to support the RTEMS version,
check environment variables and to display the CC version.

Sort all tests. I think the unsorted list is dependent on the version
of python and so would result in repo noise as if it regenerted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • builder.py

    r891a756 r97c5024a  
    11#
    2 #  Copyright (c) 2015 Chris Johns <chrisj@rtems.org>. All rights reserved.
     2#  Copyright (c) 2015-2016 Chris Johns <chrisj@rtems.org>. All rights reserved.
    33#
    44#  Copyright (c) 2009-2015 embedded brains GmbH.  All rights reserved.
     
    3535# FreeBSD: http://svn.freebsd.org/base/releng/8.2/sys (revision 222485)
    3636
     37from __future__ import print_function
     38
    3739import shutil
    3840import os
     
    5153isDryRun = False
    5254isDiffMode = False
    53 filesProcessed = 0
     55filesProcessedCount = 0
     56filesProcessed = []
     57
     58def changedFileSummary():
     59    if isDiffMode == False:
     60        print('%d file(s) were changed:' % (filesProcessedCount))
     61        for f in sorted(filesProcessed):
     62            print(' %s' % (f))
    5463
    5564class error(Exception):
     
    132141def processIfDifferent(new, old, src):
    133142
     143    global filesProcessedCount
    134144    global filesProcessed
    135145    global isVerbose, isDryRun, isEarlyExit
     
    137147    if not os.path.exists(old) or \
    138148       filecmp.cmp(new, old, shallow = False) == False:
    139         filesProcessed += 1
     149        filesProcessed += [old]
     150        filesProcessedCount += 1
    140151        if isDiffMode == False:
    141152            if isVerbose == True:
    142                 print "Move " + src + " to " + old
     153                print("Move " + src + " to " + old)
    143154            if isDryRun == False:
    144155                shutil.move(new, old)
    145156        else:
    146157            if isVerbose == True:
    147                 print "Diff %s => %s" % (src, new)
     158                print("Diff %s => %s" % (src, new))
    148159            old_contents = open(old).readlines()
    149160            new_contents = open(new).readlines()
     
    192203def assertHeaderFile(path):
    193204    if path[-2] != '.' or path[-1] != 'h':
    194         print "*** " + path + " does not end in .h"
    195         print "*** Move it to a C source file list"
     205        print("*** " + path + " does not end in .h")
     206        print("*** Move it to a C source file list")
    196207        sys.exit(2)
    197208
    198209def assertSourceFile(path):
    199210    if path[-2] != '.' or (path[-1] != 'c' and path[-1] != 'S'):
    200         print "*** " + path + " does not end in .c"
    201         print "*** Move it to a header file list"
     211        print("*** " + path + " does not end in .c")
     212        print("*** Move it to a header file list")
    202213        sys.exit(2)
    203214
Note: See TracChangeset for help on using the changeset viewer.