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
54277962
Kaydet (Commit)
54277962
authored
Eki 25, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* uhuhuh
üst
3893da83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
14 deletions
+108
-14
specfilenew.py
pisi/specfilenew.py
+108
-13
specfilenewtests.py
tests/specfilenewtests.py
+0
-1
No files found.
pisi/specfilenew.py
Dosyayı görüntüle @
54277962
...
...
@@ -40,7 +40,7 @@ class Packager:
return
s
class
AdditionalFile
Info
:
class
AdditionalFile
:
s_Filename
=
xmlfile
.
mandatory
a_Target
=
[
xmlfile
.
String
,
xmlfile
.
mandatory
]
a_Permission
=
[
xmlfile
.
String
,
xmlfile
.
optional
]
...
...
@@ -146,14 +146,9 @@ class Source:
t_IsA
=
[
[
xmlfile
.
String
],
xmlfile
.
mandatory
]
t_PartOf
=
[
xmlfile
.
String
,
xmlfile
.
mandatory
]
t_Archive
=
[
Archive
,
xmlfile
.
mandatory
]
t_Patch
=
[
[
Patch
],
xmlfile
.
mandatory
,
"Patches/Patch"
]
t_BuildDep
=
[
[
Dependency
],
xmlfile
.
mandatory
,
"BuildDependencies/Dependency"
]
t_History
=
[
[
Update
],
xmlfile
.
mandatory
,
"History/Update"
]
t_Patch
=
[
[
Patch
],
xmlfile
.
mandatory
,
"Patch"
]
t_BuildDep
=
[
[
Dependency
],
xmlfile
.
mandatory
,
"Dependency"
]
class
AdditionalFile
:
s_filename
=
[
xmlfile
.
String
,
xmlfile
.
mandatory
]
a_target
=
[
xmlfile
.
String
,
xmlfile
.
mandatory
]
a_permission
=
[
xmlfile
.
String
,
xmlfile
.
mandatory
]
class
Package
:
...
...
@@ -162,9 +157,109 @@ class Package:
t_Description
=
[
xmlfile
.
String
,
xmlfile
.
mandatory
]
t_IsA
=
[
[
xmlfile
.
String
],
xmlfile
.
mandatory
]
t_PartOf
=
[
xmlfile
.
String
,
xmlfile
.
mandatory
]
t_History
=
[
[
Update
],
xmlfile
.
mandatory
,
"History/Update"
]
t_Conflicts
=
[
[
xmlfile
.
String
],
xmlfile
.
mandatory
,
"Conflicts/Package"
]
t_ProvidesComar
=
[
[
ComarProvide
],
xmlfile
.
mandatory
,
"Provides/COMAR"
]
t_RequriesComar
=
[
[
xmlfile
.
String
],
xmlfile
.
mandatory
,
"Requires/COMAR"
]
t_AdditionalFiles
=
[
[
AdditionalFile
],
xmlfile
.
mandatory
,
"AdditionalFiles/AdditionalFile"
]
t_Conflicts
=
[
[
xmlfile
.
String
],
xmlfile
.
mandatory
,
"Package"
]
t_ProvidesComar
=
[
[
ComarProvide
],
xmlfile
.
mandatory
,
"COMAR"
]
#t_RequriesComar = [ [xmlfile.String], xmlfile.mandatory, "Requires/COMAR"]
t_AdditionalFiles
=
[
[
AdditionalFile
],
xmlfile
.
mandatory
,
"AdditionalFile"
]
class
SpecFile
(
XmlFile
):
t_Source
=
[
[
Source
],
xmlfile
.
mandatory
,
"Source"
]
t_Packages
=
[
[
Package
],
xmlfile
.
mandatory
,
"Package"
]
t_History
=
[
[
Update
],
xmlfile
.
mandatory
,
"Update"
]
def
read
(
self
,
filename
):
"""Read PSPEC file"""
XmlFile
.
__init__
(
self
,
"PISI"
)
self
.
readxml
(
filename
)
errs
=
[]
self
.
decode
(
self
.
rootNode
(),
errs
)
self
.
merge_tags
()
self
.
override_tags
()
#FIXME: copy only needed information
# no need to keep full history with comments in metadata.xml
self
.
source
.
history
=
self
.
history
for
p
in
self
.
packages
:
p
.
history
=
self
.
history
self
.
unlink
()
errs
=
self
.
has_errors
()
if
errs
:
e
=
""
for
x
in
errs
:
e
+=
x
+
"
\n
"
raise
XmlError
(
_
(
"File '
%
s' has errors:
\n
%
s"
)
%
(
filename
,
e
))
def
override_tags
(
self
):
"""Override tags from Source in Packages. Some tags in Packages
overrides the tags from Source. There is a more detailed
description in documents."""
tmp
=
[]
for
pkg
in
self
.
packages
:
if
not
pkg
.
summary
:
pkg
.
summary
=
self
.
source
.
summary
if
not
pkg
.
description
:
pkg
.
description
=
self
.
source
.
description
if
not
pkg
.
partof
:
pkg
.
partof
=
self
.
source
.
partof
if
not
pkg
.
license
:
pkg
.
license
=
self
.
source
.
license
if
not
pkg
.
icon
:
pkg
.
icon
=
self
.
source
.
icon
tmp
.
append
(
pkg
)
self
.
packages
=
tmp
def
merge_tags
(
self
):
"""Merge tags from Source in Packages. Some tags in Packages merged
with the tags from Source. There is a more detailed
description in documents."""
tmp
=
[]
for
pkg
in
self
.
packages
:
if
pkg
.
isa
and
self
.
source
.
isa
:
pkg
.
isa
.
append
(
self
.
source
.
isa
)
elif
not
pkg
.
isa
and
self
.
source
.
isa
:
pkg
.
isa
=
self
.
source
.
isa
tmp
.
append
(
pkg
)
self
.
packages
=
tmp
def
has_errors
(
self
):
"""Return errors of the PSPEC file if there are any."""
#FIXME: has_errors name is misleading for a function that does
#not just return a boolean value. check() would be better - exa
err
=
Checks
()
err
.
join
(
self
.
source
.
has_errors
())
if
len
(
self
.
packages
)
<=
0
:
errs
.
add
(
_
(
"There should be at least one Package section"
))
for
p
in
self
.
packages
:
err
.
join
(
p
.
has_errors
())
if
len
(
self
.
history
)
<=
0
:
err
.
add
(
_
(
"Source needs some education in History :)"
))
for
update
in
self
.
history
:
err
.
join
(
update
.
has_errors
())
return
err
.
list
def
write
(
self
,
filename
):
"""Write PSPEC file"""
self
.
newDOM
()
self
.
addChild
(
self
.
source
.
elt
(
self
))
for
pkg
in
self
.
packages
:
self
.
addChild
(
pkg
.
elt
(
self
))
self
.
writexml
(
filename
)
tests/specfilenewtests.py
Dosyayı görüntüle @
54277962
...
...
@@ -21,7 +21,6 @@ class SpecFileNewTestCase(unittest.TestCase):
self
.
spec
.
read
(
"tests/popt/pspec.xml"
)
def
testReadSpec
(
self
):
print
'GOTVEREN SENI'
self
.
assertEqual
(
self
.
spec
.
source
.
name
,
"popt"
)
self
.
assertEqual
(
self
.
spec
.
source
.
version
,
"1.7"
)
...
...
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