Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jbremer committed Aug 14, 2017
1 parent 87fb2fc commit 74f413c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
8 changes: 1 addition & 7 deletions sflock/pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 1 addition & 4 deletions tests/test_elf.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 74f413c

Please sign in to comment.