Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.build
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.recipe.build
Commits
a1e0d26e
Commit
a1e0d26e
authored
Dec 26, 2021
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
downloadunpacked: drop code that's not required anymore by slapos.recipe.cmmi
parent
25369e03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
33 deletions
+0
-33
slapos/recipe/downloadunpacked.py
slapos/recipe/downloadunpacked.py
+0
-33
No files found.
slapos/recipe/downloadunpacked.py
View file @
a1e0d26e
...
@@ -29,10 +29,8 @@ import os
...
@@ -29,10 +29,8 @@ import os
import
subprocess
import
subprocess
import
tarfile
import
tarfile
import
tempfile
import
tempfile
from
hashlib
import
md5
from
setuptools
import
archive_util
from
setuptools
import
archive_util
from
.
import
is_true
,
EnvironMixin
,
Shared
from
.
import
is_true
,
EnvironMixin
,
Shared
from
.
import
make_read_only_recursively
# for slapos.recipe.cmmi
class
Recipe
(
EnvironMixin
):
class
Recipe
(
EnvironMixin
):
...
@@ -154,34 +152,3 @@ extraction_drivers = archive_util.extraction_drivers
...
@@ -154,34 +152,3 @@ extraction_drivers = archive_util.extraction_drivers
patched_extraction_drivers
=
extraction_drivers
[:
2
]
+
(
patched_extraction_drivers
=
extraction_drivers
[:
2
]
+
(
unpack_tarfile_patched
,
unpack_tarfile_patched
,
)
)
class
Signature
:
# for slapos.recipe.cmmi
def
__init__
(
self
,
filename
):
self
.
filename
=
filename
self
.
item_list
=
[]
def
update
(
self
,
key
,
value
):
self
.
item_list
.
append
((
'%r: %r'
%
(
key
,
value
)).
encode
())
def
hexdigest
(
self
):
# -> str
m
=
md5
()
for
item
in
self
.
item_list
:
m
.
update
(
item
)
return
m
.
hexdigest
()
def
dumps
(
self
):
return
b'
\
n
'
.
join
(
self
.
item_list
)
def
test
(
self
,
folder_path
):
assert
type
(
folder_path
)
is
str
,
folder_path
digest
=
self
.
hexdigest
()
if
os
.
path
.
basename
(
folder_path
)
==
digest
:
target_path
=
os
.
path
.
join
(
folder_path
,
self
.
filename
)
if
os
.
path
.
exists
(
target_path
)
and
open
(
target_path
,
'rb'
).
read
()
==
self
.
dumps
():
return
True
return
False
def
save
(
self
,
folder_path
):
with
open
(
os
.
path
.
join
(
folder_path
,
self
.
filename
),
'wb'
)
as
f
:
f
.
write
(
self
.
dumps
())
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