[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [craft] bin: Return false from isBinary if a dir is passed instead of erroring out
From:       Hannah von Reth <null () kde ! org>
Date:       2018-09-27 8:55:50
Message-ID: E1g5S5O-0005iO-24 () code ! kde ! org
[Download RAW message or body]

Git commit d475aec51e5311462d050b8837f7a8cc7de29491 by Hannah von Reth, on behalf of Dominik Schmidt.
Committed on 27/09/2018 at 08:49.
Pushed by vonreth into branch 'master'.

Return false from isBinary if a dir is passed instead of erroring out

M  +1    -2    bin/utils.py

https://commits.kde.org/craft/d475aec51e5311462d050b8837f7a8cc7de29491

diff --git a/bin/utils.py b/bin/utils.py
index 016c92024..e8de3e38d 100644
--- a/bin/utils.py
+++ b/bin/utils.py
@@ -810,13 +810,12 @@ def sign(fileNames : [str]) -> bool:
 def isBinary(fileName : str) -> bool:
     # https://en.wikipedia.org/wiki/List_of_file_signatures
     MACH_O_64 = b"\xCF\xFA\xED\xFE"
-    if os.path.islink(fileName):
+    if os.path.islink(fileName) or os.path.isdir(fileName):
         return False
     _, ext = os.path.splitext(fileName)
     if CraftCore.compiler.isWindows:
         if ext in {".dll", ".exe"}:
             return True
-
     else:
         if ext in {".so", ".dylib"}:
             return True
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic