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
07e374f0
Commit
07e374f0
authored
13 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
Fix bad deferencing in directory in /data of image
parent
a4191c84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bin/isimage
+1
-1
1 addition, 1 deletion
bin/isimage
bin/isinstall
+2
-0
2 additions, 0 deletions
bin/isinstall
installsystems/image.py
+5
-4
5 additions, 4 deletions
installsystems/image.py
installsystems/tools.py
+3
-3
3 additions, 3 deletions
installsystems/tools.py
with
11 additions
and
8 deletions
bin/isimage
+
1
−
1
View file @
07e374f0
...
...
@@ -40,7 +40,7 @@ def build(options):
for
d
in
(
""
,
"
parser
"
,
"
setup
"
,
"
data
"
):
rp
=
os
.
path
.
join
(
options
.
path
,
d
)
if
not
os
.
path
.
exists
(
rp
):
error
(
"
Missing directory: %s
"
%
rp
)
error
(
"
Missing directory: %s
"
%
d
)
if
not
os
.
path
.
isdir
(
rp
):
error
(
"
Not a directory: %s
"
%
rp
)
if
not
os
.
access
(
rp
,
os
.
R_OK
|
os
.
X_OK
):
...
...
This diff is collapsed.
Click to expand it.
bin/isinstall
+
2
−
0
View file @
07e374f0
...
...
@@ -73,3 +73,5 @@ try:
pkg
.
run_setup
({
"
args
"
:
args
})
except
Exception
as
e
:
error
(
e
)
except
KeyboardInterrupt
:
warn
(
"
Keyboard Interrupted
"
)
This diff is collapsed.
Click to expand it.
installsystems/image.py
+
5
−
4
View file @
07e374f0
...
...
@@ -11,7 +11,6 @@ import stat
import
datetime
import
time
import
json
import
hashlib
import
StringIO
import
ConfigParser
import
subprocess
...
...
@@ -19,10 +18,10 @@ import json
import
tarfile
import
re
import
installsystems.template
import
installsystems.tools
as
istools
from
installsystems.printer
import
*
from
installsystems.tarball
import
Tarball
class
Image
(
object
):
'''
Abstract class of images
'''
...
...
@@ -185,15 +184,17 @@ class SourceImage(Image):
def
create_data_tarball
(
self
,
tar_path
,
data_path
):
'''
Create a data tarball
'''
dname
=
os
.
path
.
basename
(
data_path
)
# not derefence for directory. Verbatim copy.
ddref
=
False
if
os
.
path
.
isdir
(
data_path
)
else
True
try
:
# opening file
if
self
.
pbzip2_path
:
tb
=
open
(
tar_path
,
mode
=
"
w
"
)
p
=
subprocess
.
Popen
(
self
.
pbzip2_path
,
shell
=
False
,
close_fds
=
True
,
stdin
=
subprocess
.
PIPE
,
stdout
=
tb
.
fileno
())
tarball
=
Tarball
.
open
(
mode
=
"
w|
"
,
dereference
=
True
,
fileobj
=
p
.
stdin
)
tarball
=
Tarball
.
open
(
mode
=
"
w|
"
,
dereference
=
ddref
,
fileobj
=
p
.
stdin
)
else
:
tarball
=
Tarball
.
open
(
tar_path
,
"
w:bz2
"
,
dereference
=
True
)
tarball
=
Tarball
.
open
(
tar_path
,
"
w:bz2
"
,
dereference
=
ddref
)
tarball
.
add
(
data_path
,
arcname
=
dname
,
recursive
=
True
)
# closing tarball file
tarball
.
close
()
...
...
This diff is collapsed.
Click to expand it.
installsystems/tools.py
+
3
−
3
View file @
07e374f0
...
...
@@ -7,15 +7,15 @@ InstallSystems Generic Tools Library
'''
import
os
from
installsystems.image
import
Image
import
hashlib
def
md5sum
(
self
,
path
):
def
md5sum
(
path
):
'''
Compute md5 of a file
'''
m
=
hashlib
.
md5
()
m
.
update
(
open
(
path
,
"
r
"
).
read
())
return
m
.
hexdigest
()
def
cp
(
self
,
source
,
destination
):
def
cp
(
source
,
destination
):
'''
Copy a source to destination. Take care of path type
'''
stype
=
path_type
(
source
)
dtype
=
path_type
(
destination
)
...
...
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