From 74f413c5406cfa66ffeae1f42491d41b39197304 Mon Sep 17 00:00:00 2001 From: Jurriaan Bremer Date: Tue, 15 Aug 2017 01:09:29 +0200 Subject: [PATCH] code cleanup --- sflock/pick.py | 8 +------- tests/test_elf.py | 5 +---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/sflock/pick.py b/sflock/pick.py index 251d75f6..a4d3f2a6 100644 --- a/sflock/pick.py +++ b/sflock/pick.py @@ -99,21 +99,15 @@ def package(f): if "HTML" in f.magic or filename.endswith(ie_ext): return "ie" - if is_bash_script(f): + if is_bash_script(f) or is_elf_executable(f): return "generic" - if f.magic.startswith("ELF"): - return "generic" - - def is_bash_script(f): return f.filename and f.filename.endswith(".sh") - def is_elf_executable(f): return f.magic.startswith("ELF") - platforms = { "cpl": "windows", "dll": "windows", diff --git a/tests/test_elf.py b/tests/test_elf.py index 580ac76e..16aca6ea 100644 --- a/tests/test_elf.py +++ b/tests/test_elf.py @@ -1,12 +1,9 @@ -# Copyright (C) 2015-2017 Jurriaan Bremer. +# Copyright (C) 2017 Jurriaan Bremer. # This file is part of SFlock - http://www.sflock.org/. # See the file 'docs/LICENSE.txt' for copying permission. -import pytest - from sflock.main import unpack - def test_elf(): elf = unpack("tests/files/busybox-i686") assert elf.package == "generic"