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
caaea7a2
Kaydet (Commit)
caaea7a2
authored
Ara 28, 2018
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Önemli bazı yamalar
üst
3e3f83fb
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
39 deletions
+32
-39
conflict.py
inary/analyzer/conflict.py
+1
-1
archive.py
inary/archive.py
+3
-3
__init__.py
inary/cli/__init__.py
+3
-2
emerge.py
inary/cli/emerge.py
+0
-1
upgrade.py
inary/cli/upgrade.py
+4
-4
configfile.py
inary/configfile.py
+2
-2
constants.py
inary/constants.py
+1
-0
fetcher.py
inary/fetcher.py
+4
-3
build.py
inary/operations/build.py
+12
-7
setup.py
setup.py
+2
-16
No files found.
inary/analyzer/conflict.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -41,7 +41,7 @@ class Conflict(relation.Relation):
def
installed_package_conflicts
(
confinfo
):
"""determine if an installed package in *repository* conflicts with
given conflicting spec"""
return
inary
.
data
.
relation
.
installed_package_satisfies
(
confinfo
)
return
relation
.
installed_package_satisfies
(
confinfo
)
def
package_conflicts
(
pkg
,
confs
):
for
c
in
confs
:
...
...
inary/archive.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -273,7 +273,7 @@ class ArchiveLzma(ArchiveBase):
from
backports
import
lzma
lzma_file
=
lzma
.
LZMAFile
(
self
.
file_path
,
"r"
)
output
=
open
(
output_path
,
"w"
)
output
.
write
(
lzma_file
.
read
())
output
.
write
(
lzma_file
.
read
()
.
decode
(
"utf-8"
)
)
output
.
close
()
lzma_file
.
close
()
...
...
@@ -874,12 +874,12 @@ class SourceArchive:
ctx
.
ui
.
info
(
_
(
"Fetching source from: {}"
)
.
format
(
self
.
url
.
uri
))
if
self
.
url
.
get_uri
()
.
startswith
(
"mirrors://"
):
self
.
fetch_from_mirror
()
if
self
.
url
.
get_uri
()
.
startswith
(
"file://"
):
el
if
self
.
url
.
get_uri
()
.
startswith
(
"file://"
):
self
.
fetch_from_locale
()
else
:
inary
.
fetcher
.
fetch_url
(
self
.
url
,
ctx
.
config
.
archives_dir
(),
self
.
progress
)
except
inary
.
fetcher
.
FetchError
:
if
ctx
.
config
.
values
.
build
.
fallback
:
if
ctx
.
config
.
values
.
build
.
fallback
and
not
self
.
is_cached
(
interactive
=
False
)
:
self
.
fetch_from_fallback
()
else
:
raise
...
...
inary/cli/__init__.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -193,10 +193,11 @@ class CLI(inary.ui.UI):
if
ka
[
'percent'
]
==
100
:
self
.
output
(
util
.
colorize
(
_
(
'
\n
[complete]
\n
'
),
'yellow'
))
def
status
(
self
,
msg
=
None
):
def
status
(
self
,
msg
=
None
,
push_screen
=
True
):
if
msg
:
msg
=
str
(
msg
)
self
.
output
(
util
.
colorize
(
msg
+
'
\n
'
,
'brightgreen'
))
if
push_screen
:
self
.
output
(
util
.
colorize
(
msg
+
'
\n
'
,
'brightgreen'
))
util
.
xterm_title
(
msg
)
def
notify
(
self
,
event
,
**
keywords
):
...
...
inary/cli/emerge.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -43,7 +43,6 @@ You can also give the name of a component.
def
options
(
self
):
group
=
optparse
.
OptionGroup
(
self
.
parser
,
_
(
"emerge options"
))
super
(
Emerge
,
self
)
.
add_options
(
group
)
group
.
add_option
(
"-c"
,
"--component"
,
action
=
"store"
,
default
=
None
,
help
=
_
(
"Emerge available packages under given component"
))
group
.
add_option
(
"--ignore-file-conflicts"
,
action
=
"store_true"
,
...
...
inary/cli/upgrade.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -21,7 +21,7 @@ _ = __trans.gettext
import
inary.cli.command
as
command
import
inary.context
as
ctx
import
inary.db
from
inary.operations
import
remove
,
upgrade
from
inary.operations
import
re
pository
,
re
move
,
upgrade
class
Upgrade
(
command
.
PackageOp
,
metaclass
=
command
.
autocommand
):
__doc__
=
_
(
"""Upgrade INARY packages
...
...
@@ -91,7 +91,7 @@ expanded to package names.
else
:
ctx
.
ui
.
info
(
_
(
'Will not update repositories'
))
reposit
ory
=
ctx
.
get_option
(
'repository'
)
reposit
=
ctx
.
get_option
(
'repository'
)
components
=
ctx
.
get_option
(
'component'
)
packages
=
[]
if
components
:
...
...
@@ -99,9 +99,9 @@ expanded to package names.
for
name
in
components
:
if
componentdb
.
has_component
(
name
):
if
repository
:
packages
.
extend
(
componentdb
.
get_packages
(
name
,
walk
=
True
,
repo
=
reposit
ory
))
packages
.
extend
(
componentdb
.
get_packages
(
name
,
walk
=
True
,
repo
=
reposit
))
else
:
packages
.
extend
(
componentdb
.
get_union_packages
(
name
,
walk
=
True
))
packages
.
extend
(
self
.
args
)
upgrade
.
upgrade
(
packages
,
reposit
ory
)
upgrade
.
upgrade
(
packages
,
reposit
)
inary/configfile.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -73,8 +73,8 @@ class GeneralDefaults:
destinationdirectory
=
"/"
autoclean
=
False
distribution
=
"Sulin"
distribution_release
=
"201
8
"
distribution_id
=
"s1
8
"
distribution_release
=
"201
9
"
distribution_id
=
"s1
9
"
architecture
=
"x86_64"
http_proxy
=
os
.
getenv
(
"HTTP_PROXY"
)
or
None
https_proxy
=
os
.
getenv
(
"HTTPS_PROXY"
)
or
None
...
...
inary/constants.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -108,6 +108,7 @@ class Constants(metaclass=Singleton):
self
.
__c
.
files_db
=
"files"
self
.
__c
.
repos
=
"repos"
self
.
__c
.
devel_package_end
=
"-devel"
self
.
__c
.
info_package_end
=
"-pages"
self
.
__c
.
doc_package_end
=
"-docs?$"
self
.
__c
.
assign_to_system_devel
=
[
"system.base"
,
"system.devel"
]
self
.
__c
.
system_devel_component
=
"system.devel"
...
...
inary/fetcher.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -217,12 +217,13 @@ class Fetcher:
handler
.
update
(
bytes_read
)
handler
.
end
(
bytes_read
)
except
OSError
as
e
:
raise
FetchError
(
_
(
'Could not fetch destination file "{0}":{1}'
)
.
format
(
self
.
url
.
get_uri
(),
e
))
ctx
.
ui
.
error
(
FetchError
(
_
(
'Could not fetch destination file: "{0}"
\n\n
TraceBack:{1}'
)
.
format
(
self
.
url
.
get_uri
(),
e
)
))
except
requests
.
exceptions
.
InvalidSchema
:
# TODO: Add ftp downloader with ftplib
raise
FetchError
(
_
(
'Package manager not support downloding from ftp mirror'
))
ctx
.
ui
.
error
(
FetchError
(
_
(
'Package manager not support downloding from ftp mirror'
)
))
except
requests
.
exceptions
.
MissingSchema
:
ctx
.
ui
.
info
(
_
(
"Copying local file {}"
)
.
format
(
self
.
url
.
get_uri
()))
...
...
@@ -230,7 +231,7 @@ class Fetcher:
if
os
.
stat
(
self
.
partial_file
)
.
st_size
==
0
:
os
.
remove
(
self
.
partial_file
)
raise
FetchError
(
_
(
'A problem occurred. Please check the archive address and/or permissions again.'
))
ctx
.
ui
.
error
(
FetchError
(
_
(
'A problem occurred. Please check the archive address and/or permissions again.'
)
))
shutil
.
move
(
self
.
partial_file
,
self
.
archive_file
)
...
...
inary/operations/build.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -324,8 +324,7 @@ class Builder:
architecture
))
ctx
.
ui
.
status
(
_
(
"Building source package: {}"
)
.
format
(
self
.
spec
.
source
.
name
))
self
.
spec
.
source
.
name
))
# check if all patch files exists, if there are missing no need
# to unpack!
self
.
check_patches
()
...
...
@@ -521,10 +520,12 @@ class Builder:
self
.
spec
.
source
.
partOf
=
comp
.
name
def
fetch_source_archives
(
self
):
ctx
.
ui
.
status
(
_
(
"Building source package: {} [ Fetching Step ]"
)
.
format
(
self
.
spec
.
source
.
name
),
push_screen
=
False
)
self
.
sourceArchives
.
fetch
()
def
unpack_source_archives
(
self
):
ctx
.
ui
.
action
(
_
(
"Unpacking archive(s)..."
))
ctx
.
ui
.
status
(
_
(
"
\n
* Building source package: {} [ Unpacking Step ]"
)
.
format
(
self
.
spec
.
source
.
name
),
push_screen
=
False
)
self
.
sourceArchives
.
unpack
(
self
.
pkg_work_dir
())
# Grab AdditionalFiles
...
...
@@ -532,26 +533,30 @@ class Builder:
# apply the patches and prepare a source directory for build.
if
self
.
apply_patches
():
ctx
.
ui
.
info
(
_
(
" unpacked ({})"
)
.
format
(
self
.
pkg_work_dir
()))
ctx
.
ui
.
info
(
_
(
"
->
unpacked ({})"
)
.
format
(
self
.
pkg_work_dir
()))
self
.
set_state
(
"unpack"
)
def
run_setup_action
(
self
):
# Run configure, build and install phase
ctx
.
ui
.
action
(
_
(
"Setting up source..."
))
ctx
.
ui
.
status
(
_
(
"Building source package: {} [ SetupAction Step ]"
)
.
format
(
self
.
spec
.
source
.
name
),
push_screen
=
False
)
ctx
.
ui
.
action
(
_
(
"
\n
* Setting up source..."
))
if
self
.
run_action_function
(
ctx
.
const
.
setup_func
):
self
.
set_state
(
"setupaction"
)
def
run_build_action
(
self
):
ctx
.
ui
.
action
(
_
(
"Building source..."
))
ctx
.
ui
.
status
(
_
(
"Building source package: {} [ BuildAction Step ]"
)
.
format
(
self
.
spec
.
source
.
name
),
push_screen
=
False
)
ctx
.
ui
.
action
(
_
(
"
\n
* Building source..."
))
if
self
.
run_action_function
(
ctx
.
const
.
build_func
):
self
.
set_state
(
"buildaction"
)
def
run_check_action
(
self
):
ctx
.
ui
.
action
(
_
(
"Testing package..."
))
ctx
.
ui
.
status
(
_
(
"Building source package: [ CheckAction Step ] {}"
)
.
format
(
self
.
spec
.
source
.
name
),
push_screen
=
False
)
ctx
.
ui
.
action
(
_
(
"
\n
* Testing package..."
))
self
.
run_action_function
(
ctx
.
const
.
check_func
)
def
run_install_action
(
self
):
ctx
.
ui
.
action
(
_
(
"Installing..."
))
ctx
.
ui
.
status
(
_
(
"Building source package: [ InstallAction Step ] {}"
)
.
format
(
self
.
spec
.
source
.
name
),
push_screen
=
False
)
ctx
.
ui
.
action
(
_
(
"
\n
* Installing..."
))
# Before the default install make sure install_dir is clean
if
not
self
.
build_type
and
os
.
path
.
exists
(
self
.
pkg_install_dir
()):
...
...
setup.py
Dosyayı görüntüle @
caaea7a2
...
...
@@ -47,7 +47,6 @@ class Build(build):
name
,
ext
=
os
.
path
.
splitext
(
in_file
)
self
.
spawn
([
"intltool-merge"
,
"-x"
,
"po"
,
in_file
,
os
.
path
.
join
(
self
.
build_base
,
name
)])
class
BuildPo
(
build
):
def
run
(
self
):
build
.
run
(
self
)
...
...
@@ -99,7 +98,6 @@ class BuildPo(build):
except
OSError
:
pass
class
Install
(
install
):
def
run
(
self
):
install
.
run
(
self
)
...
...
@@ -162,19 +160,6 @@ class Install(install):
inaryconf
.
write
(
"{0[0]} = {0[1]}
\n
"
.
format
(
member
))
inaryconf
.
write
(
'
\n
'
)
class
Uninstall
(
Command
):
user_options
=
[]
def
initialize_options
(
self
):
pass
def
finalize_options
(
self
):
pass
def
run
(
self
):
print
(
'Uninstalling ...'
)
project_dir
=
os
.
path
.
join
(
get_python_lib
(),
PROJECT
)
if
os
.
path
.
exists
(
project_dir
):
print
(
' removing: '
,
project_dir
)
shutil
.
rmtree
(
project_dir
)
class
Test
(
Command
):
user_options
=
[]
def
initialize_options
(
self
):
...
...
@@ -197,6 +182,7 @@ datas = [
(
"/usr/lib/tmpfiles.d/"
,
[
"config/inary.conf-armv7h"
])
]
setup
(
name
=
"inary"
,
version
=
inary
.
__version__
,
description
=
"Inary (Special Package Manager)"
,
...
...
@@ -206,6 +192,7 @@ setup(name="inary",
author_email
=
"zaryob.dev@gmail.com"
,
url
=
"https://github.com/Zaryob/inary"
,
#package_dir = {'': ''},
packages
=
[
'inary'
,
'inary.actionsapi'
,
'inary.analyzer'
,
...
...
@@ -220,7 +207,6 @@ setup(name="inary",
cmdclass
=
{
'build'
:
Build
,
'build_po'
:
BuildPo
,
'install'
:
Install
,
'uninstall'
:
Uninstall
,
'test'
:
Test
},
data_files
=
datas
)
...
...
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