From 97712a0741f5a2a4a2bbe9d76aa854ecce518032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alin=20Tr=C4=83istaru?= Date: Tue, 18 Apr 2017 11:30:26 +0300 Subject: [PATCH] Fix CentOS ISOs detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #98 Signed-off-by: Alin Trăistaru --- multibootusb | 0 scripts/distro.py | 7 +++---- 2 files changed, 3 insertions(+), 4 deletions(-) mode change 100644 => 100755 multibootusb diff --git a/multibootusb b/multibootusb old mode 100644 new mode 100755 diff --git a/scripts/distro.py b/scripts/distro.py index b2b3f59..57d10dc 100644 --- a/scripts/distro.py +++ b/scripts/distro.py @@ -29,8 +29,7 @@ def distro(iso_cfg_ext_dir, iso_link): if platform.system() == "Linux" or platform.system() == "Windows": for path, subdirs, files in os.walk(iso_cfg_ext_dir): for name in files: - if name.endswith('.cfg') or name.endswith('.CFG') or name.endswith('.txt') or name.endswith('.TXT') \ - or name.endswith('.lst'): + if name.endswith(('.cfg', '.CFG', '.txt', '.TXT', '.lst')): try: # errors='ignore' is required as some files also contain non utf character string = open(os.path.join(path, name), errors='ignore').read() @@ -112,8 +111,8 @@ def distro(iso_cfg_ext_dir, iso_link): return "zenwalk" elif re.search(r'ubuntu server', string, re.I): return "ubuntu-server" - elif re.search(r'Welcome to CentOS', string, re.I): - return "centos-net-minimal" + elif re.search(r'CentOS', string, re.I): + return "centos" elif re.search(r'Trinity Rescue Kit', string, re.I): return "trinity-rescue" elif re.search(r'alpine', string, re.I):