Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Thomas Gambier
slapos
Commits
700655a2
Commit
700655a2
authored
Dec 12, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update-hash: python3 support
also mention automatic installation method
parent
ede3f1a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
update-hash
update-hash
+17
-5
No files found.
update-hash
View file @
700655a2
#!/usr/bin/env python
2
#!/usr/bin/env python
"""
Suggested installation:
Helper script to update buildout.hash.cfg
Usage:
$ ./update-hash [BUILDOUT_HASH_CFG]
Automatic installation using husky, from the root of the repository:
$ npm install
Manual installation:
$ cp update-hash .git/hooks/
$ $EDITOR .git/hooks/pre-commit
...
...
@@ -36,7 +44,6 @@ import hashlib
import
os
import
shutil
import
sys
import
tempfile
# Note: this is an intentionally very restrictive and primitive
# ConfigParser-ish parser.
...
...
@@ -62,7 +69,11 @@ def main():
try
:
outfile
=
os
.
fdopen
(
outfile_fd
,
'w'
)
write
=
outfile
.
write
nextLine
=
iter
(
infile
)
.
next
if
sys
.
version_info
<=
(
3
,):
nextLine
=
iter
(
infile
)
.
next
else
:
nextLine
=
iter
(
infile
)
.
__next__
while
True
:
try
:
line
=
nextLine
()
...
...
@@ -80,7 +91,8 @@ def main():
os
.
path
.
join
(
infile_dirname
,
*
hash_file_path
.
split
(
'/'
)
)
),
'rb'
,
)
.
read
()
)
.
hexdigest
(),
eol
,
...
...
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