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
7ba956ac
Kaydet (Commit)
7ba956ac
authored
Ara 08, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* more elaborate txn protection for packagedb, componentdb and installdb
üst
d9fea246
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
76 deletions
+103
-76
pisi.e3p
pisi.e3p
+7
-3
atomicoperations.py
pisi/atomicoperations.py
+0
-1
component.py
pisi/component.py
+37
-29
index.py
pisi/index.py
+2
-0
installdb.py
pisi/installdb.py
+34
-26
packagedb.py
pisi/packagedb.py
+23
-17
No files found.
pisi.e3p
Dosyayı görüntüle @
7ba956ac
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project SYSTEM "Project-3.8.dtd">
<!-- Project file for project pisi -->
<!-- Saved: 2005-12-0
6, 19:01:5
7 -->
<!-- Saved: 2005-12-0
8, 18:50:2
7 -->
<!-- Copyright (C) 2005 PiSi Development Team, -->
<Project
version=
"3.8"
>
<ProgLanguage
mixed=
"0"
>
Python
</ProgLanguage>
...
...
@@ -462,6 +462,10 @@
<Dir>
tests
</Dir>
<Name>
searchtests.py
</Name>
</Source>
<Source>
<Dir>
pisi
</Dir>
<Name>
dbshelve.py
</Name>
</Source>
</Sources>
<Forms>
</Forms>
...
...
@@ -503,10 +507,10 @@
<VcsOtherData>
{'standardLayout': 1}
</VcsOtherData>
</Vcs>
<FiletypeAssociations>
<FiletypeAssociation
pattern=
"*.py"
type=
"SOURCES"
/>
<FiletypeAssociation
pattern=
"*.ui.h"
type=
"FORMS"
/>
<FiletypeAssociation
pattern=
"*.ptl"
type=
"SOURCES"
/>
<FiletypeAssociation
pattern=
"*.idl"
type=
"INTERFACES"
/>
<FiletypeAssociation
pattern=
"*.ui"
type=
"FORMS"
/>
<FiletypeAssociation
pattern=
"*.p
y
"
type=
"SOURCES"
/>
<FiletypeAssociation
pattern=
"*.p
tl
"
type=
"SOURCES"
/>
</FiletypeAssociations>
</Project>
pisi/atomicoperations.py
Dosyayı görüntüle @
7ba956ac
...
...
@@ -179,7 +179,6 @@ class Install(AtomicOperation):
if
not
ctx
.
ui
.
confirm
(
x
):
raise
Error
(
_
(
'Package downgrade declined'
))
# schedule for reinstall
self
.
old_files
=
ctx
.
installdb
.
files
(
pkg
.
name
)
self
.
old_path
=
ctx
.
installdb
.
pkg_dir
(
pkg
.
name
,
iversion
,
irelease
)
...
...
pisi/component.py
Dosyayı görüntüle @
7ba956ac
...
...
@@ -87,13 +87,15 @@ class ComponentDB(object):
def
close
(
self
):
self
.
d
.
close
()
def
has_component
(
self
,
name
):
return
self
.
d
.
has_key
(
str
(
name
))
def
has_component
(
self
,
name
,
txn
=
None
):
return
self
.
d
.
has_key
(
str
(
name
)
,
txn
)
def
get_component
(
self
,
name
):
if
not
self
.
has_component
(
name
):
self
.
d
[
name
]
=
Component
(
name
=
name
)
return
self
.
d
[
name
]
def
get_component
(
self
,
name
,
txn
=
None
):
def
proc
(
txn
):
if
not
self
.
has_component
(
name
):
self
.
d
[
name
]
=
Component
(
name
=
name
)
return
self
.
d
[
name
]
return
self
.
d
.
txn_proc
(
proc
,
txn
)
def
list_components
(
self
):
list
=
[]
...
...
@@ -101,27 +103,33 @@ class ComponentDB(object):
list
.
append
(
pkg
)
return
list
def
update_component
(
self
,
component
):
if
self
.
d
.
has_key
(
component
.
name
):
# preserve the list of packages
component
.
packages
=
self
.
d
[
component
.
name
]
.
packages
self
.
d
[
component
.
name
]
=
component
def
add_package
(
self
,
component_name
,
package
):
component
=
self
.
get_component
(
component_name
)
component
.
packages
.
append
(
package
)
self
.
d
[
component_name
]
=
component
# update
def
remove_package
(
self
,
component_name
,
package
):
if
not
self
.
has_component
(
component_name
):
raise
Error
(
_
(
'Information for component
%
s not available'
)
%
component_name
)
component
=
self
.
get_component
(
component_name
)
component
.
packages
.
remove
(
package
)
self
.
d
[
component_name
]
=
component
# update
def
clear
(
self
):
self
.
d
.
clear
()
def
remove_component
(
self
,
name
):
def
update_component
(
self
,
component
,
txn
=
None
):
def
proc
(
txn
):
if
self
.
d
.
has_key
(
component
.
name
):
# preserve the list of packages
component
.
packages
=
self
.
d
[
component
.
name
]
.
packages
self
.
d
[
component
.
name
]
=
component
self
.
d
.
txn_proc
(
proc
,
txn
)
def
add_package
(
self
,
component_name
,
package
,
txn
=
None
):
def
proc
(
txn
):
component
=
self
.
get_component
(
component_name
,
txn
)
component
.
packages
.
append
(
package
)
self
.
d
.
put
(
component_name
,
component
,
txn
)
# update
self
.
d
.
txn_proc
(
proc
,
txn
)
def
remove_package
(
self
,
component_name
,
package
,
txn
=
None
):
def
proc
(
txn
):
if
not
self
.
has_component
(
component_name
,
txn
):
raise
Error
(
_
(
'Information for component
%
s not available'
)
%
component_name
)
component
=
self
.
get_component
(
component_name
,
txn
)
component
.
packages
.
remove
(
package
)
self
.
d
.
put
(
component_name
,
component
,
txn
)
# update
self
.
d
.
txn_proc
(
proc
,
txn
)
def
clear
(
self
,
txn
=
None
):
self
.
d
.
clear
(
txn
)
def
remove_component
(
self
,
name
,
txn
=
None
):
name
=
str
(
name
)
del
self
.
d
[
name
]
self
.
d
.
delete
(
name
,
txn
)
pisi/index.py
Dosyayı görüntüle @
7ba956ac
...
...
@@ -34,9 +34,11 @@ from pisi.uri import URI
import
pisi.component
as
component
import
pisi.specfile
as
specfile
class
Error
(
pisi
.
Error
):
pass
class
Index
(
XmlFile
):
__metaclass__
=
autoxml
.
autoxml
...
...
pisi/installdb.py
Dosyayı görüntüle @
7ba956ac
...
...
@@ -96,26 +96,33 @@ class InstallDB:
def
pkg_dir
(
self
,
pkg
,
version
,
release
):
return
join
(
ctx
.
config
.
lib_dir
(),
pkg
+
'-'
+
version
+
'-'
+
release
)
def
is_recorded
(
self
,
pkg
):
def
is_recorded
(
self
,
pkg
,
txn
=
None
):
pkg
=
str
(
pkg
)
return
self
.
d
.
has_key
(
pkg
)
def
proc
(
txn
):
return
self
.
d
.
has_key
(
pkg
)
return
self
.
d
.
txn_proc
(
proc
,
txn
)
def
is_installed
(
self
,
pkg
):
def
is_installed
(
self
,
pkg
,
txn
=
None
):
pkg
=
str
(
pkg
)
if
self
.
is_recorded
(
pkg
):
info
=
self
.
d
[
pkg
]
return
info
.
state
==
'i'
or
info
.
state
==
'ip'
else
:
return
False
def
list_installed
(
self
):
list
=
[]
for
(
pkg
,
info
)
in
self
.
d
.
items
():
if
info
.
state
==
'i'
or
info
.
state
==
'ip'
:
list
.
append
(
pkg
)
return
list
def
proc
(
txn
):
if
self
.
is_recorded
(
pkg
,
txn
):
info
=
self
.
d
.
get
(
pkg
,
txn
)
return
info
.
state
==
'i'
or
info
.
state
==
'ip'
else
:
return
False
return
self
.
d
.
txn_proc
(
proc
,
txn
)
def
list_installed
(
self
,
txn
=
None
):
def
proc
(
txn
):
list
=
[]
for
(
pkg
,
info
)
in
self
.
d
.
items
(
txn
):
if
info
.
state
==
'i'
or
info
.
state
==
'ip'
:
list
.
append
(
pkg
)
return
list
return
self
.
d
.
txn_proc
(
proc
,
txn
)
def
list_pending
(
self
):
# warning: reads the entire db
dict
=
{}
for
(
pkg
,
x
)
in
self
.
dp
.
items
():
pkginfo
=
self
.
d
[
pkg
]
...
...
@@ -139,18 +146,20 @@ class InstallDB:
else
:
return
False
def
install
(
self
,
pkg
,
version
,
release
,
build
,
distro
=
""
):
def
install
(
self
,
pkg
,
version
,
release
,
build
,
distro
=
""
,
txn
=
None
):
"""install package with specific version, release, build"""
pkg
=
str
(
pkg
)
if
self
.
is_installed
(
pkg
):
raise
InstallDBError
(
_
(
"Already installed"
))
if
ctx
.
config
.
get_option
(
'ignore_comar'
):
state
=
'ip'
self
.
dp
[
pkg
]
=
True
else
:
state
=
'i'
self
.
d
[
pkg
]
=
InstallInfo
(
state
,
version
,
release
,
build
,
distro
)
def
proc
(
txn
):
if
self
.
is_installed
(
pkg
,
txn
):
raise
InstallDBError
(
_
(
"Already installed"
))
if
ctx
.
config
.
get_option
(
'ignore_comar'
):
state
=
'ip'
self
.
dp
.
put
(
pkg
,
True
,
txn
)
else
:
state
=
'i'
self
.
d
.
put
(
pkg
,
InstallInfo
(
state
,
version
,
release
,
build
,
distro
),
txn
)
self
.
d
.
txn_proc
(
proc
,
txn
)
def
clear_pending
(
self
,
pkg
):
pkg
=
str
(
pkg
)
...
...
@@ -188,4 +197,3 @@ def finalize():
if
db
:
db
.
close
()
db
=
None
pisi/packagedb.py
Dosyayı görüntüle @
7ba956ac
...
...
@@ -67,24 +67,30 @@ class PackageDB(object):
#TODO: list_upgrades?
def
add_package
(
self
,
package_info
):
def
add_package
(
self
,
package_info
,
txn
=
None
):
name
=
str
(
package_info
.
name
)
self
.
d
[
name
]
=
package_info
for
dep
in
package_info
.
runtimeDependencies
():
dep_name
=
str
(
dep
.
package
)
if
self
.
dr
.
has_key
(
dep_name
):
self
.
dr
[
dep_name
]
.
append
(
(
name
,
dep
)
)
else
:
self
.
dr
[
dep_name
]
=
[
(
name
,
dep
)
]
# add component
ctx
.
componentdb
.
add_package
(
package_info
.
partOf
,
package_info
.
name
)
# index summary and description
for
(
lang
,
doc
)
in
package_info
.
summary
.
iteritems
():
if
lang
in
[
'en'
,
'tr'
]:
pisi
.
search
.
add_doc
(
'summary'
,
lang
,
package_info
.
name
,
doc
)
for
(
lang
,
doc
)
in
package_info
.
description
.
iteritems
():
if
lang
in
[
'en'
,
'tr'
]:
pisi
.
search
.
add_doc
(
'description'
,
lang
,
package_info
.
name
,
doc
)
def
proc
(
txn
):
self
.
d
.
put
(
name
,
package_info
,
txn
)
for
dep
in
package_info
.
runtimeDependencies
():
dep_name
=
str
(
dep
.
package
)
if
self
.
dr
.
has_key
(
dep_name
,
txn
):
revdep
=
self
.
dr
.
get
(
dep_name
,
txn
)
revdep
.
append
(
(
name
,
dep
)
)
self
.
dr
.
put
(
dep_name
,
revdep
,
txn
)
else
:
self
.
dr
.
put
(
dep_name
,
[
(
name
,
dep
)
],
txn
)
# add component
ctx
.
componentdb
.
add_package
(
package_info
.
partOf
,
package_info
.
name
,
txn
)
# index summary and description
for
(
lang
,
doc
)
in
package_info
.
summary
.
iteritems
():
if
lang
in
[
'en'
,
'tr'
]:
pisi
.
search
.
add_doc
(
'summary'
,
lang
,
package_info
.
name
,
doc
)
for
(
lang
,
doc
)
in
package_info
.
description
.
iteritems
():
if
lang
in
[
'en'
,
'tr'
]:
pisi
.
search
.
add_doc
(
'description'
,
lang
,
package_info
.
name
,
doc
)
self
.
d
.
txn_proc
(
proc
,
txn
)
def
clear
(
self
):
self
.
d
.
clear
()
...
...
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