bin/install_megadrivers: rename a few variables to make things clearer
Originally the "each" variable was just a part of the "drivers" variable. It's not anymore so it's a bit ambiguous. Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
This commit is contained in:
@@ -46,23 +46,23 @@ def main():
|
|||||||
os.makedirs(to)
|
os.makedirs(to)
|
||||||
shutil.copy(args.megadriver, master)
|
shutil.copy(args.megadriver, master)
|
||||||
|
|
||||||
for each in args.drivers:
|
for driver in args.drivers:
|
||||||
driver = os.path.join(to, each)
|
abs_driver = os.path.join(to, driver)
|
||||||
|
|
||||||
if os.path.exists(driver):
|
if os.path.exists(abs_driver):
|
||||||
os.unlink(driver)
|
os.unlink(abs_driver)
|
||||||
print('installing {} to {}'.format(args.megadriver, driver))
|
print('installing {} to {}'.format(args.megadriver, abs_driver))
|
||||||
os.link(master, driver)
|
os.link(master, abs_driver)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ret = os.getcwd()
|
ret = os.getcwd()
|
||||||
os.chdir(to)
|
os.chdir(to)
|
||||||
|
|
||||||
name, ext = os.path.splitext(each)
|
name, ext = os.path.splitext(driver)
|
||||||
while ext != '.so':
|
while ext != '.so':
|
||||||
if os.path.exists(name):
|
if os.path.exists(name):
|
||||||
os.unlink(name)
|
os.unlink(name)
|
||||||
os.symlink(each, name)
|
os.symlink(driver, name)
|
||||||
name, ext = os.path.splitext(name)
|
name, ext = os.path.splitext(name)
|
||||||
finally:
|
finally:
|
||||||
os.chdir(ret)
|
os.chdir(ret)
|
||||||
|
Reference in New Issue
Block a user