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
7303df78
Kaydet (Commit)
7303df78
authored
Nis 14, 2018
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added new feature: Now control free space before installing package
üst
5915e696
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
atomicoperations.py
inary/atomicoperations.py
+6
-1
metadata.py
inary/data/metadata.py
+1
-0
util.py
inary/util.py
+10
-0
No files found.
inary/atomicoperations.py
Dosyayı görüntüle @
7303df78
...
...
@@ -136,6 +136,7 @@ class Install(AtomicOperation):
self
.
metadata
=
self
.
package
.
metadata
self
.
files
=
self
.
package
.
files
self
.
pkginfo
=
self
.
metadata
.
package
self
.
installedSize
=
self
.
metadata
.
package
.
installedSize
self
.
installdb
=
inary
.
db
.
installdb
.
InstallDB
()
self
.
operation
=
INSTALL
self
.
store_old_paths
=
None
...
...
@@ -173,7 +174,11 @@ class Install(AtomicOperation):
def
check_requirements
(
self
):
"""check system requirements"""
#TODO: IS THERE ENOUGH SPACE?
# Check free space
ctx
.
ui
.
debug
(
_
(
"Free Space: {} MB"
)
.
format
(
util
.
free_space
()
/
(
1024
*
1024.0
)))
if
util
.
free_space
()
<
self
.
installedSize
:
raise
Error
(
_
(
"Is there any free space in your disk."
))
# what to do if / is split into /usr, /var, etc.
# check scom
if
self
.
metadata
.
package
.
providesScom
and
ctx
.
scom
:
...
...
inary/data/metadata.py
Dosyayı görüntüle @
7303df78
...
...
@@ -118,6 +118,7 @@ class MetaData(xmlfile.XmlFile, metaclass=autoxml.autoxml):
self
.
package
.
history
=
history
self
.
package
.
conflicts
=
pkg
.
conflicts
self
.
package
.
replaces
=
pkg
.
replaces
self
.
package
.
installedSize
=
pkg
.
installledsize
self
.
package
.
additionalFiles
=
pkg
.
additionalFiles
# FIXME: right way to do it?
...
...
inary/util.py
Dosyayı görüntüle @
7303df78
...
...
@@ -361,6 +361,16 @@ def copy_file_stat(src,dest):
ensure_dirs
(
os
.
path
.
dirname
(
dest
))
shutil
.
copy2
(
src
,
dest
)
def
free_space
(
directory
=
None
):
"""Returns the free space (x Byte) in the device. """
if
not
directory
:
# Defaults to /
directory
=
ctx
.
config
.
values
.
general
.
destinationdirectory
_stat
=
os
.
statvfs
(
directory
)
free_space
=
_stat
.
f_bfree
*
_stat
.
f_bsize
return
free_space
def
read_link
(
link
):
"""Return the normalized path which is pointed by the symbolic link."""
# tarfile module normalizes the paths pointed by symbolic links. This
...
...
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