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
a81da592
Kaydet (Commit)
a81da592
authored
Tem 03, 2019
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge branch 'master' of
https://gitlab.com/sulinos/sulinproject/inary
üst
be487db9
7cce0c5e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
88 additions
and
90 deletions
+88
-90
PKG-INFO
PKG-INFO
+1
-1
addrepo.py
inary/cli/addrepo.py
+23
-14
packagedb.py
inary/db/packagedb.py
+3
-2
repodb.py
inary/db/repodb.py
+12
-41
__init__.py
inary/misc/__init__.py
+19
-1
uniq.py
inary/misc/uniq.py
+0
-22
install.py
inary/operations/install.py
+1
-1
xmlext_iks.py
inary/sxml/xmlext_iks.py
+4
-5
xmlext_minidom.py
inary/sxml/xmlext_minidom.py
+3
-3
util.py
inary/util.py
+22
-0
No files found.
PKG-INFO
Dosyayı görüntüle @
a81da592
...
...
@@ -3,7 +3,7 @@ Name: inary
Version: 1.0
Summary: Inary (Special Package Manager)
Home-page: https://gitlab.com/sulinos/sulinproject/inary
Author:
Ali Riza KESKIN (sulincix) & Suleyman POYRAZ (zaryob)
Author:
Sulin Project Developers
Author-email: zaryob.dev@gmail.com
License: GNU GPL3
Description: Inary is the package management system of Sulin Linux and use with Mac OS, Solaris and FreeBSD
...
...
inary/cli/addrepo.py
Dosyayı görüntüle @
a81da592
...
...
@@ -29,8 +29,11 @@ import inary.misc.epoch2string as e2s
class
AddRepo
(
command
.
Command
,
metaclass
=
command
.
autocommand
):
__doc__
=
_
(
"""Add a repository
Usage: add-repo <indexuri>
Usage: add-repo <repo-name> <indexuri>
add-repo <indexuri>
<repo-name>: It is the optional parameter that using to define repository name.
Unless defined, random data will be used as repository name.
<indexuri>: URI of index file
NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
...
...
@@ -60,22 +63,28 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
repository
.
remove_repo
(
repo
)
def
run
(
self
):
name
,
indexuri
=
None
,
None
if
len
(
self
.
args
)
==
1
:
#We need time based random name.
name
=
e2s
.
nextString
()
name
=
e2s
.
nextString
()
indexuri
=
self
.
args
[
0
]
self
.
init
()
ctx
.
ui
.
debug
(
name
+
" "
+
indexuri
)
if
ctx
.
get_option
(
'no_fetch'
):
if
not
ctx
.
ui
.
confirm
(
_
(
'Add {} repository without updating the database?
\n
By confirming '
'this you are also adding the repository to your system without '
'checking the distribution of the repository.
\n
'
'Do you want to continue?'
)
.
format
(
name
)):
return
repository
.
add_repo
(
name
,
indexuri
,
ctx
.
get_option
(
'at'
))
elif
len
(
self
.
args
)
==
2
:
name
,
indexuri
=
self
.
args
else
:
self
.
help
()
return
self
.
init
()
ctx
.
ui
.
debug
(
_
(
"The repository: {}
\t
Index URI: {} "
))
if
ctx
.
get_option
(
'no_fetch'
):
if
not
ctx
.
ui
.
confirm
(
_
(
'Add {} repository without updating the database?
\n
By confirming '
'this you are also adding the repository to your system without '
'checking the distribution of the repository.
\n
'
'Do you want to continue?'
)
.
format
(
name
)):
return
repository
.
add_repo
(
name
,
indexuri
,
ctx
.
get_option
(
'at'
))
inary/db/packagedb.py
Dosyayı görüntüle @
a81da592
...
...
@@ -23,6 +23,7 @@ import inary.db
import
inary.db.itembyrepo
import
inary.db.lazydb
as
lazydb
from
inary.sxml
import
xmlext
import
inary.util
as
util
import
gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
...
...
@@ -62,7 +63,7 @@ class PackageDB(lazydb.LazyDB):
for
node
in
packages
:
if
xmlext
.
getNodeText
(
node
,
"Replaces"
):
replaces
.
append
(
xmlext
.
getNodeText
(
node
,
"Name"
))
return
uniq
(
replaces
)
return
u
til
.
u
niq
(
replaces
)
@staticmethod
def
__generate_obsoletes
(
doc
):
...
...
@@ -271,4 +272,4 @@ class PackageDB(lazydb.LazyDB):
if
enter_date
>=
since_date
:
packages
.
append
(
pkg
)
return
uniq
(
packages
)
return
u
til
.
u
niq
(
packages
)
inary/db/repodb.py
Dosyayı görüntüle @
a81da592
...
...
@@ -34,16 +34,6 @@ import inary.util as util
xmlext içine tag için remove eklenene kadar böyle
"""
try
:
import
ciksemel
parser
=
"ciksemel"
except
:
import
xml.dom.minidom
as
minidom
parser
=
"minidom"
class
RepoError
(
inary
.
errors
.
Error
):
pass
...
...
@@ -82,29 +72,15 @@ class RepoOrder:
def
set_status
(
self
,
repo_name
,
status
):
repo_doc
=
self
.
_get_doc
()
for
r
in
xmlext
.
getTagByName
(
repo_doc
,
"Repo"
):
if
xmlext
.
getNodeText
(
r
,
"Name"
)
==
repo_name
:
status_node
=
xmlext
.
getNode
(
r
,
"Status"
)
if
status_node
:
xmlext
.
removeChild
(
status_node
,
r
)
xmlext
.
addText
(
r
,
"Status"
,
status
)
else
:
xmlext
.
addText
(
r
,
"Status"
,
status
)
if
parser
==
"ciksemel"
:
for
r
in
repo_doc
.
tags
(
"Repo"
):
if
r
.
getTagData
(
"Name"
)
==
repo_name
:
status_node
=
r
.
getTag
(
"Status"
)
if
status_node
:
status_node
.
firstChild
()
.
hide
()
status_node
.
insertData
(
status
)
else
:
status_node
=
r
.
insertTag
(
"Status"
)
status_node
.
insertData
(
status
)
else
:
for
r
in
repo_doc
.
childNodes
:
if
r
.
nodeType
==
r
.
ELEMENT_NODE
and
r
.
tagName
==
"Repo"
:
if
r
.
getElementsByTagName
(
"Name"
)[
0
]
.
firstChild
.
data
==
repo_name
:
status_node
=
r
.
getElementsByTagName
(
"Status"
)[
0
]
if
status_node
:
status_node
.
childNodes
[
0
]
.
nodeValue
=
status
else
:
status_node
=
repo_node
.
createElement
(
"Status"
)
status_node
.
appendChild
(
repo_doc
.
createTextNode
(
"active"
))
r
.
appendChild
(
status_node
)
self
.
_update
(
repo_doc
)
...
...
@@ -120,17 +96,12 @@ class RepoOrder:
return
"inactive"
def
remove
(
self
,
repo_name
):
repo_doc
=
self
.
_get_doc
()
if
parser
==
"ciksemel"
:
for
r
in
repo_doc
.
tags
(
"Repo"
):
if
r
.
getTagData
(
"Name"
)
==
repo_name
:
r
.
hide
()
else
:
for
r
in
repo_doc
.
getElementsByTagName
(
"Repo"
):
if
r
.
getElementsByTagName
(
"Name"
)[
0
]
.
firstChild
.
data
==
repo_name
:
repo_doc
.
removeChild
(
r
)
for
r
in
xmlext
.
getChildElts
(
repo_doc
):
if
xmlext
.
getNodeText
(
r
,
"Name"
)
==
repo_name
:
xmlext
.
removeChild
(
r
,
repo_doc
)
self
.
_update
(
repo_doc
)
...
...
inary/misc/__init__.py
Dosyayı görüntüle @
a81da592
from
.
import
*
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019, Sulin Community
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
import
inary.errors
class
Error
(
inary
.
errors
.
Error
):
pass
class
Exception
(
inary
.
errors
.
Exception
):
pass
inary/misc/uniq.py
deleted
100644 → 0
Dosyayı görüntüle @
be487db9
from
inary.misc.mergesort
import
*
def
uniq
(
list
,
sort
=
False
):
newlist
=
[]
if
list
!=
[]:
if
sort
:
list
.
sort
()
mcout
=
len
(
list
)
cout
=
0
newlist
.
append
(
list
[
0
])
while
cout
<
mcout
-
1
:
if
list
[
cout
+
1
]
!=
list
[
cout
]:
newlist
.
append
(
list
[
cout
])
cout
=
cout
+
1
else
:
for
item
in
list
:
if
item
not
in
newlist
:
newlist
.
append
(
item
)
else
:
newlist
=
[]
return
newlist
inary/operations/install.py
Dosyayı görüntüle @
a81da592
...
...
@@ -295,7 +295,7 @@ def plan_install_pkg_names(A):
uniqdep
=
[]
for
dep
in
pkg
.
runtimeDependencies
():
uniqdep
.
append
(
dep
)
uniqdep
=
uniq
(
uniqdep
)
uniqdep
=
u
til
.
u
niq
(
uniqdep
)
for
dep
in
uniqdep
:
ctx
.
ui
.
debug
(
' -> checking {}'
.
format
(
str
(
dep
)))
if
not
dep
.
satisfied_by_installed
():
...
...
inary/sxml/xmlext_iks.py
Dosyayı görüntüle @
a81da592
...
...
@@ -191,13 +191,12 @@ def addText(node, tagpath, text):
node
.
insertData
(
text
)
def
removeChild
(
node
,
tag
):
r
=
node
.
getTag
(
tag
)
r
.
hide
()
def
removeChild
(
node
,
doc
):
node
.
hide
()
def
removeChildText
(
node
):
pass
def
removeChildText
(
node
,
text
):
node
.
firstChild
()
.
hide
()
def
removeAttribute
(
node
):
...
...
inary/sxml/xmlext_minidom.py
Dosyayı görüntüle @
a81da592
...
...
@@ -215,12 +215,12 @@ def addText(node, tagPath, text, branch=True):
return
addNode
(
node
,
tagPath
,
newnode
,
branch
=
branch
)
def
removeChild
(
node
,
tag
):
node
.
removeChild
(
tag
)
def
removeChild
(
node
,
doc
):
doc
.
removeChild
(
node
)
def
removeChildText
(
node
):
pass
node
.
childNodes
[
0
]
.
nodeValue
=
""
def
removeAttribute
(
node
):
...
...
inary/util.py
Dosyayı görüntüle @
a81da592
...
...
@@ -162,6 +162,28 @@ def flatten_list(l):
# See: http://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python
return
[
item
for
sublist
in
l
for
item
in
sublist
]
def
uniq
(
list
,
sort
=
False
):
"""Uniq is a list generation algorithm to delete againist arguments by Ali Rıza"""
newlist
=
[]
if
list
!=
[]:
if
sort
:
list
.
sort
()
mcout
=
len
(
list
)
cout
=
0
newlist
.
append
(
list
[
0
])
while
cout
<
mcout
-
1
:
if
list
[
cout
+
1
]
!=
list
[
cout
]:
newlist
.
append
(
list
[
cout
])
cout
=
cout
+
1
else
:
for
item
in
list
:
if
item
not
in
newlist
:
newlist
.
append
(
item
)
else
:
newlist
=
[]
return
newlist
def
strlist
(
l
):
"""Concatenate string reps of l's elements."""
...
...
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