Changeset 4d771c5 in rtems-libbsd for freebsd-to-rtems.py


Ignore:
Timestamp:
Mar 9, 2012, 10:10:56 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, afaeccc05a556f6aa25ba044a7e49d6aa634a59e, freebsd-9.3, master
Children:
25b3317
Parents:
84c044d
Message:

freebsd-to-rtems.py - Revert mode now confirmed to work for source

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freebsd-to-rtems.py

    r84c044d r4d771c5  
    256256# Revert a header file from the RTEMS BSD tree to the FreeBSD tree
    257257def revertHeaderFile(org, target):
     258        global tempFile
    258259        src = RTEMS_DIR + '/' + PREFIX + '/' + org.replace('rtems/', '')
    259260        src = mapContribPath(src)
     261        if target != "generic":
     262                src = mapCPUDependentPath(src)
    260263        dst = FreeBSD_DIR + '/' + org
    261264        if isVerbose == True:
     
    267270        except OSError:
    268271                pass
    269         if target != "generic":
    270                 print "Do not yet know how to revert target dependent files"
    271                 sys.exit(1)
    272272        data = open(src).read()
    273         out = open(dst, 'w')
     273        out = open(tempFile, 'w')
    274274        if org.find('rtems') == -1:
    275275                data = revertFixIncludes(data)
    276276        out.write(data)
    277277        out.close()
     278        if copyIfDifferent(tempFile, dst) == True:
     279                if isVerbose == True:
     280                        print "Revert Header - " + src + " => " + dst
    278281
    279282# Revert a source file from the RTEMS BSD tree to the FreeBSD tree
    280 def revertSourceFile(org):
     283def revertSourceFile(org, target):
    281284        src = RTEMS_DIR + '/' + PREFIX + '/' + org
    282285        src = mapContribPath(src)
    283286        dst = FreeBSD_DIR + '/' + org
     287        if target != "generic":
     288                src = mapCPUDependentPath(src)
    284289        if isVerbose == True:
    285290                print "Revert Source - " + src + " => " + dst
     
    291296                pass
    292297        data = open(src).read()
    293         out = open(dst, 'w')
     298        out = open(tempFile, 'w')
    294299        if org.find('rtems') == -1:
    295300                data = re.sub('#include <' + PREFIX + '/machine/rtems-bsd-config.h>\n\n', '', data)
     
    297302        out.write(data)
    298303        out.close()
     304        if copyIfDifferent(tempFile, dst) == True:
     305                if isVerbose == True:
     306                        print "Revert Source - " + src + " => " + dst
    299307
    300308# Remove the output directory
     
    336344                                revertHeaderFile(f, m.target)
    337345                        for f in m.sourceFiles:
    338                                 revertSourceFile(f)
     346                                revertSourceFile(f, m.target)
    339347
    340348        def createMakefile(self):
Note: See TracChangeset for help on using the changeset viewer.