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
493df95c
Kaydet (Commit)
493df95c
authored
Eyl 11, 2019
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge branch 'develop' into feature/documentation
üst
f5085d24
5778d68e
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
99 additions
and
47 deletions
+99
-47
.gitignore
.gitignore
+5
-0
inary-spec.rng
inary-spec.rng
+1
-0
mesontools.py
inary/actionsapi/mesontools.py
+24
-3
perlmodules.py
inary/actionsapi/perlmodules.py
+1
-1
archive.py
inary/archive.py
+3
-29
__init__.py
inary/cli/__init__.py
+1
-1
install.py
inary/cli/install.py
+3
-2
fetcher.py
inary/fetcher.py
+51
-6
mirrors.py
inary/mirrors.py
+2
-0
build.py
inary/operations/build.py
+7
-3
repository.py
inary/operations/repository.py
+1
-1
scomiface.py
inary/scomiface.py
+0
-1
No files found.
.gitignore
Dosyayı görüntüle @
493df95c
...
...
@@ -108,3 +108,8 @@ CMakeFiles/
*.cmake
config/inary.conf
*.py___jb_tmp___
# inary files
*.inary
inary-spec.rng
Dosyayı görüntüle @
493df95c
...
...
@@ -1110,6 +1110,7 @@
<value>
data
</value>
<value>
data:doc
</value>
<value>
data:font
</value>
<value>
header
</value>
<value>
kernel
</value>
<value>
driver
</value>
<value>
locale
</value>
...
...
inary/actionsapi/mesontools.py
Dosyayı görüntüle @
493df95c
...
...
@@ -17,6 +17,11 @@ import inary.context as ctx
from
inary.actionsapi
import
get
from
inary.actionsapi.shelltools
import
can_access_file
from
inary.actionsapi.shelltools
import
system
from
inary.actionsapi.shelltools
import
ls
from
inary.actionsapi.shelltools
import
copy
from
inary.actionsapi.inarytools
import
dosed
from
inary.actionsapi.shelltools
import
isDirectory
from
inary.actionsapi.inarytools
import
removeDir
import
gettext
...
...
@@ -42,6 +47,12 @@ class NinjaBuildError(inary.actionsapi.Error):
self
.
value
=
value
ctx
.
ui
.
error
(
"[MesonTools]: "
+
value
)
def
fixpc
():
""" fix .pc files in installDIR()/usr/lib32/pkgconfig"""
path
=
"{}/usr/lib32/pkgconfig"
.
format
(
get
.
installDIR
())
if
isDirectory
(
path
):
for
f
in
ls
(
"{}/*.pc"
.
format
(
path
)):
dosed
(
f
,
get
.
emul32prefixDIR
(),
get
.
defaultprefixDIR
())
def
meson_configure
(
parameters
=
""
):
if
can_access_file
(
'meson.build'
):
...
...
@@ -50,9 +61,9 @@ def meson_configure(parameters=""):
--prefix=/{0}
\
--buildtype=plain
\
--libdir=/{0}/lib{1}
\
--libexecdir={2}
\
--sysconfdir={3}
\
--localstatedir={4}
\
--libexecdir=
/
{2}
\
--sysconfdir=
/
{3}
\
--localstatedir=
/
{4}
\
{5} inaryPackageBuild"
.
format
(
prefix
,
"32 "
if
get
.
buildTYPE
()
==
"emul32"
else
""
,
...
...
@@ -70,12 +81,22 @@ def meson_configure(parameters=""):
def
ninja_build
(
parameters
=
""
):
if
system
(
"ninja {} {} -C inaryPackageBuild"
.
format
(
get
.
makeJOBS
(),
parameters
)):
raise
NinjaBuildError
(
_
(
"Build failed."
))
if
get
.
buildTYPE
()
==
"emul32"
:
fixpc
()
if
isDirectory
(
"{}/emul32"
.
format
(
get
.
installDIR
())):
removeDir
(
"/emul32"
)
def
ninja_install
(
parameters
=
""
):
insdir
=
util
.
join_path
(
get
.
installDIR
(),
"emul32"
)
if
get
.
buildTYPE
()
==
"emul32"
else
get
.
installDIR
()
if
system
(
'DESTDIR="{}" ninja install {} -C inaryPackageBuild'
.
format
(
insdir
,
get
.
makeJOBS
())):
raise
NinjaBuildError
(
_
(
"Install failed."
))
if
isDirectory
(
"{}/emul32"
.
format
(
get
.
installDIR
())):
if
isDirectory
(
"{}/emul32/lib32"
.
format
(
get
.
installDIR
())):
copy
(
"{}/emul32/lib32"
.
format
(
get
.
installDIR
()),
"{}/"
.
format
(
get
.
installDIR
()))
if
isDirectory
(
"{}/emul32/usr/lib32"
.
format
(
get
.
installDIR
())):
copy
(
"{}/emul32/usr/lib32"
.
format
(
get
.
installDIR
()),
"{}/usr/"
.
format
(
get
.
installDIR
()))
removeDir
(
"/emul32"
)
def
ninja_check
():
...
...
inary/actionsapi/perlmodules.py
Dosyayı görüntüle @
493df95c
...
...
@@ -59,7 +59,7 @@ def configure(parameters=''):
if
can_access_file
(
'Build.PL'
):
if
system
(
'perl{0} Build.PL installdirs=vendor destdir={1}'
.
format
(
get
.
curPERL
(),
get
.
installDIR
())):
raise
ConfigureError
(
_
(
'Configure failed.'
))
elif
can_access_file
(
'
Build
.PL'
):
elif
can_access_file
(
'
Makefile
.PL'
):
if
system
(
'perl{0} Makefile.PL {1} PREFIX=/usr INSTALLDIRS=vendor DESTDIR={2}'
.
format
(
get
.
curPERL
(),
parameters
,
get
.
installDIR
())):
raise
ConfigureError
(
_
(
'Configure failed.'
))
...
...
inary/archive.py
Dosyayı görüntüle @
493df95c
...
...
@@ -35,7 +35,6 @@ import inary.util as util
import
inary.context
as
ctx
import
inary.uri
import
inary.fetcher
import
inary.mirrors
class
SourceArchiveError
(
inary
.
errors
.
Error
):
...
...
@@ -887,38 +886,13 @@ class SourceArchive:
ctx
.
ui
.
info
(
_
(
"
\n
Source archive is stored:
\"
{0}/{1}
\"
"
)
.
format
(
ctx
.
config
.
archives_dir
(),
self
.
url
.
filename
()))
def
fetch_from_fallback
(
self
):
archive
=
os
.
path
.
basename
(
self
.
url
.
get_uri
())
src
=
os
.
path
.
join
(
ctx
.
config
.
values
.
build
.
fallback
,
archive
)
ctx
.
ui
.
warning
(
_
(
'Trying fallback address:
\"
{}
\"
'
)
.
format
(
src
))
inary
.
fetcher
.
fetch_url
(
src
,
ctx
.
config
.
archives_dir
(),
self
.
progress
)
inary
.
fetcher
.
fetch_url
(
self
.
url
.
get_uri
(),
ctx
.
config
.
archives_dir
(),
self
.
progress
)
def
fetch_from_locale
(
self
):
url
=
self
.
url
.
uri
if
not
os
.
access
(
url
[
7
:],
os
.
F_OK
):
raise
SourceArchiveError
(
_
(
'No such file or no permission to read.'
))
shutil
.
copy
(
url
[
7
:],
self
.
archiveFile
)
inary
.
fetcher
.
fetch_from_locale
(
self
.
url
.
get_uri
(),
ctx
.
config
.
archives_dir
(),
destfile
=
self
.
uri
.
filename
())
def
fetch_from_mirror
(
self
):
uri
=
self
.
url
.
get_uri
()
sep
=
uri
[
len
(
"mirrors://"
):]
.
split
(
"/"
)
name
=
sep
.
pop
(
0
)
archive
=
"/"
.
join
(
sep
)
mirrors
=
inary
.
mirrors
.
Mirrors
()
.
get_mirrors
(
name
)
if
not
mirrors
:
raise
SourceArchiveError
(
_
(
"
\"
{}
\"
mirrors are not defined."
)
.
format
(
name
))
for
mirror
in
mirrors
:
try
:
url
=
os
.
path
.
join
(
mirror
,
archive
)
ctx
.
ui
.
warning
(
_
(
'Fetching source from mirror:
\"
{}
\"
'
)
.
format
(
url
))
inary
.
fetcher
.
fetch_url
(
url
,
ctx
.
config
.
archives_dir
(),
self
.
progress
)
return
except
inary
.
fetcher
.
FetchError
:
pass
raise
inary
.
fetcher
.
FetchError
(
_
(
'Could not fetch source from
\"
{}
\"
mirrors.'
)
.
format
(
name
))
inary
.
fetcher
.
fetch_from_mirror
(
self
.
url
.
get_uri
(),
ctx
.
config
.
archives_dir
(),
self
.
progress
)
def
is_cached
(
self
,
interactive
=
True
):
if
not
os
.
access
(
self
.
archiveFile
,
os
.
R_OK
):
...
...
inary/cli/__init__.py
Dosyayı görüntüle @
493df95c
...
...
@@ -222,7 +222,7 @@ class CLI(inary.ui.UI):
msg
=
_
(
'Configured
\"
{}
\"
'
)
.
format
(
keywords
[
'package'
]
.
name
)
color
=
'brightgreen'
elif
event
==
inary
.
ui
.
configuring
:
msg
=
_
(
'Configuring
\"
{}
\"
'
)
.
format
(
keywords
[
'package'
]
.
name
)
msg
=
_
(
'Configuring
\"
{}
\"
package.
'
)
.
format
(
keywords
[
'package'
]
.
name
)
color
=
'faintyellow'
elif
event
==
inary
.
ui
.
extracting
:
msg
=
_
(
'Extracting the files of
\"
{}
\"
'
)
.
format
(
keywords
[
'package'
]
.
name
)
...
...
inary/cli/install.py
Dosyayı görüntüle @
493df95c
...
...
@@ -23,7 +23,7 @@ import inary.cli.command as command
import
inary.context
as
ctx
from
inary.operations
import
install
,
helper
import
inary.db
import
inary.util
as
util
class
Install
(
command
.
PackageOp
,
metaclass
=
command
.
autocommand
):
__doc__
=
_
(
"""Install INARY packages
...
...
@@ -110,7 +110,8 @@ expanded to package names.
reinstall
=
bool
(
packages
)
and
packages
[
0
]
.
endswith
(
ctx
.
const
.
package_suffix
)
install
.
install
(
packages
,
ctx
.
get_option
(
'reinstall'
)
or
reinstall
)
config_changes
=
helper
.
check_config_changes
(
order
=
packages
)
config_changes
=
helper
.
check_config_changes
([
util
.
parse_package_name_legacy
(
i
.
split
(
"/"
)[
-
1
])[
0
]
for
i
in
packages
])
if
config_changes
:
if
ctx
.
ui
.
confirm
(
_
(
"[!] Some config files have been changed. Would you like to see and apply them?"
)):
...
...
inary/fetcher.py
Dosyayı görüntüle @
493df95c
...
...
@@ -31,6 +31,7 @@ _ = __trans.gettext
import
inary
import
inary.db
import
inary.errors
import
inary.mirrors
import
inary.util
as
util
import
inary.context
as
ctx
import
inary.uri
...
...
@@ -151,10 +152,6 @@ class Fetcher:
def
fetch
(
self
,
timeout
=
10
):
"""Return value: Fetched file's full path.."""
if
not
ctx
.
config
.
values
.
general
.
ssl_verify
:
import
ssl
ssl
.
_create_default_https_context
=
ssl
.
_create_unverified_context
if
not
self
.
url
.
filename
():
raise
FetchError
(
_
(
'Filename error'
))
...
...
@@ -177,6 +174,16 @@ class Fetcher:
c
.
setopt
(
pycurl
.
FOLLOWLOCATION
,
True
)
c
.
setopt
(
pycurl
.
MAXREDIRS
,
10
)
c
.
setopt
(
pycurl
.
NOSIGNAL
,
True
)
if
not
ctx
.
config
.
values
.
general
.
ssl_verify
:
c
.
setopt
(
pycurl
.
SSL_VERIFYPEER
,
0
)
c
.
setopt
(
pycurl
.
SSL_VERIFYHOST
,
0
)
else
:
c
.
setopt
(
pycurl
.
SSL_VERIFYPEER
,
1
)
c
.
setopt
(
pycurl
.
SSL_VERIFYHOST
,
True
)
# To block man-in-middle attack
# curl.setopt(pycurl.SSL_VERIFYHOST, 2)
# curl.setopt(pycurl.CAINFO, "/etc/inary/certificates/sourceforge.crt")
# Header
# c.setopt(pycurl.HTTPHEADER, ["%s: %s" % header for header in self._get_http_headers().items()])
...
...
@@ -257,13 +264,51 @@ class Fetcher:
else
:
return
0
# helper function
def
fetch_url
(
url
,
destdir
,
progress
=
None
,
destfile
=
None
):
def
fetch_url
(
url
,
destdir
=
None
,
progress
=
None
,
destfile
=
None
):
if
not
destdir
:
destdir
=
ctx
.
config
.
archives_dir
()
if
not
progress
:
progress
=
ctx
.
ui
.
Progress
fetch
=
Fetcher
(
url
,
destdir
,
destfile
)
fetch
.
progress
=
progress
fetch
.
fetch
()
def
fetch_from_fallback
(
url
,
destdir
=
None
,
progress
=
None
,
destfile
=
None
):
archive
=
os
.
path
.
basename
(
url
)
src
=
os
.
path
.
join
(
ctx
.
config
.
values
.
build
.
fallback
,
archive
)
ctx
.
ui
.
warning
(
_
(
'Trying fallback address:
\"
{}
\"
'
)
.
format
(
src
))
fetch_url
(
src
,
destdir
=
destdir
,
progress
=
progress
,
destfile
=
destfile
)
def
fetch_from_locale
(
url
,
destdir
=
None
,
progress
=
None
,
destfile
=
None
):
if
not
destdir
:
destdir
=
ctx
.
config
.
archives_dir
()
if
url
.
startswith
(
"file://"
):
url
=
url
[
7
:]
if
not
os
.
access
(
url
,
os
.
F_OK
):
raise
FetchError
(
_
(
'No such file or no permission to read for {}.'
)
.
format
(
url
))
shutil
.
copy
(
url
,
os
.
path
.
join
(
destdir
,
destfile
or
url
.
split
(
"/"
)[
-
1
]))
def
fetch_from_mirror
(
url
,
destdir
=
None
,
progress
=
None
,
destfile
=
None
):
sep
=
url
[
len
(
"mirrors://"
):]
.
split
(
"/"
)
name
=
sep
.
pop
(
0
)
archive
=
"/"
.
join
(
sep
)
mirrors
=
inary
.
mirrors
.
Mirrors
()
.
get_mirrors
(
name
)
if
not
mirrors
:
raise
inary
.
mirrors
.
MirrorError
(
_
(
"
\"
{}
\"
mirrors are not defined."
)
.
format
(
name
))
for
mirror
in
mirrors
:
try
:
mirror_url
=
os
.
path
.
join
(
mirror
,
archive
)
ctx
.
ui
.
warning
(
_
(
'Fetching source from mirror:
\"
{}
\"
'
)
.
format
(
mirror
))
fetch_url
(
mirror_url
,
destdir
=
destdir
,
progress
=
progress
,
destfile
=
destfile
)
return
except
FetchError
:
pass
raise
FetchError
(
_
(
'Could not fetch source from
\"
{}
\"
mirrors.'
)
.
format
(
name
))
# Operation function
def
fetch
(
packages
=
None
,
path
=
os
.
path
.
curdir
):
...
...
inary/mirrors.py
Dosyayı görüntüle @
493df95c
...
...
@@ -20,6 +20,8 @@ import gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
class
MirrorError
(
inary
.
errors
.
Error
):
pass
class
Mirrors
:
def
__init__
(
self
,
config
=
ctx
.
const
.
mirrors_conf
):
...
...
inary/operations/build.py
Dosyayı görüntüle @
493df95c
...
...
@@ -1065,7 +1065,12 @@ package might be a good solution."))
for
fn
in
files
:
filepath
=
util
.
join_path
(
root
,
fn
)
if
witcher
:
fileinfo
=
witcher
(
filepath
)
.
name
try
:
fileinfo
=
witcher
(
filepath
)
.
name
except
ValueError
:
ctx
.
ui
.
warning
(
_
(
"File
\"
{}
\"
might be a broken symlink. Check it before publishing package."
.
format
(
filepath
)))
fileinfo
=
"broken symlink"
ctx
.
ui
.
info
(
_
(
"
\'
magic
\'
return of
\"
{0}
\"
is
\"
{1}
\"
"
)
.
format
(
filepath
,
fileinfo
),
verbose
=
True
)
else
:
ret
,
out
,
err
=
util
.
run_batch
(
"file {}"
.
format
(
filepath
),
ui_debug
=
False
)
...
...
@@ -1170,8 +1175,7 @@ package might be a good solution."))
ctx
.
ui
.
warning
(
_
(
"Ignoring empty package:
\"
{}
\"
"
)
.
format
(
package
.
name
))
continue
ctx
.
ui
.
action
(
_
(
"Building package:
\"
{}
\"
"
)
.
format
(
package
.
name
))
ctx
.
ui
.
status
(
_
(
"Building package:
\"
{}
\"
"
)
.
format
(
package
.
name
),
push_screen
=
True
)
self
.
gen_metadata_xml
(
package
)
name
=
self
.
package_filename
(
self
.
metadata
.
package
)
...
...
inary/operations/repository.py
Dosyayı görüntüle @
493df95c
...
...
@@ -97,7 +97,7 @@ def update_repo(repo, force=False):
def
__update_repo
(
repo
,
force
=
False
):
ctx
.
ui
.
status
(
_
(
'Updating package repository:
\"
{}
\"
'
)
.
format
(
repo
),
push_screen
=
Tru
e
)
ctx
.
ui
.
status
(
_
(
'Updating package repository:
\"
{}
\"
'
)
.
format
(
repo
),
push_screen
=
Fals
e
)
ctx
.
ui
.
notify
(
inary
.
ui
.
updatingrepo
,
name
=
repo
)
repodb
=
inary
.
db
.
repodb
.
RepoDB
()
index
=
inary
.
data
.
index
.
Index
()
...
...
inary/scomiface.py
Dosyayı görüntüle @
493df95c
...
...
@@ -106,7 +106,6 @@ def post_install(package_name, provided_scripts,
fromVersion
,
fromRelease
,
toVersion
,
toRelease
):
"""Do package's post install operations"""
ctx
.
ui
.
info
(
_
(
"Configuring
\"
{}
\"
package."
)
.
format
(
package_name
))
self_post
=
False
package_name
=
safe_script_name
(
package_name
)
...
...
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