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.template
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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.recipe.template
Commits
c6e89947
Commit
c6e89947
authored
Dec 13, 2021
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve condition to determine if the output file is executable or not
parent
fc8dcbb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
slapos/recipe/template/__init__.py
slapos/recipe/template/__init__.py
+12
-2
No files found.
slapos/recipe/template/__init__.py
View file @
c6e89947
...
...
@@ -108,8 +108,18 @@ class Recipe(object):
output
=
self
.
output
rendered
=
self
.
_render
()
mode
=
self
.
mode
mask
=
(
0o777
if
rendered
.
startswith
(
b'#!'
)
else
0o666
)
if
mode
is
None
else
0
if
mode
is
None
:
mask
=
0o666
if
rendered
.
startswith
(
b'#!'
):
try
:
x
=
rendered
.
index
(
b'
\
n
'
,
2
)
except
ValueError
:
x
=
len
(
rendered
)
x
=
rendered
[
2
:
x
].
split
(
None
,
1
)
if
x
and
os
.
access
(
x
[
0
],
os
.
X_OK
):
mask
=
0o777
else
:
mask
=
0
# Try to reuse existing file. This is particularly
# important to avoid excessive IO because we may render on update.
try
:
...
...
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