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
dfb12a61
Kaydet (Commit)
dfb12a61
authored
Ara 16, 2009
tarafından
Faik Uygur
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix pisi delta's not carrying file permission changes
üst
b4b95742
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
atomicoperations.py
pisi/atomicoperations.py
+8
-0
delta.py
pisi/operations/delta.py
+20
-0
No files found.
pisi/atomicoperations.py
Dosyayı görüntüle @
dfb12a61
...
...
@@ -358,6 +358,13 @@ class Install(AtomicOperation):
os
.
rename
(
oldconfig
,
path
)
# Package file's path may not be relocated or content may not be changed but
# permission may be changed
def
update_permissions
():
permissions
=
pisi
.
operations
.
delta
.
find_permission_changes
(
self
.
old_files
,
self
.
files
)
for
path
,
mode
in
permissions
:
os
.
chmod
(
path
,
mode
)
# Delta package does not contain the files that have the same hash as in
# the old package's. Because it means the file has not changed. But some
# of these files may be relocated to some other directory in the new package.
...
...
@@ -411,6 +418,7 @@ class Install(AtomicOperation):
if
self
.
package_fname
.
endswith
(
ctx
.
const
.
delta_package_suffix
):
relocate_files
()
update_permissions
()
self
.
package
.
extract_install
(
ctx
.
config
.
dest_dir
())
...
...
pisi/operations/delta.py
Dosyayı görüntüle @
dfb12a61
...
...
@@ -10,6 +10,7 @@
# Please read the COPYING file.
import
os
import
stat
import
gettext
__trans
=
gettext
.
translation
(
"pisi"
,
fallback
=
True
)
...
...
@@ -137,3 +138,22 @@ def find_relocations(oldfiles, newfiles):
relocations
.
append
((
files_old
[
h
][
0
],
files_new
[
h
][
i
]))
return
relocations
def
find_permission_changes
(
oldfiles
,
newfiles
):
files_new
=
{}
for
f
in
newfiles
.
list
:
files_new
.
setdefault
(
f
.
hash
,
[])
.
append
(
f
)
hashes_new
=
set
(
map
(
lambda
f
:
f
.
hash
,
newfiles
.
list
))
hashes_old
=
set
(
map
(
lambda
f
:
f
.
hash
,
oldfiles
.
list
))
unchanged
=
hashes_new
.
intersection
(
hashes_old
)
permissions
=
[]
for
h
in
unchanged
:
for
_file
in
files_new
[
h
]:
path
=
"/
%
s"
%
_file
.
path
if
oct
(
stat
.
S_IMODE
(
os
.
stat
(
path
)[
stat
.
ST_MODE
]))
!=
_file
.
mode
:
permissions
.
append
((
path
,
int
(
_file
.
mode
,
8
)))
return
permissions
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