mac80211: make b43-fwsquash.py work with python 3.x
SVN-Revision: 19307
This commit is contained in:
parent
de1c5f7a85
commit
789ec837e9
1 changed files with 14 additions and 14 deletions
|
@ -12,16 +12,16 @@ import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print "Usage: %s PHYTYPES COREREVS /path/to/extracted/firmware" % sys.argv[0]
|
print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firmware" % sys.argv[0])
|
||||||
print ""
|
print("")
|
||||||
print "PHYTYPES is a comma separated list of:"
|
print("PHYTYPES is a comma separated list of:")
|
||||||
print "A => A-PHY"
|
print("A => A-PHY")
|
||||||
print "AG => Dual A-PHY G-PHY"
|
print("AG => Dual A-PHY G-PHY")
|
||||||
print "G => G-PHY"
|
print("G => G-PHY")
|
||||||
print "LP => LP-PHY"
|
print("LP => LP-PHY")
|
||||||
print "N => N-PHY"
|
print("N => N-PHY")
|
||||||
print ""
|
print("")
|
||||||
print "COREREVS is a comma separated list of core revision numbers."
|
print("COREREVS is a comma separated list of core revision numbers.")
|
||||||
|
|
||||||
if len(sys.argv) != 4:
|
if len(sys.argv) != 4:
|
||||||
usage()
|
usage()
|
||||||
|
@ -35,7 +35,7 @@ phytypes = phytypes.split(',')
|
||||||
try:
|
try:
|
||||||
corerevs = map(lambda r: int(r), corerevs.split(','))
|
corerevs = map(lambda r: int(r), corerevs.split(','))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print "ERROR: \"%s\" is not a valid COREREVS string\n" % corerevs
|
print("ERROR: \"%s\" is not a valid COREREVS string\n" % corerevs)
|
||||||
usage()
|
usage()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ except ValueError:
|
||||||
fwfiles = os.listdir(fwpath)
|
fwfiles = os.listdir(fwpath)
|
||||||
fwfiles = filter(lambda str: str.endswith(".fw"), fwfiles)
|
fwfiles = filter(lambda str: str.endswith(".fw"), fwfiles)
|
||||||
if not fwfiles:
|
if not fwfiles:
|
||||||
print "ERROR: No firmware files found in %s" % fwpath
|
print("ERROR: No firmware files found in %s" % fwpath)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
required_fwfiles = []
|
required_fwfiles = []
|
||||||
|
@ -102,10 +102,10 @@ for f in fwfiles:
|
||||||
phytypes_match(phytypes, initvalmapping[f][1]):
|
phytypes_match(phytypes, initvalmapping[f][1]):
|
||||||
required_fwfiles += [f]
|
required_fwfiles += [f]
|
||||||
continue
|
continue
|
||||||
print "WARNING: Firmware file %s not found in the mapping lists" % f
|
print("WARNING: Firmware file %s not found in the mapping lists" % f)
|
||||||
|
|
||||||
for f in fwfiles:
|
for f in fwfiles:
|
||||||
if f not in required_fwfiles:
|
if f not in required_fwfiles:
|
||||||
print "Deleting %s" % f
|
print("Deleting %s" % f)
|
||||||
os.unlink(fwpath + '/' + f)
|
os.unlink(fwpath + '/' + f)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue