From cc676386034b786e7c393f02a2ad870e341724bd Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 9 Jun 2019 21:34:57 +0300 Subject: [PATCH] ap: more strict filename matching --- win/tools/autopatch/autopatch.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/win/tools/autopatch/autopatch.py b/win/tools/autopatch/autopatch.py index 99074ad..996f3d3 100755 --- a/win/tools/autopatch/autopatch.py +++ b/win/tools/autopatch/autopatch.py @@ -54,6 +54,9 @@ class ExtractException(Exception): class PatternNotFoundException(Exception): pass +class UnknownPlatformException(Exception): + pass + class ExtractedTarget: name = None @@ -173,8 +176,11 @@ def main(): os_prefix = 'ws2012_x64' elif 'winserv-2016' in installer_name: os_prefix = 'ws2016_x64' - else: + elif 'win10' in installer_name: os_prefix = 'win10_x64' + else: + raise UnknownPlatformException("Can't infer platform from filename %s" + % (repr(installer_name),)) driver_name = drv_prefix[product_type] + version out_dir = os.path.join( os.path.dirname(