Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
1
Konular (issue)
1
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
9ed6a21c
Kaydet (Commit)
9ed6a21c
authored
Mar 26, 2018
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Changes
üst
0c3fe2a7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
32 deletions
+38
-32
inarytools.py
inary/actionsapi/inarytools.py
+4
-27
kerneltools.py
inary/actionsapi/kerneltools.py
+3
-1
magic.py
inary/analyzer/magic.py
+28
-4
info.py
inary/operations/info.py
+3
-0
No files found.
inary/actionsapi/inarytools.py
Dosyayı görüntüle @
9ed6a21c
...
...
@@ -118,12 +118,6 @@ def dodoc(*sourceFiles, **kw):
destDir
=
kw
.
get
(
"destDir"
,
get
.
srcNAME
())
readable_insinto
(
join_path
(
get
.
installDIR
(),
get
.
docDIR
(),
destDir
),
*
sourceFiles
)
def
doexe
(
sourceFile
,
destinationDirectory
):
'''insert a executable file into destination directory'''
''' example call: inarytools.doexe("kde-3.4.sh", "/etc/X11/Sessions")'''
executable_insinto
(
join_path
(
get
.
installDIR
(),
destinationDirectory
),
sourceFile
)
def
dohtml
(
*
sourceFiles
,
**
kw
):
'''inserts the files in the list of files into /usr/share/doc/PACKAGE/html'''
...
...
@@ -158,33 +152,16 @@ def doinfo(*sourceFiles):
'''inserts the into files in the list of files into /usr/share/info'''
readable_insinto
(
join_path
(
get
.
installDIR
(),
get
.
infoDIR
()),
*
sourceFiles
)
def
dolib
(
sourceFile
,
destinationDirectory
=
'/usr/lib'
):
def
dolib
(
sourceFile
,
destinationDirectory
=
'/usr/lib'
,
mode
=
755
):
'''insert the library into /usr/lib'''
'''example call: inarytools.dolib("libz.a")'''
'''example call: inarytools.dolib("libz.so")'''
if
mode
==
755
and
sourceFile
.
endswith
(
'.a'
):
mode
=
644
sourceFile
=
join_path
(
os
.
getcwd
(),
sourceFile
)
destinationDirectory
=
join_path
(
get
.
installDIR
(),
destinationDirectory
)
lib_insinto
(
sourceFile
,
destinationDirectory
,
755
)
def
dolib_a
(
sourceFile
,
destinationDirectory
=
'/usr/lib'
):
'''insert the static library into /usr/lib with permission 0644'''
'''example call: inarytools.dolib_a("staticlib/libvga.a")'''
sourceFile
=
join_path
(
os
.
getcwd
(),
sourceFile
)
destinationDirectory
=
join_path
(
get
.
installDIR
(),
destinationDirectory
)
lib_insinto
(
sourceFile
,
destinationDirectory
,
644
)
def
dolib_so
(
sourceFile
,
destinationDirectory
=
'/usr/lib'
):
'''insert the dynamic library into /usr/lib with permission 0755'''
'''example call: inarytools.dolib_so("pppd/plugins/minconn.so")'''
sourceFile
=
join_path
(
os
.
getcwd
(),
sourceFile
)
destinationDirectory
=
join_path
(
get
.
installDIR
(),
destinationDirectory
)
lib_insinto
(
sourceFile
,
destinationDirectory
,
755
)
lib_insinto
(
sourceFile
,
destinationDirectory
,
mode
)
def
doman
(
*
sourceFiles
):
'''inserts the man pages in the list of files into /usr/share/man/'''
...
...
inary/actionsapi/kerneltools.py
Dosyayı görüntüle @
9ed6a21c
...
...
@@ -162,7 +162,7 @@ def install():
dumpVersion
()
# Install kernel image
inarytools
.
insinto
(
"/boot/"
,
"arch/x86/boot/bzImage"
,
"kernel-{}"
.
forma
r
(
suffix
))
inarytools
.
insinto
(
"/boot/"
,
"arch/x86/boot/bzImage"
,
"kernel-{}"
.
forma
t
(
suffix
))
# Install the modules
# mod-fw= avoids firmwares from installing
...
...
@@ -215,6 +215,8 @@ def installHeaders(extraHeaders=None):
# Install additional headers
for
headers
in
extras
:
if
not
os
.
path
.
exist
(
"{0}/{1}"
.
format
(
destination
,
headers
)):
shelltools
.
system
(
"mkdir {0}/{1}"
.
format
(
destination
,
headers
))
shelltools
.
system
(
"cp -a {0}/*.h {1}/{2}"
.
format
(
headers
,
destination
,
headers
))
# Install remaining headers
...
...
inary/analyzer/magic.py
Dosyayı görüntüle @
9ed6a21c
...
...
@@ -15,10 +15,19 @@ import glob
import
os
import
threading
import
gettext
__trans
=
gettext
.
translation
(
"inary"
,
fallback
=
True
)
_
=
__trans
.
gettext
import
ctypes
from
ctypes
import
c_char_p
,
c_int
,
c_size_t
,
c_void_p
import
ctypes.util
class
MagicException
(
Exception
):
def
__init__
(
self
,
message
):
super
(
MagicException
,
self
)
.
__init__
(
message
)
self
.
message
=
message
libmagic
=
None
dll
=
ctypes
.
util
.
find_library
(
'magic'
)
or
ctypes
.
util
.
find_library
(
'magic1'
)
or
ctypes
.
util
.
find_library
(
'cygmagic-1'
)
...
...
@@ -26,8 +35,24 @@ if dll:
libmagic
=
ctypes
.
CDLL
(
dll
)
if
not
libmagic
or
not
libmagic
.
_name
:
raise
ImportError
(
'failed to find libmagic. Check your installation'
)
magic_dlls
=
{
'darwin'
:
[
'/opt/local/lib/libmagic.dylib'
,
'/usr/local/lib/libmagic.dylib'
,
glob
.
glob
(
'/usr/local/Cellar/libmagic/*/lib/libmagic.dylib'
)],
'win32'
:
'magic1.dll'
,
'cygmagic-1.dll'
,
'linux'
:
[
'libmagic.so.1'
],
}
if
sys
.
platform
.
startswith
(
'linux'
):
platform
=
'linux'
else
:
platform
=
sys
.
platform
for
dll
in
magic_dlls
.
get
(
platform
,
[]):
try
:
libmagic
=
ctypes
.
CDLL
(
dll
)
break
except
OSError
:
pass
#Magic Flags from libmagic.so
MAGIC_CONTINUE
=
0x000020
...
...
@@ -52,7 +77,7 @@ def errorcheck(result, func, args):
else
:
return
result
# Declarations
magic_file
=
libmagic
.
magic_file
magic_file
.
restype
=
c_char_p
magic_file
.
argtypes
=
[
magic_t
,
c_char_p
]
...
...
@@ -122,11 +147,10 @@ class Magic:
if
type
(
data
)
==
str
and
str
!=
bytes
:
buf
=
data
.
encode
(
'utf-8'
,
errors
=
'replace'
)
return
magic_buffer
(
self
.
cookie
,
data
,
len
(
data
))
except
Exception
as
err
:
except
Magic
Exception
as
err
:
raise
(
_
(
"Can Not load file or buffer {}"
)
.
format
(
err
))
def
__del__
(
self
):
if
self
.
cookie
and
magic_close
:
magic_close
(
self
.
cookie
)
self
.
cookie
=
None
inary/operations/info.py
Dosyayı görüntüle @
9ed6a21c
...
...
@@ -10,7 +10,10 @@
# Please read the COPYING file.
#
import
os
import
inary
import
inary.context
as
ctx
import
inary.db
import
inary.data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment