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)
0
Konular (issue)
0
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
af144f4a
Kaydet (Commit)
af144f4a
authored
Kas 05, 2009
tarafından
Ozan Çağlayan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert replace for <Path> as it's not well tested, save the differences into a patch
üst
9b8c188c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
19 deletions
+110
-19
add-replace-attribute-to-path-element.patch
patches/add-replace-attribute-to-path-element.patch
+105
-0
pisi-spec.dtd
pisi-spec.dtd
+0
-1
pisi-spec.rng
pisi-spec.rng
+0
-8
atomicoperations.py
pisi/atomicoperations.py
+4
-4
files.py
pisi/files.py
+0
-1
delta.py
pisi/operations/delta.py
+1
-4
specfile.py
pisi/specfile.py
+0
-1
No files found.
patches/add-replace-attribute-to-path-element.patch
0 → 100644
Dosyayı görüntüle @
af144f4a
Index: pisi-spec.rng
===================================================================
--- pisi-spec.rng (revision 25920)
+++ pisi-spec.rng (revision 25922)
@@ -1521,6 +1521,14 @@
</choice>
</attribute>
</optional>
+ <optional>
+ <attribute name="replace">
+ <choice>
+ <value>false</value>
+ <value>true</value>
+ </choice>
+ </attribute>
+ </optional>
</group>
</define>
Index: pisi/specfile.py
===================================================================
--- pisi/specfile.py (revision 25920)
+++ pisi/specfile.py (revision 25922)
@@ -127,6 +127,7 @@
s_Path = [autoxml.String, autoxml.mandatory]
a_fileType = [autoxml.String, autoxml.optional]
a_permanent = [autoxml.String, autoxml.optional]
+ a_replace = [autoxml.String, autoxml.optional]
def __str__(self):
s = self.path
Index: pisi/operations/delta.py
===================================================================
--- pisi/operations/delta.py (revision 25920)
+++ pisi/operations/delta.py (revision 25922)
@@ -106,8 +106,11 @@
files_new = set(map(lambda x:x.hash, newfiles.list))
files_old = set(map(lambda x:x.hash, oldfiles.list))
- files_delta = files_new - files_old
+ files_delta = list(files_new - files_old)
+ # Add to-be-replaced config files to delta package regardless of its state
+ files_delta.extend([f.hash for f in newfiles.list if f.type=='config' and f.replace])
+
deltas = []
for h in files_delta:
deltas.extend(hashto_files[h])
Index: pisi/files.py
===================================================================
--- pisi/files.py (revision 25920)
+++ pisi/files.py (revision 25922)
@@ -29,6 +29,7 @@
t_Mode = [ autoxml.String, autoxml.optional ]
t_Hash = [ autoxml.String, autoxml.optional, "SHA1Sum" ]
t_Permanent = [ autoxml.String, autoxml.optional ]
+ t_Replace = [ autoxml.String, autoxml.optional ]
def __str__(self):
s = "/%s, type: %s, size: %s, sha1sum: %s" % (self.path, self.type,
Index: pisi/atomicoperations.py
===================================================================
--- pisi/atomicoperations.py (revision 25920)
+++ pisi/atomicoperations.py (revision 25922)
@@ -204,7 +204,7 @@
return True
return not pkg in map(lambda x:x.package, self.pkginfo.conflicts)
-
+
# check file conflicts
file_conflicts = []
for f in self.files.list:
@@ -390,8 +390,8 @@
Remove.remove_file(old_fileinfo[path], self.pkginfo.name)
if self.reinstall():
- # get 'config' typed file objects
- new = filter(lambda x: x.type == 'config', self.files.list)
+ # get 'config' typed file objects if replace is not set
+ new = filter(lambda x: x.type == 'config' and not x.replace, self.files.list)
old = filter(lambda x: x.type == 'config', self.old_files.list)
# get config path lists
@@ -530,7 +530,7 @@
if fileinfo.permanent and not remove_permanent:
return
-
+
fpath = pisi.util.join_path(ctx.config.dest_dir(), fileinfo.path)
historydb = pisi.db.historydb.HistoryDB()
Index: pisi-spec.dtd
===================================================================
--- pisi-spec.dtd (revision 25920)
+++ pisi-spec.dtd (revision 25922)
@@ -117,6 +117,7 @@
(executable|library|data|config|doc|man|info|localedata|header)
#REQUIRED>
<!ATTLIST Path permanent (false|true) #IMPLIED>
+<!ATTLIST Path replace (false|true) #IMPLIED>
<!-- History Section -->
pisi-spec.dtd
Dosyayı görüntüle @
af144f4a
...
...
@@ -117,7 +117,6 @@ suck anyway -->
(executable|library|data|config|doc|man|info|localedata|header)
#REQUIRED>
<!ATTLIST Path permanent (false|true) #IMPLIED>
<!ATTLIST Path replace (false|true) #IMPLIED>
<!-- History Section -->
...
...
pisi-spec.rng
Dosyayı görüntüle @
af144f4a
...
...
@@ -1521,14 +1521,6 @@
</choice>
</attribute>
</optional>
<optional>
<attribute
name=
"replace"
>
<choice>
<value>
false
</value>
<value>
true
</value>
</choice>
</attribute>
</optional>
</group>
</define>
...
...
pisi/atomicoperations.py
Dosyayı görüntüle @
af144f4a
...
...
@@ -204,7 +204,7 @@ class Install(AtomicOperation):
return
True
return
not
pkg
in
map
(
lambda
x
:
x
.
package
,
self
.
pkginfo
.
conflicts
)
# check file conflicts
file_conflicts
=
[]
for
f
in
self
.
files
.
list
:
...
...
@@ -390,8 +390,8 @@ class Install(AtomicOperation):
Remove
.
remove_file
(
old_fileinfo
[
path
],
self
.
pkginfo
.
name
)
if
self
.
reinstall
():
# get 'config' typed file objects
if replace is not set
new
=
filter
(
lambda
x
:
x
.
type
==
'config'
and
not
x
.
replace
,
self
.
files
.
list
)
# get 'config' typed file objects
new
=
filter
(
lambda
x
:
x
.
type
==
'config'
,
self
.
files
.
list
)
old
=
filter
(
lambda
x
:
x
.
type
==
'config'
,
self
.
old_files
.
list
)
# get config path lists
...
...
@@ -530,7 +530,7 @@ class Remove(AtomicOperation):
if
fileinfo
.
permanent
and
not
remove_permanent
:
return
fpath
=
pisi
.
util
.
join_path
(
ctx
.
config
.
dest_dir
(),
fileinfo
.
path
)
historydb
=
pisi
.
db
.
historydb
.
HistoryDB
()
...
...
pisi/files.py
Dosyayı görüntüle @
af144f4a
...
...
@@ -29,7 +29,6 @@ class FileInfo:
t_Mode
=
[
autoxml
.
String
,
autoxml
.
optional
]
t_Hash
=
[
autoxml
.
String
,
autoxml
.
optional
,
"SHA1Sum"
]
t_Permanent
=
[
autoxml
.
String
,
autoxml
.
optional
]
t_Replace
=
[
autoxml
.
String
,
autoxml
.
optional
]
def
__str__
(
self
):
s
=
"/
%
s, type:
%
s, size:
%
s, sha1sum:
%
s"
%
(
self
.
path
,
self
.
type
,
...
...
pisi/operations/delta.py
Dosyayı görüntüle @
af144f4a
...
...
@@ -106,10 +106,7 @@ def find_delta(oldfiles, newfiles):
files_new
=
set
(
map
(
lambda
x
:
x
.
hash
,
newfiles
.
list
))
files_old
=
set
(
map
(
lambda
x
:
x
.
hash
,
oldfiles
.
list
))
files_delta
=
list
(
files_new
-
files_old
)
# Add to-be-replaced config files to delta package regardless of its state
files_delta
.
extend
([
f
.
hash
for
f
in
newfiles
.
list
if
f
.
type
==
'config'
and
f
.
replace
])
files_delta
=
files_new
-
files_old
deltas
=
[]
for
h
in
files_delta
:
...
...
pisi/specfile.py
Dosyayı görüntüle @
af144f4a
...
...
@@ -127,7 +127,6 @@ class Path:
s_Path
=
[
autoxml
.
String
,
autoxml
.
mandatory
]
a_fileType
=
[
autoxml
.
String
,
autoxml
.
optional
]
a_permanent
=
[
autoxml
.
String
,
autoxml
.
optional
]
a_replace
=
[
autoxml
.
String
,
autoxml
.
optional
]
def
__str__
(
self
):
s
=
self
.
path
...
...
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