mirror of
https://github.com/keylase/nvidia-patch.git
synced 2024-11-09 11:38:21 +00:00
autopatch: fix indent for local installer case
Signed-off-by: Jai Luthra <me@jailuthra.in>
This commit is contained in:
parent
bb1d5351d2
commit
9b5c28b29c
@ -238,47 +238,47 @@ def patch_flow(installer_file, search, replacement, target, target_name, patch_n
|
||||
print(f"Invalid installer file or version: {installer_file}")
|
||||
return
|
||||
|
||||
# Rest of the code remains the same...
|
||||
patch = make_patch(installer_file,
|
||||
arch_tgt=target,
|
||||
search=search,
|
||||
replacement=replacement,
|
||||
tmpdir=tempdir,
|
||||
sevenzip=sevenzip,
|
||||
direct=direct)
|
||||
patch_content = format_patch(patch, target_name)
|
||||
# Rest of the code remains the same...
|
||||
patch = make_patch(installer_file,
|
||||
arch_tgt=target,
|
||||
search=search,
|
||||
replacement=replacement,
|
||||
tmpdir=tempdir,
|
||||
sevenzip=sevenzip,
|
||||
direct=direct)
|
||||
patch_content = format_patch(patch, target_name)
|
||||
|
||||
if stdout:
|
||||
sys.stdout.buffer.write(patch_content)
|
||||
elif direct:
|
||||
with open(patch_name, mode='wb') as out:
|
||||
out.write(patch_content)
|
||||
if stdout:
|
||||
sys.stdout.buffer.write(patch_content)
|
||||
elif direct:
|
||||
with open(patch_name, mode='wb') as out:
|
||||
out.write(patch_content)
|
||||
else:
|
||||
version, product_type = identify_driver(installer_file, sevenzip=sevenzip)
|
||||
drv_prefix = {
|
||||
"100": "quadro_",
|
||||
"103": "quadro_",
|
||||
"300": "",
|
||||
"301": "nsd_",
|
||||
"303": "", # DCH
|
||||
"304": "nsd_",
|
||||
}
|
||||
installer_name = os.path.basename(installer_file).lower()
|
||||
if 'winserv2008' in installer_name or 'winserv-2012' in installer_name:
|
||||
os_prefix = 'ws2012_x64'
|
||||
elif 'winserv-2016' in installer_name or 'win10' in installer_name:
|
||||
os_prefix = 'win10_x64'
|
||||
elif 'win7' in installer_name:
|
||||
os_prefix = 'win7_x64'
|
||||
else:
|
||||
version, product_type = identify_driver(installer_file, sevenzip=sevenzip)
|
||||
drv_prefix = {
|
||||
"100": "quadro_",
|
||||
"103": "quadro_",
|
||||
"300": "",
|
||||
"301": "nsd_",
|
||||
"303": "", # DCH
|
||||
"304": "nsd_",
|
||||
}
|
||||
installer_name = os.path.basename(installer_file).lower()
|
||||
if 'winserv2008' in installer_name or 'winserv-2012' in installer_name:
|
||||
os_prefix = 'ws2012_x64'
|
||||
elif 'winserv-2016' in installer_name or 'win10' in installer_name:
|
||||
os_prefix = 'win10_x64'
|
||||
elif 'win7' in installer_name:
|
||||
os_prefix = 'win7_x64'
|
||||
else:
|
||||
raise UnknownPlatformException(f"Can't infer platform from filename {installer_name}")
|
||||
raise UnknownPlatformException(f"Can't infer platform from filename {installer_name}")
|
||||
|
||||
driver_name = drv_prefix.get(product_type, "") + version
|
||||
out_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', os_prefix, driver_name)
|
||||
os.makedirs(out_dir, 0o755, exist_ok=True)
|
||||
out_filename = os.path.join(out_dir, patch_name)
|
||||
with open(out_filename, 'wb') as out:
|
||||
out.write(patch_content)
|
||||
driver_name = drv_prefix.get(product_type, "") + version
|
||||
out_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', os_prefix, driver_name)
|
||||
os.makedirs(out_dir, 0o755, exist_ok=True)
|
||||
out_filename = os.path.join(out_dir, patch_name)
|
||||
with open(out_filename, 'wb') as out:
|
||||
out.write(patch_content)
|
||||
|
||||
|
||||
def main():
|
||||
|
Loading…
Reference in New Issue
Block a user