Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
5481c18e
Commit
5481c18e
authored
13 years ago
by
Sebastien Luttringer
Browse files
Options
Downloads
Patches
Plain Diff
image and database format use now x.y format
parent
35ed6554
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
installsystems/database.py
+3
-3
3 additions, 3 deletions
installsystems/database.py
installsystems/image.py
+14
-2
14 additions, 2 deletions
installsystems/image.py
with
17 additions
and
5 deletions
installsystems/database.py
+
3
−
3
View file @
5481c18e
...
...
@@ -52,11 +52,11 @@ class Database(object):
r
=
self
.
ask
(
"
SELECT value FROM misc WHERE key =
'
version
'"
).
fetchone
()
if
r
is
None
:
raise
TypeError
()
self
.
version
=
r
[
0
]
self
.
version
=
float
(
r
[
0
]
)
except
:
self
.
version
=
u
"
1
"
self
.
version
=
1.0
# we only support database v1
if
self
.
version
!
=
u
"
1
"
:
if
self
.
version
>
=
2.0
:
debug
(
"
Invalid database format: %s
"
%
self
.
version
)
raise
Exception
(
"
Invalid database format
"
)
# we make a query to be sure format is valid
...
...
This diff is collapsed.
Click to expand it.
installsystems/image.py
+
14
−
2
View file @
5481c18e
...
...
@@ -10,6 +10,7 @@ import os
import
stat
import
time
import
json
import
math
import
difflib
import
ConfigParser
import
subprocess
...
...
@@ -32,6 +33,8 @@ class Image(object):
Abstract class of images
'''
# format should be a float X.Y but for compatibility reason it's a string
# before version 6, it's strict string comparaison
format
=
"
1
"
extension
=
"
.isimage
"
...
...
@@ -546,8 +549,17 @@ class PackageImage(Image):
desc
=
{}
# check format
img_format
=
self
.
_tarball
.
get_str
(
"
format
"
)
if
img_format
!=
self
.
format
:
raise
Exception
(
"
Invalid tarball image format
"
)
try
:
print
img_format
print
self
.
format
print
math
.
floor
(
float
(
self
.
format
))
+
1.0
#print(int(self.format) + 1)
print
'
toto
'
if
float
(
img_format
)
>=
math
.
floor
(
float
(
self
.
format
))
+
1.0
:
print
'
otot
'
raise
Exception
()
except
:
raise
Exception
(
"
Invalid image format %s
"
%
img_format
)
desc
[
"
format
"
]
=
img_format
# check description
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment